All Downloads are FREE. Search and download functionalities are using the official Maven repository.

AwsKmsMrkDiscoveryKeyring_Compile.AwsKmsEncryptedDataKeyDecryptor Maven / Gradle / Ivy

// Class AwsKmsEncryptedDataKeyDecryptor
// Dafny class AwsKmsEncryptedDataKeyDecryptor compiled into Java
package AwsKmsMrkDiscoveryKeyring_Compile;

import software.amazon.cryptography.keystore.internaldafny.types.*;
import software.amazon.cryptography.materialproviders.internaldafny.types.*;
import AwsArnParsing_Compile.*;
import AwsKmsMrkMatchForDecrypt_Compile.*;
import AwsKmsUtils_Compile.*;
import KeyStoreErrorMessages_Compile.*;
import KmsArn_Compile.*;
import Structure_Compile.*;
import KMSKeystoreOperations_Compile.*;
import DDBKeystoreOperations_Compile.*;
import CreateKeys_Compile.*;
import CreateKeyStoreTable_Compile.*;
import GetKeys_Compile.*;
import AwsCryptographyKeyStoreOperations_Compile.*;
import software.amazon.cryptography.keystore.internaldafny.*;
import AlgorithmSuites_Compile.*;
import Materials_Compile.*;
import Keyring_Compile.*;
import MultiKeyring_Compile.*;
import AwsKmsMrkAreUnique_Compile.*;
import Constants_Compile.*;
import MaterialWrapping_Compile.*;
import CanonicalEncryptionContext_Compile.*;
import IntermediateKeyWrapping_Compile.*;
import EdkWrapping_Compile.*;
import ErrorMessages_Compile.*;
import AwsKmsKeyring_Compile.*;
import StrictMultiKeyring_Compile.*;
import AwsKmsDiscoveryKeyring_Compile.*;
import DiscoveryMultiKeyring_Compile.*;

@SuppressWarnings({"unchecked", "deprecation"})
public class AwsKmsEncryptedDataKeyDecryptor implements Actions_Compile.ActionWithResult, Actions_Compile.Action> {
  public AwsKmsEncryptedDataKeyDecryptor() {
    this._materials = (software.amazon.cryptography.materialproviders.internaldafny.types.DecryptionMaterials)null;
    this._client = null;
    this._region = dafny.DafnySequence. empty(dafny.TypeDescriptor.CHAR);
    this._grantTokens = dafny.DafnySequence.> empty(software.amazon.cryptography.services.kms.internaldafny.types.GrantTokenType._typeDescriptor());
  }
  public void __ctor(software.amazon.cryptography.materialproviders.internaldafny.types.DecryptionMaterials materials, software.amazon.cryptography.services.kms.internaldafny.types.IKMSClient client, dafny.DafnySequence region, dafny.DafnySequence> grantTokens)
  {
    (this)._materials = materials;
    (this)._client = client;
    (this)._region = region;
    (this)._grantTokens = grantTokens;
  }
  public Wrappers_Compile.Result Invoke(Constants_Compile.AwsKmsEdkHelper helper)
  {
    Wrappers_Compile.Result res = (Wrappers_Compile.Result)null;
    if(true) {
      dafny.DafnySequence _0_awsKmsKey;
      _0_awsKmsKey = __default.ToStringForRegion((helper).dtor_arn(), (this).region());
      Wrappers_Compile.Result _1_valueOrError0 = Wrappers_Compile.Result.Default(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.Tuple0.Default());
      _1_valueOrError0 = AwsKmsUtils_Compile.__default.ValidateKmsKeyId(_0_awsKmsKey);
      if ((_1_valueOrError0).IsFailure(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
        res = (_1_valueOrError0).PropagateFailure(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), Materials_Compile.SealedDecryptionMaterials._typeDescriptor());
        return res;
      }
      dafny.Tuple0 _2___v0;
      _2___v0 = (_1_valueOrError0).Extract(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
      AwsKmsKeyring_Compile.KmsUnwrapKeyMaterial _3_kmsUnwrap;
      AwsKmsKeyring_Compile.KmsUnwrapKeyMaterial _nw0 = new AwsKmsKeyring_Compile.KmsUnwrapKeyMaterial();
      _nw0.__ctor((this).client(), _0_awsKmsKey, (this).grantTokens());
      _3_kmsUnwrap = _nw0;
      Wrappers_Compile.Result, software.amazon.cryptography.materialproviders.internaldafny.types.Error> _4_unwrapOutputRes;
      Wrappers_Compile.Result, software.amazon.cryptography.materialproviders.internaldafny.types.Error> _out0;
      _out0 = EdkWrapping_Compile.__default.UnwrapEdkMaterial(AwsKmsKeyring_Compile.KmsUnwrapInfo._typeDescriptor(), ((helper).dtor_edk()).dtor_ciphertext(), (this).materials(), _3_kmsUnwrap);
      _4_unwrapOutputRes = _out0;
      Wrappers_Compile.Result, software.amazon.cryptography.materialproviders.internaldafny.types.Error> _5_valueOrError1 = Wrappers_Compile.Result., software.amazon.cryptography.materialproviders.internaldafny.types.Error>Default(EdkWrapping_Compile.UnwrapEdkMaterialOutput._typeDescriptor(AwsKmsKeyring_Compile.KmsUnwrapInfo._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), EdkWrapping_Compile.UnwrapEdkMaterialOutput.Default(AwsKmsKeyring_Compile.KmsUnwrapInfo._typeDescriptor(), AwsKmsKeyring_Compile.KmsUnwrapInfo.Default()));
      _5_valueOrError1 = _4_unwrapOutputRes;
      if ((_5_valueOrError1).IsFailure(EdkWrapping_Compile.UnwrapEdkMaterialOutput._typeDescriptor(AwsKmsKeyring_Compile.KmsUnwrapInfo._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
        res = (_5_valueOrError1).PropagateFailure(EdkWrapping_Compile.UnwrapEdkMaterialOutput._typeDescriptor(AwsKmsKeyring_Compile.KmsUnwrapInfo._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), Materials_Compile.SealedDecryptionMaterials._typeDescriptor());
        return res;
      }
      EdkWrapping_Compile.UnwrapEdkMaterialOutput _6_unwrapOutput;
      _6_unwrapOutput = (_5_valueOrError1).Extract(EdkWrapping_Compile.UnwrapEdkMaterialOutput._typeDescriptor(AwsKmsKeyring_Compile.KmsUnwrapInfo._typeDescriptor()), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
      res = Materials_Compile.__default.DecryptionMaterialsAddDataKey((this).materials(), (_6_unwrapOutput).dtor_plaintextDataKey(), (_6_unwrapOutput).dtor_symmetricSigningKey());
    }
    return res;
  }
  public software.amazon.cryptography.materialproviders.internaldafny.types.DecryptionMaterials _materials;
  public software.amazon.cryptography.materialproviders.internaldafny.types.DecryptionMaterials materials()
  {
    return this._materials;
  }
  public software.amazon.cryptography.services.kms.internaldafny.types.IKMSClient _client;
  public software.amazon.cryptography.services.kms.internaldafny.types.IKMSClient client()
  {
    return this._client;
  }
  public dafny.DafnySequence _region;
  public dafny.DafnySequence region()
  {
    return this._region;
  }
  public dafny.DafnySequence> _grantTokens;
  public dafny.DafnySequence> grantTokens()
  {
    return this._grantTokens;
  }
  private static final dafny.TypeDescriptor _TYPE = dafny.TypeDescriptor.referenceWithInitializer(AwsKmsEncryptedDataKeyDecryptor.class, () -> (AwsKmsEncryptedDataKeyDecryptor) null);
  public static dafny.TypeDescriptor _typeDescriptor() {
    return (dafny.TypeDescriptor) (dafny.TypeDescriptor) _TYPE;
  }
  @Override
  public java.lang.String toString() {
    return "AwsKmsMrkDiscoveryKeyring.AwsKmsEncryptedDataKeyDecryptor";
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy