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

AwsKmsHierarchicalKeyring_Compile.OnDecryptHierarchyEncryptedDataKeyFilter Maven / Gradle / Ivy

The newest version!
// Class OnDecryptHierarchyEncryptedDataKeyFilter
// Dafny class OnDecryptHierarchyEncryptedDataKeyFilter compiled into Java
package AwsKmsHierarchicalKeyring_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.*;
import AwsKmsMrkDiscoveryKeyring_Compile.*;
import MrkAwareDiscoveryMultiKeyring_Compile.*;
import AwsKmsMrkKeyring_Compile.*;
import MrkAwareStrictMultiKeyring_Compile.*;
import LocalCMC_Compile.*;
import StormTracker_Compile.*;
import software.amazon.cryptography.internaldafny.StormTrackingCMC.*;
import CacheConstants_Compile.*;

@SuppressWarnings({"unchecked", "deprecation"})
public class OnDecryptHierarchyEncryptedDataKeyFilter implements Actions_Compile.DeterministicActionWithResult, Actions_Compile.DeterministicAction> {
  public OnDecryptHierarchyEncryptedDataKeyFilter() {
    this._branchKeyId = dafny.DafnySequence. empty(dafny.TypeDescriptor.CHAR);
  }
  public void __ctor(dafny.DafnySequence branchKeyId)
  {
    (this)._branchKeyId = branchKeyId;
  }
  public Wrappers_Compile.Result Invoke(software.amazon.cryptography.materialproviders.internaldafny.types.EncryptedDataKey edk)
  {
    Wrappers_Compile.Result res = Wrappers_Compile.Result.Default(dafny.TypeDescriptor.BOOLEAN, software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), false);
    dafny.DafnySequence _0_providerInfo;
    _0_providerInfo = (edk).dtor_keyProviderInfo();
    dafny.DafnySequence _1_providerId;
    _1_providerId = (edk).dtor_keyProviderId();
    if (!(_1_providerId).equals(Constants_Compile.__default.PROVIDER__ID__HIERARCHY())) {
      res = Wrappers_Compile.Result.create_Success(dafny.TypeDescriptor.BOOLEAN, software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), false);
      return res;
    }
    if (!(UTF8.__default.ValidUTF8Seq(_0_providerInfo))) {
      res = Wrappers_Compile.Result.create_Failure(dafny.TypeDescriptor.BOOLEAN, software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), __default.E(dafny.DafnySequence.asString("Invalid encoding, provider info is not UTF8.")));
      return res;
    }
    Wrappers_Compile.Result, software.amazon.cryptography.materialproviders.internaldafny.types.Error> _2_valueOrError0 = Wrappers_Compile.Result., software.amazon.cryptography.materialproviders.internaldafny.types.Error>Default(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.DafnySequence. empty(dafny.TypeDescriptor.CHAR));
    _2_valueOrError0 = (UTF8.__default.Decode(_0_providerInfo)).MapFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), AwsKmsUtils_Compile.__default::WrapStringToError);
    if ((_2_valueOrError0).IsFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
      res = (_2_valueOrError0).PropagateFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.TypeDescriptor.BOOLEAN);
      return res;
    }
    dafny.DafnySequence _3_branchKeyId;
    _3_branchKeyId = (_2_valueOrError0).Extract(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
    res = Wrappers_Compile.Result.create_Success(dafny.TypeDescriptor.BOOLEAN, software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((this).branchKeyId()).equals(_3_branchKeyId));
    return res;
  }
  public dafny.DafnySequence _branchKeyId;
  public dafny.DafnySequence branchKeyId()
  {
    return this._branchKeyId;
  }
  private static final dafny.TypeDescriptor _TYPE = dafny.TypeDescriptor.referenceWithInitializer(OnDecryptHierarchyEncryptedDataKeyFilter.class, () -> (OnDecryptHierarchyEncryptedDataKeyFilter) null);
  public static dafny.TypeDescriptor _typeDescriptor() {
    return (dafny.TypeDescriptor) (dafny.TypeDescriptor) _TYPE;
  }
  @Override
  public java.lang.String toString() {
    return "AwsKmsHierarchicalKeyring.OnDecryptHierarchyEncryptedDataKeyFilter";
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy