Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
AwsCryptographyMaterialProvidersOperations_Compile.__default Maven / Gradle / Ivy
// Class __default
// Dafny class __default compiled into Java
package AwsCryptographyMaterialProvidersOperations_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.*;
import AwsKmsHierarchicalKeyring_Compile.*;
import AwsKmsRsaKeyring_Compile.*;
import EcdhEdkWrapping_Compile.*;
import RawECDHKeyring_Compile.*;
import AwsKmsEcdhKeyring_Compile.*;
import RawAESKeyring_Compile.*;
import RawRSAKeyring_Compile.*;
import CMM_Compile.*;
import Defaults_Compile.*;
import Commitment_Compile.*;
import DefaultCMM_Compile.*;
import DefaultClientSupplier_Compile.*;
import Utils_Compile.*;
import RequiredEncryptionContextCMM_Compile.*;
@SuppressWarnings({"unchecked", "deprecation"})
public class __default {
public __default() {
}
public static Wrappers_Compile.Result CreateAwsKmsKeyring(Config config, software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsKeyringInput input)
{
Wrappers_Compile.Result output = (Wrappers_Compile.Result)null;
Wrappers_Compile.Result _0_valueOrError0 = Wrappers_Compile.Result.Default(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.Tuple0.Default());
_0_valueOrError0 = AwsKmsUtils_Compile.__default.ValidateKmsKeyId((input).dtor_kmsKeyId());
if ((_0_valueOrError0).IsFailure(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_0_valueOrError0).PropagateFailure(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
dafny.Tuple0 _1___v0;
_1___v0 = (_0_valueOrError0).Extract(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
Wrappers_Compile.Result>, software.amazon.cryptography.materialproviders.internaldafny.types.Error> _2_valueOrError1 = Wrappers_Compile.Result.>, software.amazon.cryptography.materialproviders.internaldafny.types.Error>Default(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.DafnySequence.> empty(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)));
_2_valueOrError1 = AwsKmsUtils_Compile.__default.GetValidGrantTokens((input).dtor_grantTokens());
if ((_2_valueOrError1).IsFailure(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_2_valueOrError1).PropagateFailure(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
dafny.DafnySequence extends dafny.DafnySequence extends Character>> _3_grantTokens;
_3_grantTokens = (_2_valueOrError1).Extract(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
AwsKmsKeyring_Compile.AwsKmsKeyring _4_keyring;
AwsKmsKeyring_Compile.AwsKmsKeyring _nw0 = new AwsKmsKeyring_Compile.AwsKmsKeyring();
_nw0.__ctor((input).dtor_kmsClient(), (input).dtor_kmsKeyId(), _3_grantTokens);
_4_keyring = _nw0;
output = ((Wrappers_Compile.Result)(java.lang.Object)(Wrappers_Compile.Result.create_Success(((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(AwsKmsKeyring_Compile.AwsKmsKeyring.class)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), _4_keyring)));
return output;
}
public static Wrappers_Compile.Result CreateAwsKmsDiscoveryKeyring(Config config, software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsDiscoveryKeyringInput input)
{
Wrappers_Compile.Result output = (Wrappers_Compile.Result)null;
if (((input).dtor_discoveryFilter()).is_Some()) {
Wrappers_Compile.Result _0_valueOrError0 = Wrappers_Compile.Result.Default(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.Tuple0.Default());
_0_valueOrError0 = AwsKmsUtils_Compile.__default.ValidateDiscoveryFilter(((input).dtor_discoveryFilter()).dtor_value());
if ((_0_valueOrError0).IsFailure(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_0_valueOrError0).PropagateFailure(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
dafny.Tuple0 _1___v1;
_1___v1 = (_0_valueOrError0).Extract(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
}
Wrappers_Compile.Result>, software.amazon.cryptography.materialproviders.internaldafny.types.Error> _2_valueOrError1 = Wrappers_Compile.Result.>, software.amazon.cryptography.materialproviders.internaldafny.types.Error>Default(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.DafnySequence.> empty(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)));
_2_valueOrError1 = AwsKmsUtils_Compile.__default.GetValidGrantTokens((input).dtor_grantTokens());
if ((_2_valueOrError1).IsFailure(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_2_valueOrError1).PropagateFailure(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
dafny.DafnySequence extends dafny.DafnySequence extends Character>> _3_grantTokens;
_3_grantTokens = (_2_valueOrError1).Extract(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
AwsKmsDiscoveryKeyring_Compile.AwsKmsDiscoveryKeyring _4_keyring;
AwsKmsDiscoveryKeyring_Compile.AwsKmsDiscoveryKeyring _nw0 = new AwsKmsDiscoveryKeyring_Compile.AwsKmsDiscoveryKeyring();
_nw0.__ctor((input).dtor_kmsClient(), (input).dtor_discoveryFilter(), _3_grantTokens);
_4_keyring = _nw0;
output = ((Wrappers_Compile.Result)(java.lang.Object)(Wrappers_Compile.Result.create_Success(((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(AwsKmsDiscoveryKeyring_Compile.AwsKmsDiscoveryKeyring.class)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), _4_keyring)));
return output;
}
public static Wrappers_Compile.Result CreateAwsKmsMultiKeyring(Config config, software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMultiKeyringInput input)
{
Wrappers_Compile.Result output = (Wrappers_Compile.Result)null;
if(true) {
Wrappers_Compile.Result>, software.amazon.cryptography.materialproviders.internaldafny.types.Error> _0_valueOrError0 = Wrappers_Compile.Result.>, software.amazon.cryptography.materialproviders.internaldafny.types.Error>Default(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.DafnySequence.> empty(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)));
_0_valueOrError0 = AwsKmsUtils_Compile.__default.GetValidGrantTokens((input).dtor_grantTokens());
if ((_0_valueOrError0).IsFailure(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_0_valueOrError0).PropagateFailure(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
dafny.DafnySequence extends dafny.DafnySequence extends Character>> _1_grantTokens;
_1_grantTokens = (_0_valueOrError0).Extract(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
if (((input).dtor_clientSupplier()).is_Some()) {
Wrappers_Compile.Result _out0;
_out0 = StrictMultiKeyring_Compile.__default.StrictMultiKeyring((input).dtor_generator(), (input).dtor_kmsKeyIds(), ((input).dtor_clientSupplier()).dtor_value(), Wrappers_Compile.Option.>>create_Some(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), _1_grantTokens));
output = ((Wrappers_Compile.Result)(java.lang.Object)(_out0));
} else {
Wrappers_Compile.Result _2_valueOrError1 = (Wrappers_Compile.Result)null;
Wrappers_Compile.Result _out1;
_out1 = __default.CreateDefaultClientSupplier(config, software.amazon.cryptography.materialproviders.internaldafny.types.CreateDefaultClientSupplierInput.create());
_2_valueOrError1 = _out1;
if ((_2_valueOrError1).IsFailure(((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier.class)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_2_valueOrError1).PropagateFailure(((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier.class)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier _3_clientSupplier;
_3_clientSupplier = (_2_valueOrError1).Extract(((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier.class)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
Wrappers_Compile.Result _out2;
_out2 = StrictMultiKeyring_Compile.__default.StrictMultiKeyring((input).dtor_generator(), (input).dtor_kmsKeyIds(), _3_clientSupplier, Wrappers_Compile.Option.>>create_Some(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), _1_grantTokens));
output = ((Wrappers_Compile.Result)(java.lang.Object)(_out2));
}
}
return output;
}
public static Wrappers_Compile.Result CreateAwsKmsDiscoveryMultiKeyring(Config config, software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsDiscoveryMultiKeyringInput input)
{
Wrappers_Compile.Result output = (Wrappers_Compile.Result)null;
if(true) {
Wrappers_Compile.Result>, software.amazon.cryptography.materialproviders.internaldafny.types.Error> _0_valueOrError0 = Wrappers_Compile.Result.>, software.amazon.cryptography.materialproviders.internaldafny.types.Error>Default(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.DafnySequence.> empty(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)));
_0_valueOrError0 = AwsKmsUtils_Compile.__default.GetValidGrantTokens((input).dtor_grantTokens());
if ((_0_valueOrError0).IsFailure(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_0_valueOrError0).PropagateFailure(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
dafny.DafnySequence extends dafny.DafnySequence extends Character>> _1_grantTokens;
_1_grantTokens = (_0_valueOrError0).Extract(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier _2_clientSupplier = null;
if (((input).dtor_clientSupplier()).is_None()) {
Wrappers_Compile.Result _3_valueOrError1 = (Wrappers_Compile.Result)null;
Wrappers_Compile.Result _out0;
_out0 = __default.CreateDefaultClientSupplier(config, software.amazon.cryptography.materialproviders.internaldafny.types.CreateDefaultClientSupplierInput.create());
_3_valueOrError1 = _out0;
if ((_3_valueOrError1).IsFailure(((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier.class)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_3_valueOrError1).PropagateFailure(((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier.class)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
_2_clientSupplier = (_3_valueOrError1).Extract(((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier.class)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
} else {
_2_clientSupplier = ((input).dtor_clientSupplier()).dtor_value();
}
Wrappers_Compile.Result _out1;
_out1 = DiscoveryMultiKeyring_Compile.__default.DiscoveryMultiKeyring((input).dtor_regions(), (input).dtor_discoveryFilter(), _2_clientSupplier, Wrappers_Compile.Option.>>create_Some(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), _1_grantTokens));
output = ((Wrappers_Compile.Result)(java.lang.Object)(_out1));
}
return output;
}
public static Wrappers_Compile.Result CreateAwsKmsMrkKeyring(Config config, software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkKeyringInput input)
{
Wrappers_Compile.Result output = (Wrappers_Compile.Result)null;
Wrappers_Compile.Result _0_valueOrError0 = Wrappers_Compile.Result.Default(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.Tuple0.Default());
_0_valueOrError0 = AwsKmsUtils_Compile.__default.ValidateKmsKeyId((input).dtor_kmsKeyId());
if ((_0_valueOrError0).IsFailure(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_0_valueOrError0).PropagateFailure(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
dafny.Tuple0 _1___v2;
_1___v2 = (_0_valueOrError0).Extract(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
Wrappers_Compile.Result>, software.amazon.cryptography.materialproviders.internaldafny.types.Error> _2_valueOrError1 = Wrappers_Compile.Result.>, software.amazon.cryptography.materialproviders.internaldafny.types.Error>Default(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.DafnySequence.> empty(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)));
_2_valueOrError1 = AwsKmsUtils_Compile.__default.GetValidGrantTokens((input).dtor_grantTokens());
if ((_2_valueOrError1).IsFailure(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_2_valueOrError1).PropagateFailure(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
dafny.DafnySequence extends dafny.DafnySequence extends Character>> _3_grantTokens;
_3_grantTokens = (_2_valueOrError1).Extract(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
AwsKmsMrkKeyring_Compile.AwsKmsMrkKeyring _4_keyring;
AwsKmsMrkKeyring_Compile.AwsKmsMrkKeyring _nw0 = new AwsKmsMrkKeyring_Compile.AwsKmsMrkKeyring();
_nw0.__ctor((input).dtor_kmsClient(), (input).dtor_kmsKeyId(), _3_grantTokens);
_4_keyring = _nw0;
output = ((Wrappers_Compile.Result)(java.lang.Object)(Wrappers_Compile.Result.create_Success(((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(AwsKmsMrkKeyring_Compile.AwsKmsMrkKeyring.class)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), _4_keyring)));
return output;
}
public static Wrappers_Compile.Result CreateAwsKmsMrkMultiKeyring(Config config, software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkMultiKeyringInput input)
{
Wrappers_Compile.Result output = (Wrappers_Compile.Result)null;
if(true) {
Wrappers_Compile.Result>, software.amazon.cryptography.materialproviders.internaldafny.types.Error> _0_valueOrError0 = Wrappers_Compile.Result.>, software.amazon.cryptography.materialproviders.internaldafny.types.Error>Default(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.DafnySequence.> empty(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)));
_0_valueOrError0 = AwsKmsUtils_Compile.__default.GetValidGrantTokens((input).dtor_grantTokens());
if ((_0_valueOrError0).IsFailure(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_0_valueOrError0).PropagateFailure(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
dafny.DafnySequence extends dafny.DafnySequence extends Character>> _1_grantTokens;
_1_grantTokens = (_0_valueOrError0).Extract(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier _2_clientSupplier = null;
if (((input).dtor_clientSupplier()).is_None()) {
Wrappers_Compile.Result _3_valueOrError1 = (Wrappers_Compile.Result)null;
Wrappers_Compile.Result _out0;
_out0 = __default.CreateDefaultClientSupplier(config, software.amazon.cryptography.materialproviders.internaldafny.types.CreateDefaultClientSupplierInput.create());
_3_valueOrError1 = _out0;
if ((_3_valueOrError1).IsFailure(((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier.class)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_3_valueOrError1).PropagateFailure(((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier.class)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
_2_clientSupplier = (_3_valueOrError1).Extract(((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier.class)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
} else {
_2_clientSupplier = ((input).dtor_clientSupplier()).dtor_value();
}
Wrappers_Compile.Result _out1;
_out1 = MrkAwareStrictMultiKeyring_Compile.__default.MrkAwareStrictMultiKeyring((input).dtor_generator(), (input).dtor_kmsKeyIds(), _2_clientSupplier, Wrappers_Compile.Option.>>create_Some(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), _1_grantTokens));
output = ((Wrappers_Compile.Result)(java.lang.Object)(_out1));
}
return output;
}
public static Wrappers_Compile.Result CreateAwsKmsMrkDiscoveryKeyring(Config config, software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkDiscoveryKeyringInput input)
{
Wrappers_Compile.Result output = (Wrappers_Compile.Result)null;
if (((input).dtor_discoveryFilter()).is_Some()) {
Wrappers_Compile.Result _0_valueOrError0 = Wrappers_Compile.Result.Default(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.Tuple0.Default());
_0_valueOrError0 = AwsKmsUtils_Compile.__default.ValidateDiscoveryFilter(((input).dtor_discoveryFilter()).dtor_value());
if ((_0_valueOrError0).IsFailure(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_0_valueOrError0).PropagateFailure(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
dafny.Tuple0 _1___v3;
_1___v3 = (_0_valueOrError0).Extract(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
}
Wrappers_Compile.Option _2_regionMatch;
_2_regionMatch = software.amazon.cryptography.services.kms.internaldafny.__default.RegionMatch((input).dtor_kmsClient(), (input).dtor_region());
Wrappers_Compile.Outcome _3_valueOrError1 = Wrappers_Compile.Outcome.Default(software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
_3_valueOrError1 = Wrappers_Compile.__default.Need(software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), !java.util.Objects.equals(_2_regionMatch, Wrappers_Compile.Option.create_Some(dafny.TypeDescriptor.BOOLEAN, false)), software.amazon.cryptography.materialproviders.internaldafny.types.Error.create_AwsCryptographicMaterialProvidersException(dafny.DafnySequence.asString("Provided client and region do not match")));
if ((_3_valueOrError1).IsFailure(software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_3_valueOrError1).PropagateFailure(software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
Wrappers_Compile.Result>, software.amazon.cryptography.materialproviders.internaldafny.types.Error> _4_valueOrError2 = Wrappers_Compile.Result.>, software.amazon.cryptography.materialproviders.internaldafny.types.Error>Default(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.DafnySequence.> empty(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)));
_4_valueOrError2 = AwsKmsUtils_Compile.__default.GetValidGrantTokens((input).dtor_grantTokens());
if ((_4_valueOrError2).IsFailure(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_4_valueOrError2).PropagateFailure(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
dafny.DafnySequence extends dafny.DafnySequence extends Character>> _5_grantTokens;
_5_grantTokens = (_4_valueOrError2).Extract(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
AwsKmsMrkDiscoveryKeyring_Compile.AwsKmsMrkDiscoveryKeyring _6_keyring;
AwsKmsMrkDiscoveryKeyring_Compile.AwsKmsMrkDiscoveryKeyring _nw0 = new AwsKmsMrkDiscoveryKeyring_Compile.AwsKmsMrkDiscoveryKeyring();
_nw0.__ctor((input).dtor_kmsClient(), (input).dtor_region(), (input).dtor_discoveryFilter(), _5_grantTokens);
_6_keyring = _nw0;
output = ((Wrappers_Compile.Result)(java.lang.Object)(Wrappers_Compile.Result.create_Success(((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(AwsKmsMrkDiscoveryKeyring_Compile.AwsKmsMrkDiscoveryKeyring.class)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), _6_keyring)));
return output;
}
public static Wrappers_Compile.Result CreateAwsKmsMrkDiscoveryMultiKeyring(Config config, software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkDiscoveryMultiKeyringInput input)
{
Wrappers_Compile.Result output = (Wrappers_Compile.Result)null;
if(true) {
Wrappers_Compile.Result>, software.amazon.cryptography.materialproviders.internaldafny.types.Error> _0_valueOrError0 = Wrappers_Compile.Result.>, software.amazon.cryptography.materialproviders.internaldafny.types.Error>Default(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.DafnySequence.> empty(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)));
_0_valueOrError0 = AwsKmsUtils_Compile.__default.GetValidGrantTokens((input).dtor_grantTokens());
if ((_0_valueOrError0).IsFailure(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_0_valueOrError0).PropagateFailure(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
dafny.DafnySequence extends dafny.DafnySequence extends Character>> _1_grantTokens;
_1_grantTokens = (_0_valueOrError0).Extract(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier _2_clientSupplier = null;
if (((input).dtor_clientSupplier()).is_None()) {
Wrappers_Compile.Result _3_valueOrError1 = (Wrappers_Compile.Result)null;
Wrappers_Compile.Result _out0;
_out0 = __default.CreateDefaultClientSupplier(config, software.amazon.cryptography.materialproviders.internaldafny.types.CreateDefaultClientSupplierInput.create());
_3_valueOrError1 = _out0;
if ((_3_valueOrError1).IsFailure(((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier.class)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_3_valueOrError1).PropagateFailure(((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier.class)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
_2_clientSupplier = (_3_valueOrError1).Extract(((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier.class)), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
} else {
_2_clientSupplier = ((input).dtor_clientSupplier()).dtor_value();
}
Wrappers_Compile.Result _out1;
_out1 = MrkAwareDiscoveryMultiKeyring_Compile.__default.MrkAwareDiscoveryMultiKeyring((input).dtor_regions(), (input).dtor_discoveryFilter(), _2_clientSupplier, Wrappers_Compile.Option.>>create_Some(dafny.DafnySequence.>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR)), _1_grantTokens));
output = ((Wrappers_Compile.Result)(java.lang.Object)(_out1));
}
return output;
}
public static dafny.DafnySequence extends Character> N(long n) {
return StandardLibrary_mString_Compile.__default.Base10Int2String(java.math.BigInteger.valueOf(n));
}
public static Wrappers_Compile.Outcome CheckCache(software.amazon.cryptography.materialproviders.internaldafny.types.CacheType cache, long ttlSeconds)
{
Wrappers_Compile.Outcome output = Wrappers_Compile.Outcome.Default(software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
if(true) {
if ((cache).is_StormTracking()) {
long _0_gracePeriod;
if (((((cache).dtor_StormTracking()).dtor_timeUnits()).UnwrapOr(software.amazon.cryptography.materialproviders.internaldafny.types.TimeUnits._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.TimeUnits.create_Seconds())).is_Seconds()) {
_0_gracePeriod = ((long) (((cache).dtor_StormTracking()).dtor_gracePeriod()));
} else {
_0_gracePeriod = dafny.DafnyEuclidean.EuclideanDivision(((long) (((cache).dtor_StormTracking()).dtor_gracePeriod())), (long) 1000L);
}
software.amazon.cryptography.materialproviders.internaldafny.types.StormTrackingCache _1_storm;
_1_storm = (cache).dtor_StormTracking();
if ((ttlSeconds) <= (_0_gracePeriod)) {
dafny.DafnySequence extends Character> _2_msg;
_2_msg = dafny.DafnySequence.concatenate(dafny.DafnySequence.concatenate(dafny.DafnySequence.concatenate(dafny.DafnySequence.concatenate(dafny.DafnySequence.concatenate(dafny.DafnySequence.concatenate(dafny.DafnySequence.asString("When creating an AwsKmsHierarchicalKeyring with a StormCache, "), dafny.DafnySequence.asString("the ttlSeconds of the KeyRing must be greater than the gracePeriod of the StormCache ")), dafny.DafnySequence.asString("yet the ttlSeconds is ")), __default.N(ttlSeconds)), dafny.DafnySequence.asString(" and the gracePeriod is ")), __default.N(_0_gracePeriod)), dafny.DafnySequence.asString("."));
output = Wrappers_Compile.Outcome.create_Fail(software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error.create_AwsCryptographicMaterialProvidersException(_2_msg));
return output;
}
output = Wrappers_Compile.Outcome.create_Pass(software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
return output;
} else {
output = Wrappers_Compile.Outcome.create_Pass(software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
return output;
}
}
return output;
}
public static Wrappers_Compile.Result CreateAwsKmsHierarchicalKeyring(Config config, software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsHierarchicalKeyringInput input)
{
Wrappers_Compile.Result output = (Wrappers_Compile.Result)null;
software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsCache _0_cmc = null;
if (((input).dtor_cache()).is_Some()) {
Wrappers_Compile.Outcome _1_valueOrError0 = Wrappers_Compile.Outcome.Default(software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
Wrappers_Compile.Outcome _out0;
_out0 = __default.CheckCache(((input).dtor_cache()).dtor_value(), (input).dtor_ttlSeconds());
_1_valueOrError0 = _out0;
if ((_1_valueOrError0).IsFailure(software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
output = (_1_valueOrError0).PropagateFailure(software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), ((dafny.TypeDescriptor)(java.lang.Object)dafny.TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class)));
return output;
}
software.amazon.cryptography.materialproviders.internaldafny.types.CacheType _source0 = ((input).dtor_cache()).dtor_value();
if (_source0.is_Default()) {
software.amazon.cryptography.materialproviders.internaldafny.types.DefaultCache _2___mcc_h0 = ((software.amazon.cryptography.materialproviders.internaldafny.types.CacheType_Default)_source0)._Default;
Wrappers_Compile.Result _3_valueOrError1 = (Wrappers_Compile.Result)null;
Wrappers_Compile.Result