Structure_Compile.__default Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-cryptographic-material-providers Show documentation
Show all versions of aws-cryptographic-material-providers Show documentation
The AWS Cryptographic Material Providers Library for Java
The newest version!
// Class __default
// Dafny class __default compiled into Java
package Structure_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.*;
@SuppressWarnings({"unchecked", "deprecation"})
public class __default {
public __default() {
}
public static boolean BranchKeyContext_q(dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends dafny.DafnySequence extends Character>> m) {
return ((((((((((((((m).>contains(__default.BRANCH__KEY__IDENTIFIER__FIELD())) && ((m).>contains(__default.TYPE__FIELD()))) && ((m).>contains(__default.KEY__CREATE__TIME()))) && ((m).>contains(__default.HIERARCHY__VERSION()))) && ((m).>contains(__default.TABLE__FIELD()))) && ((m).>contains(__default.KMS__FIELD()))) && (software.amazon.cryptography.services.kms.internaldafny.types.__default.IsValid__KeyIdType(((dafny.DafnySequence extends Character>)(java.lang.Object)((m).get(__default.KMS__FIELD())))))) && (!((m).keySet()).>contains(__default.BRANCH__KEY__FIELD()))) && ((java.math.BigInteger.valueOf((((dafny.DafnySequence extends Character>)(java.lang.Object)((m).get(__default.BRANCH__KEY__IDENTIFIER__FIELD())))).length())).signum() == 1)) && ((java.math.BigInteger.valueOf((((dafny.DafnySequence extends Character>)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).length())).signum() == 1)) && (((java.util.function.Function, ? extends dafny.DafnySequence extends Character>>, Boolean>)(_0_m) -> dafny.Helpers.Quantifier(((_0_m).keySet()).Elements(), true, ((_forall_var_0_boxed0) -> {
dafny.DafnySequence extends Character> _forall_var_0 = ((dafny.DafnySequence extends Character>)(java.lang.Object)(_forall_var_0_boxed0));
dafny.DafnySequence extends Character> _1_k = (dafny.DafnySequence extends Character>)_forall_var_0;
return !(((_0_m).keySet()).>contains(_1_k)) || (software.amazon.cryptography.services.dynamodb.internaldafny.types.__default.IsValid__AttributeName(_1_k));
}))).apply(m))) && (((m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())) == ((true) && ((((dafny.DafnySequence extends Character>)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).equals(__default.BRANCH__KEY__ACTIVE__TYPE()))))) && (!((m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())) || ((true) && ((__default.BRANCH__KEY__TYPE__PREFIX()).isProperPrefixOf(((dafny.DafnySequence extends Character>)(java.lang.Object)((m).get(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())))))))) && ((!(m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())) == (((((dafny.DafnySequence extends Character>)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).equals(__default.BEACON__KEY__TYPE__VALUE())) || ((__default.BRANCH__KEY__TYPE__PREFIX()).isProperPrefixOf(((dafny.DafnySequence extends Character>)(java.lang.Object)((m).get(__default.TYPE__FIELD())))))));
}
public static dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> ToAttributeMap(dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends dafny.DafnySequence extends Character>> encryptionContext, dafny.DafnySequence extends java.lang.Byte> encryptedKey)
{
return ((dafny.Function2, ? extends dafny.DafnySequence extends Character>>, dafny.DafnySequence extends java.lang.Byte>, dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue>>)(_0_encryptionContext, _1_encryptedKey) -> ((dafny.Function0, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue>>)(() -> {
java.util.HashMap, software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> _coll0 = new java.util.HashMap<>();
for (dafny.DafnySequence extends Character> _compr_0_boxed0 : (dafny.DafnySet.>difference(dafny.DafnySet.>union((_0_encryptionContext).keySet(), dafny.DafnySet.> of(__default.BRANCH__KEY__FIELD())), dafny.DafnySet.> of(__default.TABLE__FIELD()))).Elements()) {
dafny.DafnySequence extends Character> _compr_0 = ((dafny.DafnySequence extends Character>)(java.lang.Object)(_compr_0_boxed0));
if (true) {
dafny.DafnySequence extends Character> _2_k = (dafny.DafnySequence extends Character>)_compr_0;
if (software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeName._Is(_2_k)) {
if ((dafny.DafnySet.>difference(dafny.DafnySet.>union((_0_encryptionContext).keySet(), dafny.DafnySet.> of(__default.BRANCH__KEY__FIELD())), dafny.DafnySet.> of(__default.TABLE__FIELD()))).>contains(_2_k)) {
_coll0.put(_2_k,(((_2_k).equals(__default.HIERARCHY__VERSION())) ? (software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.create_N(((dafny.DafnySequence extends Character>)(java.lang.Object)((_0_encryptionContext).get(__default.HIERARCHY__VERSION()))))) : ((((_2_k).equals(__default.BRANCH__KEY__FIELD())) ? (software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.create_B(_1_encryptedKey)) : (software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.create_S(((dafny.DafnySequence extends Character>)(java.lang.Object)((_0_encryptionContext).get(_2_k)))))))));
}
}
}
}
return new dafny.DafnyMap,software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue>(_coll0);
})).apply()).apply(encryptionContext, encryptedKey);
}
public static dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends dafny.DafnySequence extends Character>> ToBranchKeyContext(dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> item, dafny.DafnySequence extends Character> logicalKeyStoreName)
{
return ((dafny.Function2, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue>, dafny.DafnySequence extends Character>, dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends dafny.DafnySequence extends Character>>>)(_0_item, _1_logicalKeyStoreName) -> ((dafny.Function0, ? extends dafny.DafnySequence extends Character>>>)(() -> {
java.util.HashMap, dafny.DafnySequence extends Character>> _coll0 = new java.util.HashMap<>();
for (dafny.DafnySequence extends Character> _compr_0_boxed0 : (dafny.DafnySet.>union(dafny.DafnySet.>difference((_0_item).keySet(), dafny.DafnySet.> of(__default.BRANCH__KEY__FIELD())), dafny.DafnySet.> of(__default.TABLE__FIELD()))).Elements()) {
dafny.DafnySequence extends Character> _compr_0 = ((dafny.DafnySequence extends Character>)(java.lang.Object)(_compr_0_boxed0));
dafny.DafnySequence extends Character> _2_k = (dafny.DafnySequence extends Character>)_compr_0;
if ((dafny.DafnySet.>union(dafny.DafnySet.>difference((_0_item).keySet(), dafny.DafnySet.> of(__default.BRANCH__KEY__FIELD())), dafny.DafnySet.> of(__default.TABLE__FIELD()))).>contains(_2_k)) {
_coll0.put(_2_k,(((_2_k).equals(__default.HIERARCHY__VERSION())) ? ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((_0_item).get(_2_k)))).dtor_N()) : ((((_2_k).equals(__default.TABLE__FIELD())) ? (_1_logicalKeyStoreName) : ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((_0_item).get(_2_k)))).dtor_S())))));
}
}
return new dafny.DafnyMap,dafny.DafnySequence extends Character>>(_coll0);
})).apply()).apply(item, logicalKeyStoreName);
}
public static Wrappers_Compile.Result ToBranchKeyMaterials(dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends dafny.DafnySequence extends Character>> encryptionContext, dafny.DafnySequence extends java.lang.Byte> plaintextKey)
{
dafny.DafnySequence extends Character> _0_versionInformation = (((encryptionContext).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())) ? (((dafny.DafnySequence extends Character>)(java.lang.Object)((encryptionContext).get(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())))) : (((dafny.DafnySequence extends Character>)(java.lang.Object)((encryptionContext).get(__default.TYPE__FIELD())))));
dafny.DafnySequence extends Character> _1_branchKeyVersion = (_0_versionInformation).drop(java.math.BigInteger.valueOf((__default.BRANCH__KEY__TYPE__PREFIX()).length()));
Wrappers_Compile.Result, software.amazon.cryptography.keystore.internaldafny.types.Error> _2_valueOrError0 = (UTF8.__default.Encode(_1_branchKeyVersion)).MapFailure(UTF8.ValidUTF8Bytes._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), ((java.util.function.Function, software.amazon.cryptography.keystore.internaldafny.types.Error>)(_3_e_boxed0) -> {
dafny.DafnySequence extends Character> _3_e = ((dafny.DafnySequence extends Character>)(java.lang.Object)(_3_e_boxed0));
return software.amazon.cryptography.keystore.internaldafny.types.Error.create_KeyStoreException(_3_e);
}));
if ((_2_valueOrError0).IsFailure(UTF8.ValidUTF8Bytes._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor())) {
return (_2_valueOrError0).PropagateFailure(UTF8.ValidUTF8Bytes._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.BranchKeyMaterials._typeDescriptor());
} else {
dafny.DafnySequence extends java.lang.Byte> _4_branchKeyVersionUtf8 = (_2_valueOrError0).Extract(UTF8.ValidUTF8Bytes._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor());
Wrappers_Compile.Result, ? extends dafny.DafnySequence extends java.lang.Byte>>, software.amazon.cryptography.keystore.internaldafny.types.Error> _5_valueOrError1 = __default.ExtractCustomEncryptionContext(encryptionContext);
if ((_5_valueOrError1).IsFailure(dafny.DafnyMap., dafny.DafnySequence extends java.lang.Byte>>_typeDescriptor(UTF8.ValidUTF8Bytes._typeDescriptor(), UTF8.ValidUTF8Bytes._typeDescriptor()), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor())) {
return (_5_valueOrError1).PropagateFailure(dafny.DafnyMap., dafny.DafnySequence extends java.lang.Byte>>_typeDescriptor(UTF8.ValidUTF8Bytes._typeDescriptor(), UTF8.ValidUTF8Bytes._typeDescriptor()), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.BranchKeyMaterials._typeDescriptor());
} else {
dafny.DafnyMap extends dafny.DafnySequence extends java.lang.Byte>, ? extends dafny.DafnySequence extends java.lang.Byte>> _6_customEncryptionContext = (_5_valueOrError1).Extract(dafny.DafnyMap., dafny.DafnySequence extends java.lang.Byte>>_typeDescriptor(UTF8.ValidUTF8Bytes._typeDescriptor(), UTF8.ValidUTF8Bytes._typeDescriptor()), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor());
return Wrappers_Compile.Result.create_Success(software.amazon.cryptography.keystore.internaldafny.types.BranchKeyMaterials._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.BranchKeyMaterials.create(((dafny.DafnySequence extends Character>)(java.lang.Object)((encryptionContext).get(__default.BRANCH__KEY__IDENTIFIER__FIELD()))), _4_branchKeyVersionUtf8, _6_customEncryptionContext, plaintextKey));
}
}
}
public static Wrappers_Compile.Result ToBeaconKeyMaterials(dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends dafny.DafnySequence extends Character>> encryptionContext, dafny.DafnySequence extends java.lang.Byte> plaintextKey)
{
Wrappers_Compile.Result, ? extends dafny.DafnySequence extends java.lang.Byte>>, software.amazon.cryptography.keystore.internaldafny.types.Error> _0_valueOrError0 = __default.ExtractCustomEncryptionContext(encryptionContext);
if ((_0_valueOrError0).IsFailure(dafny.DafnyMap., dafny.DafnySequence extends java.lang.Byte>>_typeDescriptor(UTF8.ValidUTF8Bytes._typeDescriptor(), UTF8.ValidUTF8Bytes._typeDescriptor()), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor())) {
return (_0_valueOrError0).PropagateFailure(dafny.DafnyMap., dafny.DafnySequence extends java.lang.Byte>>_typeDescriptor(UTF8.ValidUTF8Bytes._typeDescriptor(), UTF8.ValidUTF8Bytes._typeDescriptor()), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.BeaconKeyMaterials._typeDescriptor());
} else {
dafny.DafnyMap extends dafny.DafnySequence extends java.lang.Byte>, ? extends dafny.DafnySequence extends java.lang.Byte>> _1_customEncryptionContext = (_0_valueOrError0).Extract(dafny.DafnyMap., dafny.DafnySequence extends java.lang.Byte>>_typeDescriptor(UTF8.ValidUTF8Bytes._typeDescriptor(), UTF8.ValidUTF8Bytes._typeDescriptor()), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor());
return Wrappers_Compile.Result.create_Success(software.amazon.cryptography.keystore.internaldafny.types.BeaconKeyMaterials._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), software.amazon.cryptography.keystore.internaldafny.types.BeaconKeyMaterials.create(((dafny.DafnySequence extends Character>)(java.lang.Object)((encryptionContext).get(__default.BRANCH__KEY__IDENTIFIER__FIELD()))), _1_customEncryptionContext, Wrappers_Compile.Option.>create_Some(dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor()), plaintextKey), Wrappers_Compile.Option., ? extends dafny.DafnySequence extends java.lang.Byte>>>create_None(dafny.DafnyMap., dafny.DafnySequence extends java.lang.Byte>>_typeDescriptor(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), dafny.DafnySequence._typeDescriptor(BoundedInts_Compile.uint8._typeDescriptor())))));
}
}
public static Wrappers_Compile.Result, ? extends dafny.DafnySequence extends java.lang.Byte>>, software.amazon.cryptography.keystore.internaldafny.types.Error> ExtractCustomEncryptionContext(dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends dafny.DafnySequence extends Character>> encryptionContext) {
dafny.DafnySet extends dafny.Tuple2, dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>>> _0_encodedEncryptionContext = ((java.util.function.Function, ? extends dafny.DafnySequence extends Character>>, dafny.DafnySet extends dafny.Tuple2, dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>>>>)(_1_encryptionContext) -> ((dafny.Function0, dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>>>>)(() -> {
java.util.ArrayList, dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>>> _coll0 = new java.util.ArrayList<>();
for (dafny.DafnySequence extends Character> _compr_0_boxed0 : (_1_encryptionContext).keySet().Elements()) {
dafny.DafnySequence extends Character> _compr_0 = ((dafny.DafnySequence extends Character>)(java.lang.Object)(_compr_0_boxed0));
dafny.DafnySequence extends Character> _2_k = (dafny.DafnySequence extends Character>)_compr_0;
if (((_1_encryptionContext).>contains(_2_k)) && ((__default.ENCRYPTION__CONTEXT__PREFIX()).isProperPrefixOf(_2_k))) {
_coll0.add(dafny.Tuple2., dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>>create(UTF8.__default.Encode((_2_k).drop(java.math.BigInteger.valueOf((__default.ENCRYPTION__CONTEXT__PREFIX()).length()))), UTF8.__default.Encode(((dafny.DafnySequence extends Character>)(java.lang.Object)((_1_encryptionContext).get(_2_k))))));
}
}
return new dafny.DafnySet, dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>>>(_coll0);
})).apply()).apply(encryptionContext);
Wrappers_Compile.Outcome _3_valueOrError0 = Wrappers_Compile.__default.Need(software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), ((java.util.function.Function, dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>>>, Boolean>)(_4_encodedEncryptionContext) -> dafny.Helpers.Quantifier((_4_encodedEncryptionContext).Elements(), true, ((_forall_var_0_boxed0) -> {
dafny.Tuple2, dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>> _forall_var_0 = ((dafny.Tuple2, dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>>)(java.lang.Object)(_forall_var_0_boxed0));
dafny.Tuple2, dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>> _5_i = (dafny.Tuple2, dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>>)_forall_var_0;
return !((_4_encodedEncryptionContext)., dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>>>contains(_5_i)) || ((((_5_i).dtor__0()).is_Success()) && (((_5_i).dtor__1()).is_Success()));
}))).apply(_0_encodedEncryptionContext), software.amazon.cryptography.keystore.internaldafny.types.Error.create_KeyStoreException(dafny.DafnySequence.asString("Unable to encode string")));
if ((_3_valueOrError0).IsFailure(software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor())) {
return (_3_valueOrError0)., ? extends dafny.DafnySequence extends java.lang.Byte>>>PropagateFailure(software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), dafny.DafnyMap., dafny.DafnySequence extends java.lang.Byte>>_typeDescriptor(UTF8.ValidUTF8Bytes._typeDescriptor(), UTF8.ValidUTF8Bytes._typeDescriptor()));
} else {
return Wrappers_Compile.Result., ? extends dafny.DafnySequence extends java.lang.Byte>>, software.amazon.cryptography.keystore.internaldafny.types.Error>create_Success(dafny.DafnyMap., dafny.DafnySequence extends java.lang.Byte>>_typeDescriptor(UTF8.ValidUTF8Bytes._typeDescriptor(), UTF8.ValidUTF8Bytes._typeDescriptor()), software.amazon.cryptography.keystore.internaldafny.types.Error._typeDescriptor(), ((java.util.function.Function, dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>>>, dafny.DafnyMap extends dafny.DafnySequence extends java.lang.Byte>, ? extends dafny.DafnySequence extends java.lang.Byte>>>)(_6_encodedEncryptionContext) -> ((dafny.Function0, ? extends dafny.DafnySequence extends java.lang.Byte>>>)(() -> {
java.util.HashMap, dafny.DafnySequence extends java.lang.Byte>> _coll1 = new java.util.HashMap<>();
for (dafny.Tuple2, dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>> _compr_1_boxed0 : (_6_encodedEncryptionContext).Elements()) {
dafny.Tuple2, dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>> _compr_1 = ((dafny.Tuple2, dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>>)(java.lang.Object)(_compr_1_boxed0));
dafny.Tuple2, dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>> _7_i = (dafny.Tuple2, dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>>)_compr_1;
if ((_6_encodedEncryptionContext)., dafny.DafnySequence extends Character>>, Wrappers_Compile.Result, dafny.DafnySequence extends Character>>>>contains(_7_i)) {
_coll1.put(((_7_i).dtor__0()).dtor_value(),((_7_i).dtor__1()).dtor_value());
}
}
return new dafny.DafnyMap,dafny.DafnySequence extends java.lang.Byte>>(_coll1);
})).apply()).apply(_0_encodedEncryptionContext));
}
}
public static dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends dafny.DafnySequence extends Character>> DecryptOnlyBranchKeyEncryptionContext(dafny.DafnySequence extends Character> branchKeyId, dafny.DafnySequence extends Character> branchKeyVersion, dafny.DafnySequence extends Character> timestamp, dafny.DafnySequence extends Character> logicalKeyStoreName, dafny.DafnySequence extends Character> kmsKeyArn, dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends dafny.DafnySequence extends Character>> customEncryptionContext)
{
return dafny.DafnyMap., dafny.DafnySequence extends Character>>merge(dafny.DafnyMap.fromElements(new dafny.Tuple2(__default.BRANCH__KEY__IDENTIFIER__FIELD(), branchKeyId), new dafny.Tuple2(__default.TYPE__FIELD(), dafny.DafnySequence.concatenate(__default.BRANCH__KEY__TYPE__PREFIX(), branchKeyVersion)), new dafny.Tuple2(__default.KEY__CREATE__TIME(), timestamp), new dafny.Tuple2(__default.TABLE__FIELD(), logicalKeyStoreName), new dafny.Tuple2(__default.KMS__FIELD(), kmsKeyArn), new dafny.Tuple2(__default.HIERARCHY__VERSION(), dafny.DafnySequence.asString("1"))), ((java.util.function.Function, ? extends dafny.DafnySequence extends Character>>, dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends dafny.DafnySequence extends Character>>>)(_0_customEncryptionContext) -> ((dafny.Function0, ? extends dafny.DafnySequence extends Character>>>)(() -> {
java.util.HashMap, dafny.DafnySequence extends Character>> _coll0 = new java.util.HashMap<>();
for (dafny.DafnySequence extends Character> _compr_0_boxed0 : (_0_customEncryptionContext).keySet().Elements()) {
dafny.DafnySequence extends Character> _compr_0 = ((dafny.DafnySequence extends Character>)(java.lang.Object)(_compr_0_boxed0));
dafny.DafnySequence extends Character> _1_k = (dafny.DafnySequence extends Character>)_compr_0;
if ((_0_customEncryptionContext).>contains(_1_k)) {
_coll0.put(dafny.DafnySequence.concatenate(__default.ENCRYPTION__CONTEXT__PREFIX(), _1_k),((dafny.DafnySequence extends Character>)(java.lang.Object)((_0_customEncryptionContext).get(_1_k))));
}
}
return new dafny.DafnyMap,dafny.DafnySequence extends Character>>(_coll0);
})).apply()).apply(customEncryptionContext));
}
public static dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends dafny.DafnySequence extends Character>> ActiveBranchKeyEncryptionContext(dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends dafny.DafnySequence extends Character>> decryptOnlyEncryptionContext) {
return dafny.DafnyMap., dafny.DafnySequence extends Character>>merge(decryptOnlyEncryptionContext, dafny.DafnyMap.fromElements(new dafny.Tuple2(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD(), ((dafny.DafnySequence extends Character>)(java.lang.Object)((decryptOnlyEncryptionContext).get(__default.TYPE__FIELD())))), new dafny.Tuple2(__default.TYPE__FIELD(), __default.BRANCH__KEY__ACTIVE__TYPE())));
}
public static dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends dafny.DafnySequence extends Character>> BeaconKeyEncryptionContext(dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends dafny.DafnySequence extends Character>> decryptOnlyEncryptionContext) {
return dafny.DafnyMap., dafny.DafnySequence extends Character>>merge(decryptOnlyEncryptionContext, dafny.DafnyMap.fromElements(new dafny.Tuple2(__default.TYPE__FIELD(), __default.BEACON__KEY__TYPE__VALUE())));
}
public static dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends dafny.DafnySequence extends Character>> NewVersionFromActiveBranchKeyEncryptionContext(dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends dafny.DafnySequence extends Character>> activeBranchKeyEncryptionContext, dafny.DafnySequence extends Character> branchKeyVersion, dafny.DafnySequence extends Character> timestamp)
{
return dafny.DafnyMap., dafny.DafnySequence extends Character>>subtract(dafny.DafnyMap., dafny.DafnySequence extends Character>>merge(activeBranchKeyEncryptionContext, dafny.DafnyMap.fromElements(new dafny.Tuple2(__default.TYPE__FIELD(), dafny.DafnySequence.concatenate(__default.BRANCH__KEY__TYPE__PREFIX(), branchKeyVersion)), new dafny.Tuple2(__default.KEY__CREATE__TIME(), timestamp))), dafny.DafnySet.> of(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD()));
}
public static boolean BranchKeyItem_q(dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> m) {
return (((((((((((((((((((((m).>contains(__default.BRANCH__KEY__IDENTIFIER__FIELD())) && ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.BRANCH__KEY__IDENTIFIER__FIELD())))).is_S())) && ((m).>contains(__default.TYPE__FIELD()))) && ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).is_S())) && ((m).>contains(__default.KEY__CREATE__TIME()))) && ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.KEY__CREATE__TIME())))).is_S())) && ((m).>contains(__default.HIERARCHY__VERSION()))) && ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.HIERARCHY__VERSION())))).is_N())) && (!(m).>contains(__default.TABLE__FIELD()))) && ((m).>contains(__default.KMS__FIELD()))) && ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.KMS__FIELD())))).is_S())) && (software.amazon.cryptography.services.kms.internaldafny.types.__default.IsValid__KeyIdType((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.KMS__FIELD())))).dtor_S()))) && ((m).>contains(__default.BRANCH__KEY__FIELD()))) && ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.BRANCH__KEY__FIELD())))).is_B())) && ((java.math.BigInteger.valueOf(((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.BRANCH__KEY__IDENTIFIER__FIELD())))).dtor_S()).length())).signum() == 1)) && ((java.math.BigInteger.valueOf(((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).dtor_S()).length())).signum() == 1)) && (((java.util.function.Function, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue>, Boolean>)(_0_m) -> dafny.Helpers.Quantifier((dafny.DafnySet.>difference((_0_m).keySet(), dafny.DafnySet.> of(__default.BRANCH__KEY__FIELD(), __default.HIERARCHY__VERSION()))).Elements(), true, ((_forall_var_0_boxed0) -> {
dafny.DafnySequence extends Character> _forall_var_0 = ((dafny.DafnySequence extends Character>)(java.lang.Object)(_forall_var_0_boxed0));
dafny.DafnySequence extends Character> _1_k = (dafny.DafnySequence extends Character>)_forall_var_0;
return !((dafny.DafnySet.>difference((_0_m).keySet(), dafny.DafnySet.> of(__default.BRANCH__KEY__FIELD(), __default.HIERARCHY__VERSION()))).>contains(_1_k)) || ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((_0_m).get(_1_k)))).is_S());
}))).apply(m))) && (((m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())) == ((true) && (((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).dtor_S()).equals(__default.BRANCH__KEY__ACTIVE__TYPE()))))) && (!((m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())) || ((true) && ((__default.BRANCH__KEY__TYPE__PREFIX()).isProperPrefixOf((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())))).dtor_S()))))) && ((!(m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())) == ((((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).dtor_S()).equals(__default.BEACON__KEY__TYPE__VALUE())) || ((__default.BRANCH__KEY__TYPE__PREFIX()).isProperPrefixOf((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).dtor_S()))))) && (software.amazon.cryptography.services.kms.internaldafny.types.__default.IsValid__CiphertextType((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.BRANCH__KEY__FIELD())))).dtor_B()));
}
public static boolean ActiveBranchKeyItem_q(dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> m) {
return ((((__default.BranchKeyItem_q(m)) && (((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).dtor_S()).equals(__default.BRANCH__KEY__ACTIVE__TYPE()))) && ((m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD()))) && ((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())))).is_S())) && ((__default.BRANCH__KEY__TYPE__PREFIX()).isProperPrefixOf((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD())))).dtor_S()));
}
public static boolean VersionBranchKeyItem_q(dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> m) {
return ((__default.BranchKeyItem_q(m)) && (!(m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD()))) && ((__default.BRANCH__KEY__TYPE__PREFIX()).isProperPrefixOf((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).dtor_S()));
}
public static boolean BeaconKeyItem_q(dafny.DafnyMap extends dafny.DafnySequence extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> m) {
return ((__default.BranchKeyItem_q(m)) && (!(m).>contains(__default.BRANCH__KEY__ACTIVE__VERSION__FIELD()))) && (((((software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue)(java.lang.Object)((m).get(__default.TYPE__FIELD())))).dtor_S()).equals(__default.BEACON__KEY__TYPE__VALUE()));
}
public static dafny.DafnySequence extends Character> BRANCH__KEY__IDENTIFIER__FIELD()
{
return dafny.DafnySequence.asString("branch-key-id");
}
public static dafny.DafnySequence extends Character> TYPE__FIELD()
{
return dafny.DafnySequence.asString("type");
}
public static dafny.DafnySequence extends Character> KEY__CREATE__TIME()
{
return dafny.DafnySequence.asString("create-time");
}
public static dafny.DafnySequence extends Character> HIERARCHY__VERSION()
{
return dafny.DafnySequence.asString("hierarchy-version");
}
public static dafny.DafnySequence extends Character> TABLE__FIELD()
{
return dafny.DafnySequence.asString("tablename");
}
public static dafny.DafnySequence extends Character> KMS__FIELD()
{
return dafny.DafnySequence.asString("kms-arn");
}
public static dafny.DafnySequence extends Character> BRANCH__KEY__FIELD()
{
return dafny.DafnySequence.asString("enc");
}
public static dafny.DafnySequence extends Character> BRANCH__KEY__ACTIVE__VERSION__FIELD()
{
return dafny.DafnySequence.asString("version");
}
public static dafny.DafnySequence extends Character> BRANCH__KEY__ACTIVE__TYPE()
{
return dafny.DafnySequence.asString("branch:ACTIVE");
}
public static dafny.DafnySequence extends Character> BRANCH__KEY__TYPE__PREFIX()
{
return dafny.DafnySequence.asString("branch:version:");
}
public static dafny.DafnySequence extends Character> BEACON__KEY__TYPE__VALUE()
{
return dafny.DafnySequence.asString("beacon:ACTIVE");
}
public static dafny.DafnySequence extends Character> ENCRYPTION__CONTEXT__PREFIX()
{
return dafny.DafnySequence.asString("aws-crypto-ec:");
}
@Override
public java.lang.String toString() {
return "Structure._default";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy