index
int64 0
0
| repo_id
stringlengths 26
205
| file_path
stringlengths 51
246
| content
stringlengths 8
433k
| __index_level_0__
int64 0
10k
|
---|---|---|---|---|
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore/model/GetActiveBranchKeyInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.keystore.model;
import java.util.Objects;
/**
* Inputs for getting a Branch Key's ACTIVE version.
*/
public class GetActiveBranchKeyInput {
/**
* The identifier for the Branch Key to get the ACTIVE version for.
*/
private final String branchKeyIdentifier;
protected GetActiveBranchKeyInput(BuilderImpl builder) {
this.branchKeyIdentifier = builder.branchKeyIdentifier();
}
/**
* @return The identifier for the Branch Key to get the ACTIVE version for.
*/
public String branchKeyIdentifier() {
return this.branchKeyIdentifier;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param branchKeyIdentifier The identifier for the Branch Key to get the ACTIVE version for.
*/
Builder branchKeyIdentifier(String branchKeyIdentifier);
/**
* @return The identifier for the Branch Key to get the ACTIVE version for.
*/
String branchKeyIdentifier();
GetActiveBranchKeyInput build();
}
static class BuilderImpl implements Builder {
protected String branchKeyIdentifier;
protected BuilderImpl() {
}
protected BuilderImpl(GetActiveBranchKeyInput model) {
this.branchKeyIdentifier = model.branchKeyIdentifier();
}
public Builder branchKeyIdentifier(String branchKeyIdentifier) {
this.branchKeyIdentifier = branchKeyIdentifier;
return this;
}
public String branchKeyIdentifier() {
return this.branchKeyIdentifier;
}
public GetActiveBranchKeyInput build() {
if (Objects.isNull(this.branchKeyIdentifier())) {
throw new IllegalArgumentException("Missing value for required field `branchKeyIdentifier`");
}
return new GetActiveBranchKeyInput(this);
}
}
}
| 300 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore/model/BranchKeyMaterials.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.keystore.model;
import java.nio.ByteBuffer;
import java.util.Map;
import java.util.Objects;
public class BranchKeyMaterials {
private final String branchKeyIdentifier;
private final String branchKeyVersion;
private final Map<String, String> encryptionContext;
private final ByteBuffer branchKey;
protected BranchKeyMaterials(BuilderImpl builder) {
this.branchKeyIdentifier = builder.branchKeyIdentifier();
this.branchKeyVersion = builder.branchKeyVersion();
this.encryptionContext = builder.encryptionContext();
this.branchKey = builder.branchKey();
}
public String branchKeyIdentifier() {
return this.branchKeyIdentifier;
}
public String branchKeyVersion() {
return this.branchKeyVersion;
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public ByteBuffer branchKey() {
return this.branchKey;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder branchKeyIdentifier(String branchKeyIdentifier);
String branchKeyIdentifier();
Builder branchKeyVersion(String branchKeyVersion);
String branchKeyVersion();
Builder encryptionContext(Map<String, String> encryptionContext);
Map<String, String> encryptionContext();
Builder branchKey(ByteBuffer branchKey);
ByteBuffer branchKey();
BranchKeyMaterials build();
}
static class BuilderImpl implements Builder {
protected String branchKeyIdentifier;
protected String branchKeyVersion;
protected Map<String, String> encryptionContext;
protected ByteBuffer branchKey;
protected BuilderImpl() {
}
protected BuilderImpl(BranchKeyMaterials model) {
this.branchKeyIdentifier = model.branchKeyIdentifier();
this.branchKeyVersion = model.branchKeyVersion();
this.encryptionContext = model.encryptionContext();
this.branchKey = model.branchKey();
}
public Builder branchKeyIdentifier(String branchKeyIdentifier) {
this.branchKeyIdentifier = branchKeyIdentifier;
return this;
}
public String branchKeyIdentifier() {
return this.branchKeyIdentifier;
}
public Builder branchKeyVersion(String branchKeyVersion) {
this.branchKeyVersion = branchKeyVersion;
return this;
}
public String branchKeyVersion() {
return this.branchKeyVersion;
}
public Builder encryptionContext(Map<String, String> encryptionContext) {
this.encryptionContext = encryptionContext;
return this;
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public Builder branchKey(ByteBuffer branchKey) {
this.branchKey = branchKey;
return this;
}
public ByteBuffer branchKey() {
return this.branchKey;
}
public BranchKeyMaterials build() {
if (Objects.isNull(this.branchKeyIdentifier())) {
throw new IllegalArgumentException("Missing value for required field `branchKeyIdentifier`");
}
if (Objects.isNull(this.branchKeyVersion())) {
throw new IllegalArgumentException("Missing value for required field `branchKeyVersion`");
}
if (Objects.isNull(this.encryptionContext())) {
throw new IllegalArgumentException("Missing value for required field `encryptionContext`");
}
if (Objects.isNull(this.branchKey())) {
throw new IllegalArgumentException("Missing value for required field `branchKey`");
}
return new BranchKeyMaterials(this);
}
}
}
| 301 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore/model/CreateKeyInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.keystore.model;
import java.util.Map;
public class CreateKeyInput {
/**
* The identifier for the created Branch Key.
*/
private final String branchKeyIdentifier;
/**
* Custom encryption context for the Branch Key.
*/
private final Map<String, String> encryptionContext;
protected CreateKeyInput(BuilderImpl builder) {
this.branchKeyIdentifier = builder.branchKeyIdentifier();
this.encryptionContext = builder.encryptionContext();
}
/**
* @return The identifier for the created Branch Key.
*/
public String branchKeyIdentifier() {
return this.branchKeyIdentifier;
}
/**
* @return Custom encryption context for the Branch Key.
*/
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param branchKeyIdentifier The identifier for the created Branch Key.
*/
Builder branchKeyIdentifier(String branchKeyIdentifier);
/**
* @return The identifier for the created Branch Key.
*/
String branchKeyIdentifier();
/**
* @param encryptionContext Custom encryption context for the Branch Key.
*/
Builder encryptionContext(Map<String, String> encryptionContext);
/**
* @return Custom encryption context for the Branch Key.
*/
Map<String, String> encryptionContext();
CreateKeyInput build();
}
static class BuilderImpl implements Builder {
protected String branchKeyIdentifier;
protected Map<String, String> encryptionContext;
protected BuilderImpl() {
}
protected BuilderImpl(CreateKeyInput model) {
this.branchKeyIdentifier = model.branchKeyIdentifier();
this.encryptionContext = model.encryptionContext();
}
public Builder branchKeyIdentifier(String branchKeyIdentifier) {
this.branchKeyIdentifier = branchKeyIdentifier;
return this;
}
public String branchKeyIdentifier() {
return this.branchKeyIdentifier;
}
public Builder encryptionContext(Map<String, String> encryptionContext) {
this.encryptionContext = encryptionContext;
return this;
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public CreateKeyInput build() {
return new CreateKeyInput(this);
}
}
}
| 302 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore/model/CreateKeyStoreOutput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.keystore.model;
import java.util.Objects;
/**
* Outputs for Key Store DynamoDB table creation.
*/
public class CreateKeyStoreOutput {
/**
* The ARN of the DynamoDB table that backs this Key Store.
*/
private final String tableArn;
protected CreateKeyStoreOutput(BuilderImpl builder) {
this.tableArn = builder.tableArn();
}
/**
* @return The ARN of the DynamoDB table that backs this Key Store.
*/
public String tableArn() {
return this.tableArn;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param tableArn The ARN of the DynamoDB table that backs this Key Store.
*/
Builder tableArn(String tableArn);
/**
* @return The ARN of the DynamoDB table that backs this Key Store.
*/
String tableArn();
CreateKeyStoreOutput build();
}
static class BuilderImpl implements Builder {
protected String tableArn;
protected BuilderImpl() {
}
protected BuilderImpl(CreateKeyStoreOutput model) {
this.tableArn = model.tableArn();
}
public Builder tableArn(String tableArn) {
this.tableArn = tableArn;
return this;
}
public String tableArn() {
return this.tableArn;
}
public CreateKeyStoreOutput build() {
if (Objects.isNull(this.tableArn())) {
throw new IllegalArgumentException("Missing value for required field `tableArn`");
}
return new CreateKeyStoreOutput(this);
}
}
}
| 303 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore/model/VersionKeyOutput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.keystore.model;
/**
* Outputs for versioning a Branch Key.
*/
public class VersionKeyOutput {
protected VersionKeyOutput(BuilderImpl builder) {
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
VersionKeyOutput build();
}
static class BuilderImpl implements Builder {
protected BuilderImpl() {
}
protected BuilderImpl(VersionKeyOutput model) {
}
public VersionKeyOutput build() {
return new VersionKeyOutput(this);
}
}
}
| 304 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore/model/GetKeyStoreInfoOutput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.keystore.model;
import java.util.List;
import java.util.Objects;
/**
* The configuration information for a Key Store.
*/
public class GetKeyStoreInfoOutput {
/**
* An identifier for this Key Store.
*/
private final String keyStoreId;
/**
* The DynamoDB table name that backs this Key Store.
*/
private final String keyStoreName;
/**
* The logical name for this Key Store, which is cryptographically bound to the keys it holds.
*/
private final String logicalKeyStoreName;
/**
* The AWS KMS grant tokens that are used when this Key Store calls to AWS KMS.
*/
private final List<String> grantTokens;
/**
* The AWS KMS Key that protects this Key Store.
*/
private final KMSConfiguration kmsConfiguration;
protected GetKeyStoreInfoOutput(BuilderImpl builder) {
this.keyStoreId = builder.keyStoreId();
this.keyStoreName = builder.keyStoreName();
this.logicalKeyStoreName = builder.logicalKeyStoreName();
this.grantTokens = builder.grantTokens();
this.kmsConfiguration = builder.kmsConfiguration();
}
/**
* @return An identifier for this Key Store.
*/
public String keyStoreId() {
return this.keyStoreId;
}
/**
* @return The DynamoDB table name that backs this Key Store.
*/
public String keyStoreName() {
return this.keyStoreName;
}
/**
* @return The logical name for this Key Store, which is cryptographically bound to the keys it holds.
*/
public String logicalKeyStoreName() {
return this.logicalKeyStoreName;
}
/**
* @return The AWS KMS grant tokens that are used when this Key Store calls to AWS KMS.
*/
public List<String> grantTokens() {
return this.grantTokens;
}
/**
* @return The AWS KMS Key that protects this Key Store.
*/
public KMSConfiguration kmsConfiguration() {
return this.kmsConfiguration;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param keyStoreId An identifier for this Key Store.
*/
Builder keyStoreId(String keyStoreId);
/**
* @return An identifier for this Key Store.
*/
String keyStoreId();
/**
* @param keyStoreName The DynamoDB table name that backs this Key Store.
*/
Builder keyStoreName(String keyStoreName);
/**
* @return The DynamoDB table name that backs this Key Store.
*/
String keyStoreName();
/**
* @param logicalKeyStoreName The logical name for this Key Store, which is cryptographically bound to the keys it holds.
*/
Builder logicalKeyStoreName(String logicalKeyStoreName);
/**
* @return The logical name for this Key Store, which is cryptographically bound to the keys it holds.
*/
String logicalKeyStoreName();
/**
* @param grantTokens The AWS KMS grant tokens that are used when this Key Store calls to AWS KMS.
*/
Builder grantTokens(List<String> grantTokens);
/**
* @return The AWS KMS grant tokens that are used when this Key Store calls to AWS KMS.
*/
List<String> grantTokens();
/**
* @param kmsConfiguration The AWS KMS Key that protects this Key Store.
*/
Builder kmsConfiguration(KMSConfiguration kmsConfiguration);
/**
* @return The AWS KMS Key that protects this Key Store.
*/
KMSConfiguration kmsConfiguration();
GetKeyStoreInfoOutput build();
}
static class BuilderImpl implements Builder {
protected String keyStoreId;
protected String keyStoreName;
protected String logicalKeyStoreName;
protected List<String> grantTokens;
protected KMSConfiguration kmsConfiguration;
protected BuilderImpl() {
}
protected BuilderImpl(GetKeyStoreInfoOutput model) {
this.keyStoreId = model.keyStoreId();
this.keyStoreName = model.keyStoreName();
this.logicalKeyStoreName = model.logicalKeyStoreName();
this.grantTokens = model.grantTokens();
this.kmsConfiguration = model.kmsConfiguration();
}
public Builder keyStoreId(String keyStoreId) {
this.keyStoreId = keyStoreId;
return this;
}
public String keyStoreId() {
return this.keyStoreId;
}
public Builder keyStoreName(String keyStoreName) {
this.keyStoreName = keyStoreName;
return this;
}
public String keyStoreName() {
return this.keyStoreName;
}
public Builder logicalKeyStoreName(String logicalKeyStoreName) {
this.logicalKeyStoreName = logicalKeyStoreName;
return this;
}
public String logicalKeyStoreName() {
return this.logicalKeyStoreName;
}
public Builder grantTokens(List<String> grantTokens) {
this.grantTokens = grantTokens;
return this;
}
public List<String> grantTokens() {
return this.grantTokens;
}
public Builder kmsConfiguration(KMSConfiguration kmsConfiguration) {
this.kmsConfiguration = kmsConfiguration;
return this;
}
public KMSConfiguration kmsConfiguration() {
return this.kmsConfiguration;
}
public GetKeyStoreInfoOutput build() {
if (Objects.isNull(this.keyStoreId())) {
throw new IllegalArgumentException("Missing value for required field `keyStoreId`");
}
if (Objects.isNull(this.keyStoreName())) {
throw new IllegalArgumentException("Missing value for required field `keyStoreName`");
}
if (Objects.nonNull(this.keyStoreName()) && this.keyStoreName().length() < 3) {
throw new IllegalArgumentException("The size of `keyStoreName` must be greater than or equal to 3");
}
if (Objects.nonNull(this.keyStoreName()) && this.keyStoreName().length() > 255) {
throw new IllegalArgumentException("The size of `keyStoreName` must be less than or equal to 255");
}
if (Objects.isNull(this.logicalKeyStoreName())) {
throw new IllegalArgumentException("Missing value for required field `logicalKeyStoreName`");
}
if (Objects.isNull(this.grantTokens())) {
throw new IllegalArgumentException("Missing value for required field `grantTokens`");
}
if (Objects.isNull(this.kmsConfiguration())) {
throw new IllegalArgumentException("Missing value for required field `kmsConfiguration`");
}
return new GetKeyStoreInfoOutput(this);
}
}
}
| 305 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore/model/CreateKeyStoreInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.keystore.model;
public class CreateKeyStoreInput {
protected CreateKeyStoreInput(BuilderImpl builder) {
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
CreateKeyStoreInput build();
}
static class BuilderImpl implements Builder {
protected BuilderImpl() {
}
protected BuilderImpl(CreateKeyStoreInput model) {
}
public CreateKeyStoreInput build() {
return new CreateKeyStoreInput(this);
}
}
}
| 306 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/keystore/model/CollectionOfErrors.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.keystore.model;
import java.util.List;
public class CollectionOfErrors extends RuntimeException {
/**
* The list of Exceptions encountered.
*/
private final List<RuntimeException> list;
protected CollectionOfErrors(BuilderImpl builder) {
super(messageFromBuilder(builder), builder.cause());
this.list = builder.list();
}
private static String messageFromBuilder(Builder builder) {
if (builder.message() != null) {
return builder.message();
}
if (builder.cause() != null) {
return builder.cause().getMessage();
}
return null;
}
/**
* See {@link Throwable#getMessage()}.
*/
public String message() {
return this.getMessage();
}
/**
* See {@link Throwable#getCause()}.
*/
public Throwable cause() {
return this.getCause();
}
/**
* @return The list of Exceptions encountered.
*/
public List<RuntimeException> list() {
return this.list;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param message The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
Builder message(String message);
/**
* @return The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
String message();
/**
* @param cause The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Builder cause(Throwable cause);
/**
* @return The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Throwable cause();
/**
* @param list The list of Exceptions encountered.
*/
Builder list(List<RuntimeException> list);
/**
* @return The list of Exceptions encountered.
*/
List<RuntimeException> list();
CollectionOfErrors build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected List<RuntimeException> list;
protected BuilderImpl() {
}
protected BuilderImpl(CollectionOfErrors model) {
this.cause = model.getCause();
this.message = model.getMessage();
this.list = model.list();
}
public Builder message(String message) {
this.message = message;
return this;
}
public String message() {
return this.message;
}
public Builder cause(Throwable cause) {
this.cause = cause;
return this;
}
public Throwable cause() {
return this.cause;
}
public Builder list(List<RuntimeException> list) {
this.list = list;
return this;
}
public List<RuntimeException> list() {
return this.list;
}
public CollectionOfErrors build() {
return new CollectionOfErrors(this);
}
}
}
| 307 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/BranchKeyIdSupplier.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders;
import Wrappers_Compile.Result;
import java.lang.IllegalArgumentException;
import java.lang.RuntimeException;
import java.util.Objects;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error;
import software.amazon.cryptography.materialproviders.model.GetBranchKeyIdInput;
import software.amazon.cryptography.materialproviders.model.GetBranchKeyIdOutput;
public final class BranchKeyIdSupplier implements IBranchKeyIdSupplier {
private final software.amazon.cryptography.materialproviders.internaldafny.types.IBranchKeyIdSupplier _impl;
private BranchKeyIdSupplier(
software.amazon.cryptography.materialproviders.internaldafny.types.IBranchKeyIdSupplier iBranchKeyIdSupplier) {
Objects.requireNonNull(iBranchKeyIdSupplier, "Missing value for required argument `iBranchKeyIdSupplier`");
this._impl = iBranchKeyIdSupplier;
}
public static BranchKeyIdSupplier wrap(
software.amazon.cryptography.materialproviders.internaldafny.types.IBranchKeyIdSupplier iBranchKeyIdSupplier) {
return new BranchKeyIdSupplier(iBranchKeyIdSupplier);
}
public static <I extends IBranchKeyIdSupplier> BranchKeyIdSupplier wrap(I iBranchKeyIdSupplier) {
Objects.requireNonNull(iBranchKeyIdSupplier, "Missing value for required argument `iBranchKeyIdSupplier`");
if (iBranchKeyIdSupplier instanceof software.amazon.cryptography.materialproviders.BranchKeyIdSupplier) {
return ((BranchKeyIdSupplier) iBranchKeyIdSupplier);
}
return BranchKeyIdSupplier.wrap(new NativeWrapper(iBranchKeyIdSupplier));
}
public software.amazon.cryptography.materialproviders.internaldafny.types.IBranchKeyIdSupplier impl(
) {
return this._impl;
}
/**
* Given the Encryption Context associated with this encryption or decryption, returns the branch key that should be responsible for unwrapping or wrapping the data key.
*
* @param input Inputs for determining the Branch Key which should be used to wrap or unwrap the data key for this encryption or decryption
* @return Outputs for the Branch Key responsible for wrapping or unwrapping the data key in this encryption or decryption.
*/
public GetBranchKeyIdOutput GetBranchKeyId(GetBranchKeyIdInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.GetBranchKeyIdInput dafnyValue = ToDafny.GetBranchKeyIdInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.GetBranchKeyIdOutput, Error> result = this._impl.GetBranchKeyId(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.GetBranchKeyIdOutput(result.dtor_value());
}
protected static final class NativeWrapper implements software.amazon.cryptography.materialproviders.internaldafny.types.IBranchKeyIdSupplier {
protected final IBranchKeyIdSupplier _impl;
NativeWrapper(IBranchKeyIdSupplier nativeImpl) {
if (nativeImpl instanceof BranchKeyIdSupplier) {
throw new IllegalArgumentException("Recursive wrapping is strictly forbidden.");
}
this._impl = nativeImpl;
}
public Result<software.amazon.cryptography.materialproviders.internaldafny.types.GetBranchKeyIdOutput, Error> GetBranchKeyId(
software.amazon.cryptography.materialproviders.internaldafny.types.GetBranchKeyIdInput dafnyInput) {
GetBranchKeyIdInput nativeInput = ToNative.GetBranchKeyIdInput(dafnyInput);
try {
GetBranchKeyIdOutput nativeOutput = this._impl.GetBranchKeyId(nativeInput);
software.amazon.cryptography.materialproviders.internaldafny.types.GetBranchKeyIdOutput dafnyOutput = ToDafny.GetBranchKeyIdOutput(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<software.amazon.cryptography.materialproviders.internaldafny.types.GetBranchKeyIdOutput, Error> GetBranchKeyId_k(
software.amazon.cryptography.materialproviders.internaldafny.types.GetBranchKeyIdInput dafnyInput) {
throw new RuntimeException("Not supported at this time.");
}
}
}
| 308 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/CryptographicMaterialsCache.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders;
import Wrappers_Compile.Result;
import dafny.Tuple0;
import java.lang.IllegalArgumentException;
import java.lang.RuntimeException;
import java.util.Objects;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error;
import software.amazon.cryptography.materialproviders.model.DeleteCacheEntryInput;
import software.amazon.cryptography.materialproviders.model.GetCacheEntryInput;
import software.amazon.cryptography.materialproviders.model.GetCacheEntryOutput;
import software.amazon.cryptography.materialproviders.model.PutCacheEntryInput;
import software.amazon.cryptography.materialproviders.model.UpdateUsageMetadataInput;
public final class CryptographicMaterialsCache implements ICryptographicMaterialsCache {
private final software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsCache _impl;
private CryptographicMaterialsCache(
software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsCache iCryptographicMaterialsCache) {
Objects.requireNonNull(iCryptographicMaterialsCache, "Missing value for required argument `iCryptographicMaterialsCache`");
this._impl = iCryptographicMaterialsCache;
}
public static CryptographicMaterialsCache wrap(
software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsCache iCryptographicMaterialsCache) {
return new CryptographicMaterialsCache(iCryptographicMaterialsCache);
}
public static <I extends ICryptographicMaterialsCache> CryptographicMaterialsCache wrap(
I iCryptographicMaterialsCache) {
Objects.requireNonNull(iCryptographicMaterialsCache, "Missing value for required argument `iCryptographicMaterialsCache`");
if (iCryptographicMaterialsCache instanceof software.amazon.cryptography.materialproviders.CryptographicMaterialsCache) {
return ((CryptographicMaterialsCache) iCryptographicMaterialsCache);
}
return CryptographicMaterialsCache.wrap(new NativeWrapper(iCryptographicMaterialsCache));
}
public software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsCache impl(
) {
return this._impl;
}
public void DeleteCacheEntry(DeleteCacheEntryInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.DeleteCacheEntryInput dafnyValue = ToDafny.DeleteCacheEntryInput(input);
Result<Tuple0, Error> result = this._impl.DeleteCacheEntry(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
}
public GetCacheEntryOutput GetCacheEntry(GetCacheEntryInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryInput dafnyValue = ToDafny.GetCacheEntryInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryOutput, Error> result = this._impl.GetCacheEntry(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.GetCacheEntryOutput(result.dtor_value());
}
public void PutCacheEntry(PutCacheEntryInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.PutCacheEntryInput dafnyValue = ToDafny.PutCacheEntryInput(input);
Result<Tuple0, Error> result = this._impl.PutCacheEntry(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
}
public void UpdateUsageMetadata(UpdateUsageMetadataInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.UpdateUsageMetadataInput dafnyValue = ToDafny.UpdateUsageMetadataInput(input);
Result<Tuple0, Error> result = this._impl.UpdateUsageMetadata(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
}
protected static final class NativeWrapper implements software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsCache {
protected final ICryptographicMaterialsCache _impl;
NativeWrapper(ICryptographicMaterialsCache nativeImpl) {
if (nativeImpl instanceof CryptographicMaterialsCache) {
throw new IllegalArgumentException("Recursive wrapping is strictly forbidden.");
}
this._impl = nativeImpl;
}
public Result<Tuple0, Error> DeleteCacheEntry(
software.amazon.cryptography.materialproviders.internaldafny.types.DeleteCacheEntryInput dafnyInput) {
DeleteCacheEntryInput nativeInput = ToNative.DeleteCacheEntryInput(dafnyInput);
try {
this._impl.DeleteCacheEntry(nativeInput);
return Result.create_Success(Tuple0.create());
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<Tuple0, Error> DeleteCacheEntry_k(
software.amazon.cryptography.materialproviders.internaldafny.types.DeleteCacheEntryInput dafnyInput) {
throw new RuntimeException("Not supported at this time.");
}
public Result<software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryOutput, Error> GetCacheEntry(
software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryInput dafnyInput) {
GetCacheEntryInput nativeInput = ToNative.GetCacheEntryInput(dafnyInput);
try {
GetCacheEntryOutput nativeOutput = this._impl.GetCacheEntry(nativeInput);
software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryOutput dafnyOutput = ToDafny.GetCacheEntryOutput(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryOutput, Error> GetCacheEntry_k(
software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryInput dafnyInput) {
throw new RuntimeException("Not supported at this time.");
}
public Result<Tuple0, Error> PutCacheEntry(
software.amazon.cryptography.materialproviders.internaldafny.types.PutCacheEntryInput dafnyInput) {
PutCacheEntryInput nativeInput = ToNative.PutCacheEntryInput(dafnyInput);
try {
this._impl.PutCacheEntry(nativeInput);
return Result.create_Success(Tuple0.create());
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<Tuple0, Error> PutCacheEntry_k(
software.amazon.cryptography.materialproviders.internaldafny.types.PutCacheEntryInput dafnyInput) {
throw new RuntimeException("Not supported at this time.");
}
public Result<Tuple0, Error> UpdateUsageMetadata(
software.amazon.cryptography.materialproviders.internaldafny.types.UpdateUsageMetadataInput dafnyInput) {
UpdateUsageMetadataInput nativeInput = ToNative.UpdateUsageMetadataInput(dafnyInput);
try {
this._impl.UpdateUsageMetadata(nativeInput);
return Result.create_Success(Tuple0.create());
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<Tuple0, Error> UpdateUsageMetadata_k(
software.amazon.cryptography.materialproviders.internaldafny.types.UpdateUsageMetadataInput dafnyInput) {
throw new RuntimeException("Not supported at this time.");
}
}
}
| 309 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/IKeyring.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders;
import software.amazon.cryptography.materialproviders.model.OnDecryptInput;
import software.amazon.cryptography.materialproviders.model.OnDecryptOutput;
import software.amazon.cryptography.materialproviders.model.OnEncryptInput;
import software.amazon.cryptography.materialproviders.model.OnEncryptOutput;
public interface IKeyring {
OnDecryptOutput OnDecrypt(OnDecryptInput input);
OnEncryptOutput OnEncrypt(OnEncryptInput input);
}
| 310 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/ToNative.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders;
import dafny.DafnyMap;
import dafny.DafnySequence;
import java.lang.Byte;
import java.lang.Character;
import java.lang.IllegalArgumentException;
import java.lang.RuntimeException;
import java.lang.String;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.Map;
import software.amazon.cryptography.materialproviders.internaldafny.types.DIRECT__KEY__WRAPPING;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_AwsCryptographicMaterialProvidersException;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_CollectionOfErrors;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_EntryAlreadyExists;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_EntryDoesNotExist;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_InvalidAlgorithmSuiteInfo;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_InvalidAlgorithmSuiteInfoOnDecrypt;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_InvalidAlgorithmSuiteInfoOnEncrypt;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_InvalidDecryptionMaterials;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_InvalidDecryptionMaterialsTransition;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_InvalidEncryptionMaterials;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_InvalidEncryptionMaterialsTransition;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_Opaque;
import software.amazon.cryptography.materialproviders.internaldafny.types.IAwsCryptographicMaterialProvidersClient;
import software.amazon.cryptography.materialproviders.model.AesWrappingAlg;
import software.amazon.cryptography.materialproviders.model.AlgorithmSuiteId;
import software.amazon.cryptography.materialproviders.model.AlgorithmSuiteInfo;
import software.amazon.cryptography.materialproviders.model.AwsCryptographicMaterialProvidersException;
import software.amazon.cryptography.materialproviders.model.CacheType;
import software.amazon.cryptography.materialproviders.model.CollectionOfErrors;
import software.amazon.cryptography.materialproviders.model.CommitmentPolicy;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsDiscoveryKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsDiscoveryMultiKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsHierarchicalKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsMrkDiscoveryKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsMrkDiscoveryMultiKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsMrkKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsMrkMultiKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsMultiKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsRsaKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateCryptographicMaterialsCacheInput;
import software.amazon.cryptography.materialproviders.model.CreateDefaultClientSupplierInput;
import software.amazon.cryptography.materialproviders.model.CreateDefaultCryptographicMaterialsManagerInput;
import software.amazon.cryptography.materialproviders.model.CreateMultiKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateRawAesKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateRawRsaKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateRequiredEncryptionContextCMMInput;
import software.amazon.cryptography.materialproviders.model.DBEAlgorithmSuiteId;
import software.amazon.cryptography.materialproviders.model.DBECommitmentPolicy;
import software.amazon.cryptography.materialproviders.model.DIRECT_KEY_WRAPPING;
import software.amazon.cryptography.materialproviders.model.DecryptMaterialsInput;
import software.amazon.cryptography.materialproviders.model.DecryptMaterialsOutput;
import software.amazon.cryptography.materialproviders.model.DecryptionMaterials;
import software.amazon.cryptography.materialproviders.model.DefaultCache;
import software.amazon.cryptography.materialproviders.model.DeleteCacheEntryInput;
import software.amazon.cryptography.materialproviders.model.DerivationAlgorithm;
import software.amazon.cryptography.materialproviders.model.DiscoveryFilter;
import software.amazon.cryptography.materialproviders.model.ECDSA;
import software.amazon.cryptography.materialproviders.model.ESDKAlgorithmSuiteId;
import software.amazon.cryptography.materialproviders.model.ESDKCommitmentPolicy;
import software.amazon.cryptography.materialproviders.model.EdkWrappingAlgorithm;
import software.amazon.cryptography.materialproviders.model.Encrypt;
import software.amazon.cryptography.materialproviders.model.EncryptedDataKey;
import software.amazon.cryptography.materialproviders.model.EncryptionMaterials;
import software.amazon.cryptography.materialproviders.model.EntryAlreadyExists;
import software.amazon.cryptography.materialproviders.model.EntryDoesNotExist;
import software.amazon.cryptography.materialproviders.model.GetBranchKeyIdInput;
import software.amazon.cryptography.materialproviders.model.GetBranchKeyIdOutput;
import software.amazon.cryptography.materialproviders.model.GetCacheEntryInput;
import software.amazon.cryptography.materialproviders.model.GetCacheEntryOutput;
import software.amazon.cryptography.materialproviders.model.GetClientInput;
import software.amazon.cryptography.materialproviders.model.GetEncryptionMaterialsInput;
import software.amazon.cryptography.materialproviders.model.GetEncryptionMaterialsOutput;
import software.amazon.cryptography.materialproviders.model.HKDF;
import software.amazon.cryptography.materialproviders.model.IDENTITY;
import software.amazon.cryptography.materialproviders.model.InitializeDecryptionMaterialsInput;
import software.amazon.cryptography.materialproviders.model.InitializeEncryptionMaterialsInput;
import software.amazon.cryptography.materialproviders.model.IntermediateKeyWrapping;
import software.amazon.cryptography.materialproviders.model.InvalidAlgorithmSuiteInfo;
import software.amazon.cryptography.materialproviders.model.InvalidAlgorithmSuiteInfoOnDecrypt;
import software.amazon.cryptography.materialproviders.model.InvalidAlgorithmSuiteInfoOnEncrypt;
import software.amazon.cryptography.materialproviders.model.InvalidDecryptionMaterials;
import software.amazon.cryptography.materialproviders.model.InvalidDecryptionMaterialsTransition;
import software.amazon.cryptography.materialproviders.model.InvalidEncryptionMaterials;
import software.amazon.cryptography.materialproviders.model.InvalidEncryptionMaterialsTransition;
import software.amazon.cryptography.materialproviders.model.MaterialProvidersConfig;
import software.amazon.cryptography.materialproviders.model.Materials;
import software.amazon.cryptography.materialproviders.model.MultiThreadedCache;
import software.amazon.cryptography.materialproviders.model.NoCache;
import software.amazon.cryptography.materialproviders.model.None;
import software.amazon.cryptography.materialproviders.model.OnDecryptInput;
import software.amazon.cryptography.materialproviders.model.OnDecryptOutput;
import software.amazon.cryptography.materialproviders.model.OnEncryptInput;
import software.amazon.cryptography.materialproviders.model.OnEncryptOutput;
import software.amazon.cryptography.materialproviders.model.OpaqueError;
import software.amazon.cryptography.materialproviders.model.PaddingScheme;
import software.amazon.cryptography.materialproviders.model.PutCacheEntryInput;
import software.amazon.cryptography.materialproviders.model.SignatureAlgorithm;
import software.amazon.cryptography.materialproviders.model.SingleThreadedCache;
import software.amazon.cryptography.materialproviders.model.StormTrackingCache;
import software.amazon.cryptography.materialproviders.model.SymmetricSignatureAlgorithm;
import software.amazon.cryptography.materialproviders.model.UpdateUsageMetadataInput;
import software.amazon.cryptography.materialproviders.model.ValidDecryptionMaterialsTransitionInput;
import software.amazon.cryptography.materialproviders.model.ValidEncryptionMaterialsTransitionInput;
import software.amazon.cryptography.materialproviders.model.ValidateCommitmentPolicyOnDecryptInput;
import software.amazon.cryptography.materialproviders.model.ValidateCommitmentPolicyOnEncryptInput;
public class ToNative {
public static OpaqueError Error(Error_Opaque dafnyValue) {
OpaqueError.Builder nativeBuilder = OpaqueError.builder();
nativeBuilder.obj(dafnyValue.dtor_obj());
return nativeBuilder.build();
}
public static CollectionOfErrors Error(Error_CollectionOfErrors dafnyValue) {
CollectionOfErrors.Builder nativeBuilder = CollectionOfErrors.builder();
nativeBuilder.list(
software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue.dtor_list(),
ToNative::Error));
nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message()));
return nativeBuilder.build();
}
public static AwsCryptographicMaterialProvidersException Error(
Error_AwsCryptographicMaterialProvidersException dafnyValue) {
AwsCryptographicMaterialProvidersException.Builder nativeBuilder = AwsCryptographicMaterialProvidersException.builder();
nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message()));
return nativeBuilder.build();
}
public static EntryAlreadyExists Error(Error_EntryAlreadyExists dafnyValue) {
EntryAlreadyExists.Builder nativeBuilder = EntryAlreadyExists.builder();
nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message()));
return nativeBuilder.build();
}
public static EntryDoesNotExist Error(Error_EntryDoesNotExist dafnyValue) {
EntryDoesNotExist.Builder nativeBuilder = EntryDoesNotExist.builder();
nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message()));
return nativeBuilder.build();
}
public static InvalidAlgorithmSuiteInfo Error(Error_InvalidAlgorithmSuiteInfo dafnyValue) {
InvalidAlgorithmSuiteInfo.Builder nativeBuilder = InvalidAlgorithmSuiteInfo.builder();
nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message()));
return nativeBuilder.build();
}
public static InvalidAlgorithmSuiteInfoOnDecrypt Error(
Error_InvalidAlgorithmSuiteInfoOnDecrypt dafnyValue) {
InvalidAlgorithmSuiteInfoOnDecrypt.Builder nativeBuilder = InvalidAlgorithmSuiteInfoOnDecrypt.builder();
nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message()));
return nativeBuilder.build();
}
public static InvalidAlgorithmSuiteInfoOnEncrypt Error(
Error_InvalidAlgorithmSuiteInfoOnEncrypt dafnyValue) {
InvalidAlgorithmSuiteInfoOnEncrypt.Builder nativeBuilder = InvalidAlgorithmSuiteInfoOnEncrypt.builder();
nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message()));
return nativeBuilder.build();
}
public static InvalidDecryptionMaterials Error(Error_InvalidDecryptionMaterials dafnyValue) {
InvalidDecryptionMaterials.Builder nativeBuilder = InvalidDecryptionMaterials.builder();
nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message()));
return nativeBuilder.build();
}
public static InvalidDecryptionMaterialsTransition Error(
Error_InvalidDecryptionMaterialsTransition dafnyValue) {
InvalidDecryptionMaterialsTransition.Builder nativeBuilder = InvalidDecryptionMaterialsTransition.builder();
nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message()));
return nativeBuilder.build();
}
public static InvalidEncryptionMaterials Error(Error_InvalidEncryptionMaterials dafnyValue) {
InvalidEncryptionMaterials.Builder nativeBuilder = InvalidEncryptionMaterials.builder();
nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message()));
return nativeBuilder.build();
}
public static InvalidEncryptionMaterialsTransition Error(
Error_InvalidEncryptionMaterialsTransition dafnyValue) {
InvalidEncryptionMaterialsTransition.Builder nativeBuilder = InvalidEncryptionMaterialsTransition.builder();
nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message()));
return nativeBuilder.build();
}
public static RuntimeException Error(Error dafnyValue) {
if (dafnyValue.is_AwsCryptographicMaterialProvidersException()) {
return ToNative.Error((Error_AwsCryptographicMaterialProvidersException) dafnyValue);
}
if (dafnyValue.is_EntryAlreadyExists()) {
return ToNative.Error((Error_EntryAlreadyExists) dafnyValue);
}
if (dafnyValue.is_EntryDoesNotExist()) {
return ToNative.Error((Error_EntryDoesNotExist) dafnyValue);
}
if (dafnyValue.is_InvalidAlgorithmSuiteInfo()) {
return ToNative.Error((Error_InvalidAlgorithmSuiteInfo) dafnyValue);
}
if (dafnyValue.is_InvalidAlgorithmSuiteInfoOnDecrypt()) {
return ToNative.Error((Error_InvalidAlgorithmSuiteInfoOnDecrypt) dafnyValue);
}
if (dafnyValue.is_InvalidAlgorithmSuiteInfoOnEncrypt()) {
return ToNative.Error((Error_InvalidAlgorithmSuiteInfoOnEncrypt) dafnyValue);
}
if (dafnyValue.is_InvalidDecryptionMaterials()) {
return ToNative.Error((Error_InvalidDecryptionMaterials) dafnyValue);
}
if (dafnyValue.is_InvalidDecryptionMaterialsTransition()) {
return ToNative.Error((Error_InvalidDecryptionMaterialsTransition) dafnyValue);
}
if (dafnyValue.is_InvalidEncryptionMaterials()) {
return ToNative.Error((Error_InvalidEncryptionMaterials) dafnyValue);
}
if (dafnyValue.is_InvalidEncryptionMaterialsTransition()) {
return ToNative.Error((Error_InvalidEncryptionMaterialsTransition) dafnyValue);
}
if (dafnyValue.is_Opaque()) {
return ToNative.Error((Error_Opaque) dafnyValue);
}
if (dafnyValue.is_CollectionOfErrors()) {
return ToNative.Error((Error_CollectionOfErrors) dafnyValue);
}
if (dafnyValue.is_AwsCryptographyPrimitives()) {
return software.amazon.cryptography.primitives.ToNative.Error(dafnyValue.dtor_AwsCryptographyPrimitives());
}
if (dafnyValue.is_ComAmazonawsDynamodb()) {
return software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.Error(dafnyValue.dtor_ComAmazonawsDynamodb());
}
if (dafnyValue.is_ComAmazonawsKms()) {
return software.amazon.cryptography.services.kms.internaldafny.ToNative.Error(dafnyValue.dtor_ComAmazonawsKms());
}
if (dafnyValue.is_AwsCryptographyKeyStore()) {
return software.amazon.cryptography.keystore.ToNative.Error(dafnyValue.dtor_AwsCryptographyKeyStore());
}
OpaqueError.Builder nativeBuilder = OpaqueError.builder();
nativeBuilder.obj(dafnyValue);
return nativeBuilder.build();
}
public static AlgorithmSuiteInfo AlgorithmSuiteInfo(
software.amazon.cryptography.materialproviders.internaldafny.types.AlgorithmSuiteInfo dafnyValue) {
AlgorithmSuiteInfo.Builder nativeBuilder = AlgorithmSuiteInfo.builder();
nativeBuilder.id(ToNative.AlgorithmSuiteId(dafnyValue.dtor_id()));
nativeBuilder.binaryId(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_binaryId()));
nativeBuilder.messageVersion((dafnyValue.dtor_messageVersion()));
nativeBuilder.encrypt(ToNative.Encrypt(dafnyValue.dtor_encrypt()));
nativeBuilder.kdf(ToNative.DerivationAlgorithm(dafnyValue.dtor_kdf()));
nativeBuilder.commitment(ToNative.DerivationAlgorithm(dafnyValue.dtor_commitment()));
nativeBuilder.signature(ToNative.SignatureAlgorithm(dafnyValue.dtor_signature()));
nativeBuilder.symmetricSignature(ToNative.SymmetricSignatureAlgorithm(dafnyValue.dtor_symmetricSignature()));
nativeBuilder.edkWrapping(ToNative.EdkWrappingAlgorithm(dafnyValue.dtor_edkWrapping()));
return nativeBuilder.build();
}
public static CreateAwsKmsDiscoveryKeyringInput CreateAwsKmsDiscoveryKeyringInput(
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsDiscoveryKeyringInput dafnyValue) {
CreateAwsKmsDiscoveryKeyringInput.Builder nativeBuilder = CreateAwsKmsDiscoveryKeyringInput.builder();
nativeBuilder.kmsClient(software.amazon.cryptography.services.kms.internaldafny.ToNative.TrentService(dafnyValue.dtor_kmsClient()));
if (dafnyValue.dtor_discoveryFilter().is_Some()) {
nativeBuilder.discoveryFilter(ToNative.DiscoveryFilter(dafnyValue.dtor_discoveryFilter().dtor_value()));
}
if (dafnyValue.dtor_grantTokens().is_Some()) {
nativeBuilder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_grantTokens().dtor_value()));
}
return nativeBuilder.build();
}
public static CreateAwsKmsDiscoveryMultiKeyringInput CreateAwsKmsDiscoveryMultiKeyringInput(
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsDiscoveryMultiKeyringInput dafnyValue) {
CreateAwsKmsDiscoveryMultiKeyringInput.Builder nativeBuilder = CreateAwsKmsDiscoveryMultiKeyringInput.builder();
nativeBuilder.regions(ToNative.RegionList(dafnyValue.dtor_regions()));
if (dafnyValue.dtor_discoveryFilter().is_Some()) {
nativeBuilder.discoveryFilter(ToNative.DiscoveryFilter(dafnyValue.dtor_discoveryFilter().dtor_value()));
}
if (dafnyValue.dtor_clientSupplier().is_Some()) {
nativeBuilder.clientSupplier(ToNative.ClientSupplier(dafnyValue.dtor_clientSupplier().dtor_value()));
}
if (dafnyValue.dtor_grantTokens().is_Some()) {
nativeBuilder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_grantTokens().dtor_value()));
}
return nativeBuilder.build();
}
public static CreateAwsKmsHierarchicalKeyringInput CreateAwsKmsHierarchicalKeyringInput(
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsHierarchicalKeyringInput dafnyValue) {
CreateAwsKmsHierarchicalKeyringInput.Builder nativeBuilder = CreateAwsKmsHierarchicalKeyringInput.builder();
if (dafnyValue.dtor_branchKeyId().is_Some()) {
nativeBuilder.branchKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_branchKeyId().dtor_value()));
}
if (dafnyValue.dtor_branchKeyIdSupplier().is_Some()) {
nativeBuilder.branchKeyIdSupplier(ToNative.BranchKeyIdSupplier(dafnyValue.dtor_branchKeyIdSupplier().dtor_value()));
}
nativeBuilder.keyStore(software.amazon.cryptography.keystore.ToNative.KeyStore(dafnyValue.dtor_keyStore()));
nativeBuilder.ttlSeconds((dafnyValue.dtor_ttlSeconds()));
if (dafnyValue.dtor_cache().is_Some()) {
nativeBuilder.cache(ToNative.CacheType(dafnyValue.dtor_cache().dtor_value()));
}
return nativeBuilder.build();
}
public static CreateAwsKmsKeyringInput CreateAwsKmsKeyringInput(
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsKeyringInput dafnyValue) {
CreateAwsKmsKeyringInput.Builder nativeBuilder = CreateAwsKmsKeyringInput.builder();
nativeBuilder.kmsKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_kmsKeyId()));
nativeBuilder.kmsClient(software.amazon.cryptography.services.kms.internaldafny.ToNative.TrentService(dafnyValue.dtor_kmsClient()));
if (dafnyValue.dtor_grantTokens().is_Some()) {
nativeBuilder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_grantTokens().dtor_value()));
}
return nativeBuilder.build();
}
public static CreateAwsKmsMrkDiscoveryKeyringInput CreateAwsKmsMrkDiscoveryKeyringInput(
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkDiscoveryKeyringInput dafnyValue) {
CreateAwsKmsMrkDiscoveryKeyringInput.Builder nativeBuilder = CreateAwsKmsMrkDiscoveryKeyringInput.builder();
nativeBuilder.kmsClient(software.amazon.cryptography.services.kms.internaldafny.ToNative.TrentService(dafnyValue.dtor_kmsClient()));
if (dafnyValue.dtor_discoveryFilter().is_Some()) {
nativeBuilder.discoveryFilter(ToNative.DiscoveryFilter(dafnyValue.dtor_discoveryFilter().dtor_value()));
}
if (dafnyValue.dtor_grantTokens().is_Some()) {
nativeBuilder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_grantTokens().dtor_value()));
}
nativeBuilder.region(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_region()));
return nativeBuilder.build();
}
public static CreateAwsKmsMrkDiscoveryMultiKeyringInput CreateAwsKmsMrkDiscoveryMultiKeyringInput(
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkDiscoveryMultiKeyringInput dafnyValue) {
CreateAwsKmsMrkDiscoveryMultiKeyringInput.Builder nativeBuilder = CreateAwsKmsMrkDiscoveryMultiKeyringInput.builder();
nativeBuilder.regions(ToNative.RegionList(dafnyValue.dtor_regions()));
if (dafnyValue.dtor_discoveryFilter().is_Some()) {
nativeBuilder.discoveryFilter(ToNative.DiscoveryFilter(dafnyValue.dtor_discoveryFilter().dtor_value()));
}
if (dafnyValue.dtor_clientSupplier().is_Some()) {
nativeBuilder.clientSupplier(ToNative.ClientSupplier(dafnyValue.dtor_clientSupplier().dtor_value()));
}
if (dafnyValue.dtor_grantTokens().is_Some()) {
nativeBuilder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_grantTokens().dtor_value()));
}
return nativeBuilder.build();
}
public static CreateAwsKmsMrkKeyringInput CreateAwsKmsMrkKeyringInput(
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkKeyringInput dafnyValue) {
CreateAwsKmsMrkKeyringInput.Builder nativeBuilder = CreateAwsKmsMrkKeyringInput.builder();
nativeBuilder.kmsKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_kmsKeyId()));
nativeBuilder.kmsClient(software.amazon.cryptography.services.kms.internaldafny.ToNative.TrentService(dafnyValue.dtor_kmsClient()));
if (dafnyValue.dtor_grantTokens().is_Some()) {
nativeBuilder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_grantTokens().dtor_value()));
}
return nativeBuilder.build();
}
public static CreateAwsKmsMrkMultiKeyringInput CreateAwsKmsMrkMultiKeyringInput(
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkMultiKeyringInput dafnyValue) {
CreateAwsKmsMrkMultiKeyringInput.Builder nativeBuilder = CreateAwsKmsMrkMultiKeyringInput.builder();
if (dafnyValue.dtor_generator().is_Some()) {
nativeBuilder.generator(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_generator().dtor_value()));
}
if (dafnyValue.dtor_kmsKeyIds().is_Some()) {
nativeBuilder.kmsKeyIds(ToNative.KmsKeyIdList(dafnyValue.dtor_kmsKeyIds().dtor_value()));
}
if (dafnyValue.dtor_clientSupplier().is_Some()) {
nativeBuilder.clientSupplier(ToNative.ClientSupplier(dafnyValue.dtor_clientSupplier().dtor_value()));
}
if (dafnyValue.dtor_grantTokens().is_Some()) {
nativeBuilder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_grantTokens().dtor_value()));
}
return nativeBuilder.build();
}
public static CreateAwsKmsMultiKeyringInput CreateAwsKmsMultiKeyringInput(
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMultiKeyringInput dafnyValue) {
CreateAwsKmsMultiKeyringInput.Builder nativeBuilder = CreateAwsKmsMultiKeyringInput.builder();
if (dafnyValue.dtor_generator().is_Some()) {
nativeBuilder.generator(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_generator().dtor_value()));
}
if (dafnyValue.dtor_kmsKeyIds().is_Some()) {
nativeBuilder.kmsKeyIds(ToNative.KmsKeyIdList(dafnyValue.dtor_kmsKeyIds().dtor_value()));
}
if (dafnyValue.dtor_clientSupplier().is_Some()) {
nativeBuilder.clientSupplier(ToNative.ClientSupplier(dafnyValue.dtor_clientSupplier().dtor_value()));
}
if (dafnyValue.dtor_grantTokens().is_Some()) {
nativeBuilder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_grantTokens().dtor_value()));
}
return nativeBuilder.build();
}
public static CreateAwsKmsRsaKeyringInput CreateAwsKmsRsaKeyringInput(
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsRsaKeyringInput dafnyValue) {
CreateAwsKmsRsaKeyringInput.Builder nativeBuilder = CreateAwsKmsRsaKeyringInput.builder();
if (dafnyValue.dtor_publicKey().is_Some()) {
nativeBuilder.publicKey(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_publicKey().dtor_value()));
}
nativeBuilder.kmsKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_kmsKeyId()));
nativeBuilder.encryptionAlgorithm(software.amazon.cryptography.services.kms.internaldafny.ToNative.EncryptionAlgorithmSpec(dafnyValue.dtor_encryptionAlgorithm()));
if (dafnyValue.dtor_kmsClient().is_Some()) {
nativeBuilder.kmsClient(software.amazon.cryptography.services.kms.internaldafny.ToNative.TrentService(dafnyValue.dtor_kmsClient().dtor_value()));
}
if (dafnyValue.dtor_grantTokens().is_Some()) {
nativeBuilder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_grantTokens().dtor_value()));
}
return nativeBuilder.build();
}
public static CreateCryptographicMaterialsCacheInput CreateCryptographicMaterialsCacheInput(
software.amazon.cryptography.materialproviders.internaldafny.types.CreateCryptographicMaterialsCacheInput dafnyValue) {
CreateCryptographicMaterialsCacheInput.Builder nativeBuilder = CreateCryptographicMaterialsCacheInput.builder();
nativeBuilder.cache(ToNative.CacheType(dafnyValue.dtor_cache()));
return nativeBuilder.build();
}
public static CreateDefaultClientSupplierInput CreateDefaultClientSupplierInput(
software.amazon.cryptography.materialproviders.internaldafny.types.CreateDefaultClientSupplierInput dafnyValue) {
CreateDefaultClientSupplierInput.Builder nativeBuilder = CreateDefaultClientSupplierInput.builder();
return nativeBuilder.build();
}
public static CreateDefaultCryptographicMaterialsManagerInput CreateDefaultCryptographicMaterialsManagerInput(
software.amazon.cryptography.materialproviders.internaldafny.types.CreateDefaultCryptographicMaterialsManagerInput dafnyValue) {
CreateDefaultCryptographicMaterialsManagerInput.Builder nativeBuilder = CreateDefaultCryptographicMaterialsManagerInput.builder();
nativeBuilder.keyring(ToNative.Keyring(dafnyValue.dtor_keyring()));
return nativeBuilder.build();
}
public static CreateMultiKeyringInput CreateMultiKeyringInput(
software.amazon.cryptography.materialproviders.internaldafny.types.CreateMultiKeyringInput dafnyValue) {
CreateMultiKeyringInput.Builder nativeBuilder = CreateMultiKeyringInput.builder();
if (dafnyValue.dtor_generator().is_Some()) {
nativeBuilder.generator(ToNative.Keyring(dafnyValue.dtor_generator().dtor_value()));
}
nativeBuilder.childKeyrings(ToNative.KeyringList(dafnyValue.dtor_childKeyrings()));
return nativeBuilder.build();
}
public static CreateRawAesKeyringInput CreateRawAesKeyringInput(
software.amazon.cryptography.materialproviders.internaldafny.types.CreateRawAesKeyringInput dafnyValue) {
CreateRawAesKeyringInput.Builder nativeBuilder = CreateRawAesKeyringInput.builder();
nativeBuilder.keyNamespace(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyNamespace()));
nativeBuilder.keyName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyName()));
nativeBuilder.wrappingKey(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_wrappingKey()));
nativeBuilder.wrappingAlg(ToNative.AesWrappingAlg(dafnyValue.dtor_wrappingAlg()));
return nativeBuilder.build();
}
public static CreateRawRsaKeyringInput CreateRawRsaKeyringInput(
software.amazon.cryptography.materialproviders.internaldafny.types.CreateRawRsaKeyringInput dafnyValue) {
CreateRawRsaKeyringInput.Builder nativeBuilder = CreateRawRsaKeyringInput.builder();
nativeBuilder.keyNamespace(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyNamespace()));
nativeBuilder.keyName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyName()));
nativeBuilder.paddingScheme(ToNative.PaddingScheme(dafnyValue.dtor_paddingScheme()));
if (dafnyValue.dtor_publicKey().is_Some()) {
nativeBuilder.publicKey(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_publicKey().dtor_value()));
}
if (dafnyValue.dtor_privateKey().is_Some()) {
nativeBuilder.privateKey(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_privateKey().dtor_value()));
}
return nativeBuilder.build();
}
public static CreateRequiredEncryptionContextCMMInput CreateRequiredEncryptionContextCMMInput(
software.amazon.cryptography.materialproviders.internaldafny.types.CreateRequiredEncryptionContextCMMInput dafnyValue) {
CreateRequiredEncryptionContextCMMInput.Builder nativeBuilder = CreateRequiredEncryptionContextCMMInput.builder();
if (dafnyValue.dtor_underlyingCMM().is_Some()) {
nativeBuilder.underlyingCMM(ToNative.CryptographicMaterialsManager(dafnyValue.dtor_underlyingCMM().dtor_value()));
}
if (dafnyValue.dtor_keyring().is_Some()) {
nativeBuilder.keyring(ToNative.Keyring(dafnyValue.dtor_keyring().dtor_value()));
}
nativeBuilder.requiredEncryptionContextKeys(ToNative.EncryptionContextKeys(dafnyValue.dtor_requiredEncryptionContextKeys()));
return nativeBuilder.build();
}
public static DecryptionMaterials DecryptionMaterials(
software.amazon.cryptography.materialproviders.internaldafny.types.DecryptionMaterials dafnyValue) {
DecryptionMaterials.Builder nativeBuilder = DecryptionMaterials.builder();
nativeBuilder.algorithmSuite(ToNative.AlgorithmSuiteInfo(dafnyValue.dtor_algorithmSuite()));
nativeBuilder.encryptionContext(ToNative.EncryptionContext(dafnyValue.dtor_encryptionContext()));
nativeBuilder.requiredEncryptionContextKeys(ToNative.EncryptionContextKeys(dafnyValue.dtor_requiredEncryptionContextKeys()));
if (dafnyValue.dtor_plaintextDataKey().is_Some()) {
nativeBuilder.plaintextDataKey(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_plaintextDataKey().dtor_value()));
}
if (dafnyValue.dtor_verificationKey().is_Some()) {
nativeBuilder.verificationKey(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_verificationKey().dtor_value()));
}
if (dafnyValue.dtor_symmetricSigningKey().is_Some()) {
nativeBuilder.symmetricSigningKey(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_symmetricSigningKey().dtor_value()));
}
return nativeBuilder.build();
}
public static DecryptMaterialsInput DecryptMaterialsInput(
software.amazon.cryptography.materialproviders.internaldafny.types.DecryptMaterialsInput dafnyValue) {
DecryptMaterialsInput.Builder nativeBuilder = DecryptMaterialsInput.builder();
nativeBuilder.algorithmSuiteId(ToNative.AlgorithmSuiteId(dafnyValue.dtor_algorithmSuiteId()));
nativeBuilder.commitmentPolicy(ToNative.CommitmentPolicy(dafnyValue.dtor_commitmentPolicy()));
nativeBuilder.encryptedDataKeys(ToNative.EncryptedDataKeyList(dafnyValue.dtor_encryptedDataKeys()));
nativeBuilder.encryptionContext(ToNative.EncryptionContext(dafnyValue.dtor_encryptionContext()));
if (dafnyValue.dtor_reproducedEncryptionContext().is_Some()) {
nativeBuilder.reproducedEncryptionContext(ToNative.EncryptionContext(dafnyValue.dtor_reproducedEncryptionContext().dtor_value()));
}
return nativeBuilder.build();
}
public static DecryptMaterialsOutput DecryptMaterialsOutput(
software.amazon.cryptography.materialproviders.internaldafny.types.DecryptMaterialsOutput dafnyValue) {
DecryptMaterialsOutput.Builder nativeBuilder = DecryptMaterialsOutput.builder();
nativeBuilder.decryptionMaterials(ToNative.DecryptionMaterials(dafnyValue.dtor_decryptionMaterials()));
return nativeBuilder.build();
}
public static DefaultCache DefaultCache(
software.amazon.cryptography.materialproviders.internaldafny.types.DefaultCache dafnyValue) {
DefaultCache.Builder nativeBuilder = DefaultCache.builder();
nativeBuilder.entryCapacity((dafnyValue.dtor_entryCapacity()));
return nativeBuilder.build();
}
public static DeleteCacheEntryInput DeleteCacheEntryInput(
software.amazon.cryptography.materialproviders.internaldafny.types.DeleteCacheEntryInput dafnyValue) {
DeleteCacheEntryInput.Builder nativeBuilder = DeleteCacheEntryInput.builder();
nativeBuilder.identifier(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_identifier()));
return nativeBuilder.build();
}
public static DIRECT_KEY_WRAPPING DIRECT_KEY_WRAPPING(DIRECT__KEY__WRAPPING dafnyValue) {
DIRECT_KEY_WRAPPING.Builder nativeBuilder = DIRECT_KEY_WRAPPING.builder();
return nativeBuilder.build();
}
public static DiscoveryFilter DiscoveryFilter(
software.amazon.cryptography.materialproviders.internaldafny.types.DiscoveryFilter dafnyValue) {
DiscoveryFilter.Builder nativeBuilder = DiscoveryFilter.builder();
nativeBuilder.accountIds(ToNative.AccountIdList(dafnyValue.dtor_accountIds()));
nativeBuilder.partition(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_partition()));
return nativeBuilder.build();
}
public static ECDSA ECDSA(
software.amazon.cryptography.materialproviders.internaldafny.types.ECDSA dafnyValue) {
ECDSA.Builder nativeBuilder = ECDSA.builder();
nativeBuilder.curve(software.amazon.cryptography.primitives.ToNative.ECDSASignatureAlgorithm(dafnyValue.dtor_curve()));
return nativeBuilder.build();
}
public static EncryptedDataKey EncryptedDataKey(
software.amazon.cryptography.materialproviders.internaldafny.types.EncryptedDataKey dafnyValue) {
EncryptedDataKey.Builder nativeBuilder = EncryptedDataKey.builder();
nativeBuilder.keyProviderId(software.amazon.smithy.dafny.conversion.ToNative.Simple.DafnyUtf8Bytes(dafnyValue.dtor_keyProviderId()));
nativeBuilder.keyProviderInfo(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_keyProviderInfo()));
nativeBuilder.ciphertext(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_ciphertext()));
return nativeBuilder.build();
}
public static EncryptionMaterials EncryptionMaterials(
software.amazon.cryptography.materialproviders.internaldafny.types.EncryptionMaterials dafnyValue) {
EncryptionMaterials.Builder nativeBuilder = EncryptionMaterials.builder();
nativeBuilder.algorithmSuite(ToNative.AlgorithmSuiteInfo(dafnyValue.dtor_algorithmSuite()));
nativeBuilder.encryptionContext(ToNative.EncryptionContext(dafnyValue.dtor_encryptionContext()));
nativeBuilder.encryptedDataKeys(ToNative.EncryptedDataKeyList(dafnyValue.dtor_encryptedDataKeys()));
nativeBuilder.requiredEncryptionContextKeys(ToNative.EncryptionContextKeys(dafnyValue.dtor_requiredEncryptionContextKeys()));
if (dafnyValue.dtor_plaintextDataKey().is_Some()) {
nativeBuilder.plaintextDataKey(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_plaintextDataKey().dtor_value()));
}
if (dafnyValue.dtor_signingKey().is_Some()) {
nativeBuilder.signingKey(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_signingKey().dtor_value()));
}
if (dafnyValue.dtor_symmetricSigningKeys().is_Some()) {
nativeBuilder.symmetricSigningKeys(ToNative.SymmetricSigningKeyList(dafnyValue.dtor_symmetricSigningKeys().dtor_value()));
}
return nativeBuilder.build();
}
public static ByteBuffer GetAlgorithmSuiteInfoInput(DafnySequence<? extends Byte> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue);
}
public static GetBranchKeyIdInput GetBranchKeyIdInput(
software.amazon.cryptography.materialproviders.internaldafny.types.GetBranchKeyIdInput dafnyValue) {
GetBranchKeyIdInput.Builder nativeBuilder = GetBranchKeyIdInput.builder();
nativeBuilder.encryptionContext(ToNative.EncryptionContext(dafnyValue.dtor_encryptionContext()));
return nativeBuilder.build();
}
public static GetBranchKeyIdOutput GetBranchKeyIdOutput(
software.amazon.cryptography.materialproviders.internaldafny.types.GetBranchKeyIdOutput dafnyValue) {
GetBranchKeyIdOutput.Builder nativeBuilder = GetBranchKeyIdOutput.builder();
nativeBuilder.branchKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_branchKeyId()));
return nativeBuilder.build();
}
public static GetCacheEntryInput GetCacheEntryInput(
software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryInput dafnyValue) {
GetCacheEntryInput.Builder nativeBuilder = GetCacheEntryInput.builder();
nativeBuilder.identifier(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_identifier()));
if (dafnyValue.dtor_bytesUsed().is_Some()) {
nativeBuilder.bytesUsed((dafnyValue.dtor_bytesUsed().dtor_value()));
}
return nativeBuilder.build();
}
public static GetCacheEntryOutput GetCacheEntryOutput(
software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryOutput dafnyValue) {
GetCacheEntryOutput.Builder nativeBuilder = GetCacheEntryOutput.builder();
nativeBuilder.materials(ToNative.Materials(dafnyValue.dtor_materials()));
nativeBuilder.creationTime((dafnyValue.dtor_creationTime()));
nativeBuilder.expiryTime((dafnyValue.dtor_expiryTime()));
nativeBuilder.messagesUsed((dafnyValue.dtor_messagesUsed()));
nativeBuilder.bytesUsed((dafnyValue.dtor_bytesUsed()));
return nativeBuilder.build();
}
public static GetClientInput GetClientInput(
software.amazon.cryptography.materialproviders.internaldafny.types.GetClientInput dafnyValue) {
GetClientInput.Builder nativeBuilder = GetClientInput.builder();
nativeBuilder.region(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_region()));
return nativeBuilder.build();
}
public static GetEncryptionMaterialsInput GetEncryptionMaterialsInput(
software.amazon.cryptography.materialproviders.internaldafny.types.GetEncryptionMaterialsInput dafnyValue) {
GetEncryptionMaterialsInput.Builder nativeBuilder = GetEncryptionMaterialsInput.builder();
nativeBuilder.encryptionContext(ToNative.EncryptionContext(dafnyValue.dtor_encryptionContext()));
nativeBuilder.commitmentPolicy(ToNative.CommitmentPolicy(dafnyValue.dtor_commitmentPolicy()));
if (dafnyValue.dtor_algorithmSuiteId().is_Some()) {
nativeBuilder.algorithmSuiteId(ToNative.AlgorithmSuiteId(dafnyValue.dtor_algorithmSuiteId().dtor_value()));
}
if (dafnyValue.dtor_maxPlaintextLength().is_Some()) {
nativeBuilder.maxPlaintextLength((dafnyValue.dtor_maxPlaintextLength().dtor_value()));
}
if (dafnyValue.dtor_requiredEncryptionContextKeys().is_Some()) {
nativeBuilder.requiredEncryptionContextKeys(ToNative.EncryptionContextKeys(dafnyValue.dtor_requiredEncryptionContextKeys().dtor_value()));
}
return nativeBuilder.build();
}
public static GetEncryptionMaterialsOutput GetEncryptionMaterialsOutput(
software.amazon.cryptography.materialproviders.internaldafny.types.GetEncryptionMaterialsOutput dafnyValue) {
GetEncryptionMaterialsOutput.Builder nativeBuilder = GetEncryptionMaterialsOutput.builder();
nativeBuilder.encryptionMaterials(ToNative.EncryptionMaterials(dafnyValue.dtor_encryptionMaterials()));
return nativeBuilder.build();
}
public static HKDF HKDF(
software.amazon.cryptography.materialproviders.internaldafny.types.HKDF dafnyValue) {
HKDF.Builder nativeBuilder = HKDF.builder();
nativeBuilder.hmac(software.amazon.cryptography.primitives.ToNative.DigestAlgorithm(dafnyValue.dtor_hmac()));
nativeBuilder.saltLength((dafnyValue.dtor_saltLength()));
nativeBuilder.inputKeyLength((dafnyValue.dtor_inputKeyLength()));
nativeBuilder.outputKeyLength((dafnyValue.dtor_outputKeyLength()));
return nativeBuilder.build();
}
public static IDENTITY IDENTITY(
software.amazon.cryptography.materialproviders.internaldafny.types.IDENTITY dafnyValue) {
IDENTITY.Builder nativeBuilder = IDENTITY.builder();
return nativeBuilder.build();
}
public static InitializeDecryptionMaterialsInput InitializeDecryptionMaterialsInput(
software.amazon.cryptography.materialproviders.internaldafny.types.InitializeDecryptionMaterialsInput dafnyValue) {
InitializeDecryptionMaterialsInput.Builder nativeBuilder = InitializeDecryptionMaterialsInput.builder();
nativeBuilder.algorithmSuiteId(ToNative.AlgorithmSuiteId(dafnyValue.dtor_algorithmSuiteId()));
nativeBuilder.encryptionContext(ToNative.EncryptionContext(dafnyValue.dtor_encryptionContext()));
nativeBuilder.requiredEncryptionContextKeys(ToNative.EncryptionContextKeys(dafnyValue.dtor_requiredEncryptionContextKeys()));
return nativeBuilder.build();
}
public static InitializeEncryptionMaterialsInput InitializeEncryptionMaterialsInput(
software.amazon.cryptography.materialproviders.internaldafny.types.InitializeEncryptionMaterialsInput dafnyValue) {
InitializeEncryptionMaterialsInput.Builder nativeBuilder = InitializeEncryptionMaterialsInput.builder();
nativeBuilder.algorithmSuiteId(ToNative.AlgorithmSuiteId(dafnyValue.dtor_algorithmSuiteId()));
nativeBuilder.encryptionContext(ToNative.EncryptionContext(dafnyValue.dtor_encryptionContext()));
nativeBuilder.requiredEncryptionContextKeys(ToNative.EncryptionContextKeys(dafnyValue.dtor_requiredEncryptionContextKeys()));
if (dafnyValue.dtor_signingKey().is_Some()) {
nativeBuilder.signingKey(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_signingKey().dtor_value()));
}
if (dafnyValue.dtor_verificationKey().is_Some()) {
nativeBuilder.verificationKey(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_verificationKey().dtor_value()));
}
return nativeBuilder.build();
}
public static IntermediateKeyWrapping IntermediateKeyWrapping(
software.amazon.cryptography.materialproviders.internaldafny.types.IntermediateKeyWrapping dafnyValue) {
IntermediateKeyWrapping.Builder nativeBuilder = IntermediateKeyWrapping.builder();
nativeBuilder.keyEncryptionKeyKdf(ToNative.DerivationAlgorithm(dafnyValue.dtor_keyEncryptionKeyKdf()));
nativeBuilder.macKeyKdf(ToNative.DerivationAlgorithm(dafnyValue.dtor_macKeyKdf()));
nativeBuilder.pdkEncryptAlgorithm(ToNative.Encrypt(dafnyValue.dtor_pdkEncryptAlgorithm()));
return nativeBuilder.build();
}
public static MaterialProvidersConfig MaterialProvidersConfig(
software.amazon.cryptography.materialproviders.internaldafny.types.MaterialProvidersConfig dafnyValue) {
MaterialProvidersConfig.Builder nativeBuilder = MaterialProvidersConfig.builder();
return nativeBuilder.build();
}
public static MultiThreadedCache MultiThreadedCache(
software.amazon.cryptography.materialproviders.internaldafny.types.MultiThreadedCache dafnyValue) {
MultiThreadedCache.Builder nativeBuilder = MultiThreadedCache.builder();
nativeBuilder.entryCapacity((dafnyValue.dtor_entryCapacity()));
if (dafnyValue.dtor_entryPruningTailSize().is_Some()) {
nativeBuilder.entryPruningTailSize((dafnyValue.dtor_entryPruningTailSize().dtor_value()));
}
return nativeBuilder.build();
}
public static NoCache NoCache(
software.amazon.cryptography.materialproviders.internaldafny.types.NoCache dafnyValue) {
NoCache.Builder nativeBuilder = NoCache.builder();
return nativeBuilder.build();
}
public static None None(
software.amazon.cryptography.materialproviders.internaldafny.types.None dafnyValue) {
None.Builder nativeBuilder = None.builder();
return nativeBuilder.build();
}
public static OnDecryptInput OnDecryptInput(
software.amazon.cryptography.materialproviders.internaldafny.types.OnDecryptInput dafnyValue) {
OnDecryptInput.Builder nativeBuilder = OnDecryptInput.builder();
nativeBuilder.materials(ToNative.DecryptionMaterials(dafnyValue.dtor_materials()));
nativeBuilder.encryptedDataKeys(ToNative.EncryptedDataKeyList(dafnyValue.dtor_encryptedDataKeys()));
return nativeBuilder.build();
}
public static OnDecryptOutput OnDecryptOutput(
software.amazon.cryptography.materialproviders.internaldafny.types.OnDecryptOutput dafnyValue) {
OnDecryptOutput.Builder nativeBuilder = OnDecryptOutput.builder();
nativeBuilder.materials(ToNative.DecryptionMaterials(dafnyValue.dtor_materials()));
return nativeBuilder.build();
}
public static OnEncryptInput OnEncryptInput(
software.amazon.cryptography.materialproviders.internaldafny.types.OnEncryptInput dafnyValue) {
OnEncryptInput.Builder nativeBuilder = OnEncryptInput.builder();
nativeBuilder.materials(ToNative.EncryptionMaterials(dafnyValue.dtor_materials()));
return nativeBuilder.build();
}
public static OnEncryptOutput OnEncryptOutput(
software.amazon.cryptography.materialproviders.internaldafny.types.OnEncryptOutput dafnyValue) {
OnEncryptOutput.Builder nativeBuilder = OnEncryptOutput.builder();
nativeBuilder.materials(ToNative.EncryptionMaterials(dafnyValue.dtor_materials()));
return nativeBuilder.build();
}
public static PutCacheEntryInput PutCacheEntryInput(
software.amazon.cryptography.materialproviders.internaldafny.types.PutCacheEntryInput dafnyValue) {
PutCacheEntryInput.Builder nativeBuilder = PutCacheEntryInput.builder();
nativeBuilder.identifier(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_identifier()));
nativeBuilder.materials(ToNative.Materials(dafnyValue.dtor_materials()));
nativeBuilder.creationTime((dafnyValue.dtor_creationTime()));
nativeBuilder.expiryTime((dafnyValue.dtor_expiryTime()));
if (dafnyValue.dtor_messagesUsed().is_Some()) {
nativeBuilder.messagesUsed((dafnyValue.dtor_messagesUsed().dtor_value()));
}
if (dafnyValue.dtor_bytesUsed().is_Some()) {
nativeBuilder.bytesUsed((dafnyValue.dtor_bytesUsed().dtor_value()));
}
return nativeBuilder.build();
}
public static SingleThreadedCache SingleThreadedCache(
software.amazon.cryptography.materialproviders.internaldafny.types.SingleThreadedCache dafnyValue) {
SingleThreadedCache.Builder nativeBuilder = SingleThreadedCache.builder();
nativeBuilder.entryCapacity((dafnyValue.dtor_entryCapacity()));
if (dafnyValue.dtor_entryPruningTailSize().is_Some()) {
nativeBuilder.entryPruningTailSize((dafnyValue.dtor_entryPruningTailSize().dtor_value()));
}
return nativeBuilder.build();
}
public static StormTrackingCache StormTrackingCache(
software.amazon.cryptography.materialproviders.internaldafny.types.StormTrackingCache dafnyValue) {
StormTrackingCache.Builder nativeBuilder = StormTrackingCache.builder();
nativeBuilder.entryCapacity((dafnyValue.dtor_entryCapacity()));
if (dafnyValue.dtor_entryPruningTailSize().is_Some()) {
nativeBuilder.entryPruningTailSize((dafnyValue.dtor_entryPruningTailSize().dtor_value()));
}
nativeBuilder.gracePeriod((dafnyValue.dtor_gracePeriod()));
nativeBuilder.graceInterval((dafnyValue.dtor_graceInterval()));
nativeBuilder.fanOut((dafnyValue.dtor_fanOut()));
nativeBuilder.inFlightTTL((dafnyValue.dtor_inFlightTTL()));
nativeBuilder.sleepMilli((dafnyValue.dtor_sleepMilli()));
return nativeBuilder.build();
}
public static UpdateUsageMetadataInput UpdateUsageMetadataInput(
software.amazon.cryptography.materialproviders.internaldafny.types.UpdateUsageMetadataInput dafnyValue) {
UpdateUsageMetadataInput.Builder nativeBuilder = UpdateUsageMetadataInput.builder();
nativeBuilder.identifier(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_identifier()));
nativeBuilder.bytesUsed((dafnyValue.dtor_bytesUsed()));
return nativeBuilder.build();
}
public static ValidateCommitmentPolicyOnDecryptInput ValidateCommitmentPolicyOnDecryptInput(
software.amazon.cryptography.materialproviders.internaldafny.types.ValidateCommitmentPolicyOnDecryptInput dafnyValue) {
ValidateCommitmentPolicyOnDecryptInput.Builder nativeBuilder = ValidateCommitmentPolicyOnDecryptInput.builder();
nativeBuilder.algorithm(ToNative.AlgorithmSuiteId(dafnyValue.dtor_algorithm()));
nativeBuilder.commitmentPolicy(ToNative.CommitmentPolicy(dafnyValue.dtor_commitmentPolicy()));
return nativeBuilder.build();
}
public static ValidateCommitmentPolicyOnEncryptInput ValidateCommitmentPolicyOnEncryptInput(
software.amazon.cryptography.materialproviders.internaldafny.types.ValidateCommitmentPolicyOnEncryptInput dafnyValue) {
ValidateCommitmentPolicyOnEncryptInput.Builder nativeBuilder = ValidateCommitmentPolicyOnEncryptInput.builder();
nativeBuilder.algorithm(ToNative.AlgorithmSuiteId(dafnyValue.dtor_algorithm()));
nativeBuilder.commitmentPolicy(ToNative.CommitmentPolicy(dafnyValue.dtor_commitmentPolicy()));
return nativeBuilder.build();
}
public static ValidDecryptionMaterialsTransitionInput ValidDecryptionMaterialsTransitionInput(
software.amazon.cryptography.materialproviders.internaldafny.types.ValidDecryptionMaterialsTransitionInput dafnyValue) {
ValidDecryptionMaterialsTransitionInput.Builder nativeBuilder = ValidDecryptionMaterialsTransitionInput.builder();
nativeBuilder.start(ToNative.DecryptionMaterials(dafnyValue.dtor_start()));
nativeBuilder.stop(ToNative.DecryptionMaterials(dafnyValue.dtor_stop()));
return nativeBuilder.build();
}
public static ValidEncryptionMaterialsTransitionInput ValidEncryptionMaterialsTransitionInput(
software.amazon.cryptography.materialproviders.internaldafny.types.ValidEncryptionMaterialsTransitionInput dafnyValue) {
ValidEncryptionMaterialsTransitionInput.Builder nativeBuilder = ValidEncryptionMaterialsTransitionInput.builder();
nativeBuilder.start(ToNative.EncryptionMaterials(dafnyValue.dtor_start()));
nativeBuilder.stop(ToNative.EncryptionMaterials(dafnyValue.dtor_stop()));
return nativeBuilder.build();
}
public static AesWrappingAlg AesWrappingAlg(
software.amazon.cryptography.materialproviders.internaldafny.types.AesWrappingAlg dafnyValue) {
if (dafnyValue.is_ALG__AES128__GCM__IV12__TAG16()) {
return AesWrappingAlg.ALG_AES128_GCM_IV12_TAG16;
}
if (dafnyValue.is_ALG__AES192__GCM__IV12__TAG16()) {
return AesWrappingAlg.ALG_AES192_GCM_IV12_TAG16;
}
if (dafnyValue.is_ALG__AES256__GCM__IV12__TAG16()) {
return AesWrappingAlg.ALG_AES256_GCM_IV12_TAG16;
}
throw new IllegalArgumentException("No entry of software.amazon.cryptography.materialproviders.model.AesWrappingAlg matches the input : " + dafnyValue);
}
public static DBEAlgorithmSuiteId DBEAlgorithmSuiteId(
software.amazon.cryptography.materialproviders.internaldafny.types.DBEAlgorithmSuiteId dafnyValue) {
if (dafnyValue.is_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__SYMSIG__HMAC__SHA384()) {
return DBEAlgorithmSuiteId.ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384;
}
if (dafnyValue.is_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__ECDSA__P384__SYMSIG__HMAC__SHA384()) {
return DBEAlgorithmSuiteId.ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384_SYMSIG_HMAC_SHA384;
}
throw new IllegalArgumentException("No entry of software.amazon.cryptography.materialproviders.model.DBEAlgorithmSuiteId matches the input : " + dafnyValue);
}
public static DBECommitmentPolicy DBECommitmentPolicy(
software.amazon.cryptography.materialproviders.internaldafny.types.DBECommitmentPolicy dafnyValue) {
if (dafnyValue.is_REQUIRE__ENCRYPT__REQUIRE__DECRYPT()) {
return DBECommitmentPolicy.REQUIRE_ENCRYPT_REQUIRE_DECRYPT;
}
throw new IllegalArgumentException("No entry of software.amazon.cryptography.materialproviders.model.DBECommitmentPolicy matches the input : " + dafnyValue);
}
public static ESDKAlgorithmSuiteId ESDKAlgorithmSuiteId(
software.amazon.cryptography.materialproviders.internaldafny.types.ESDKAlgorithmSuiteId dafnyValue) {
if (dafnyValue.is_ALG__AES__128__GCM__IV12__TAG16__NO__KDF()) {
return ESDKAlgorithmSuiteId.ALG_AES_128_GCM_IV12_TAG16_NO_KDF;
}
if (dafnyValue.is_ALG__AES__192__GCM__IV12__TAG16__NO__KDF()) {
return ESDKAlgorithmSuiteId.ALG_AES_192_GCM_IV12_TAG16_NO_KDF;
}
if (dafnyValue.is_ALG__AES__256__GCM__IV12__TAG16__NO__KDF()) {
return ESDKAlgorithmSuiteId.ALG_AES_256_GCM_IV12_TAG16_NO_KDF;
}
if (dafnyValue.is_ALG__AES__128__GCM__IV12__TAG16__HKDF__SHA256()) {
return ESDKAlgorithmSuiteId.ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256;
}
if (dafnyValue.is_ALG__AES__192__GCM__IV12__TAG16__HKDF__SHA256()) {
return ESDKAlgorithmSuiteId.ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA256;
}
if (dafnyValue.is_ALG__AES__256__GCM__IV12__TAG16__HKDF__SHA256()) {
return ESDKAlgorithmSuiteId.ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA256;
}
if (dafnyValue.is_ALG__AES__128__GCM__IV12__TAG16__HKDF__SHA256__ECDSA__P256()) {
return ESDKAlgorithmSuiteId.ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256;
}
if (dafnyValue.is_ALG__AES__192__GCM__IV12__TAG16__HKDF__SHA384__ECDSA__P384()) {
return ESDKAlgorithmSuiteId.ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384;
}
if (dafnyValue.is_ALG__AES__256__GCM__IV12__TAG16__HKDF__SHA384__ECDSA__P384()) {
return ESDKAlgorithmSuiteId.ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384;
}
if (dafnyValue.is_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY()) {
return ESDKAlgorithmSuiteId.ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY;
}
if (dafnyValue.is_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__ECDSA__P384()) {
return ESDKAlgorithmSuiteId.ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384;
}
throw new IllegalArgumentException("No entry of software.amazon.cryptography.materialproviders.model.ESDKAlgorithmSuiteId matches the input : " + dafnyValue);
}
public static ESDKCommitmentPolicy ESDKCommitmentPolicy(
software.amazon.cryptography.materialproviders.internaldafny.types.ESDKCommitmentPolicy dafnyValue) {
if (dafnyValue.is_FORBID__ENCRYPT__ALLOW__DECRYPT()) {
return ESDKCommitmentPolicy.FORBID_ENCRYPT_ALLOW_DECRYPT;
}
if (dafnyValue.is_REQUIRE__ENCRYPT__ALLOW__DECRYPT()) {
return ESDKCommitmentPolicy.REQUIRE_ENCRYPT_ALLOW_DECRYPT;
}
if (dafnyValue.is_REQUIRE__ENCRYPT__REQUIRE__DECRYPT()) {
return ESDKCommitmentPolicy.REQUIRE_ENCRYPT_REQUIRE_DECRYPT;
}
throw new IllegalArgumentException("No entry of software.amazon.cryptography.materialproviders.model.ESDKCommitmentPolicy matches the input : " + dafnyValue);
}
public static PaddingScheme PaddingScheme(
software.amazon.cryptography.materialproviders.internaldafny.types.PaddingScheme dafnyValue) {
if (dafnyValue.is_PKCS1()) {
return PaddingScheme.PKCS1;
}
if (dafnyValue.is_OAEP__SHA1__MGF1()) {
return PaddingScheme.OAEP_SHA1_MGF1;
}
if (dafnyValue.is_OAEP__SHA256__MGF1()) {
return PaddingScheme.OAEP_SHA256_MGF1;
}
if (dafnyValue.is_OAEP__SHA384__MGF1()) {
return PaddingScheme.OAEP_SHA384_MGF1;
}
if (dafnyValue.is_OAEP__SHA512__MGF1()) {
return PaddingScheme.OAEP_SHA512_MGF1;
}
throw new IllegalArgumentException("No entry of software.amazon.cryptography.materialproviders.model.PaddingScheme matches the input : " + dafnyValue);
}
public static AlgorithmSuiteId AlgorithmSuiteId(
software.amazon.cryptography.materialproviders.internaldafny.types.AlgorithmSuiteId dafnyValue) {
AlgorithmSuiteId.Builder nativeBuilder = AlgorithmSuiteId.builder();
if (dafnyValue.is_ESDK()) {
nativeBuilder.ESDK(ToNative.ESDKAlgorithmSuiteId(dafnyValue.dtor_ESDK()));
}
if (dafnyValue.is_DBE()) {
nativeBuilder.DBE(ToNative.DBEAlgorithmSuiteId(dafnyValue.dtor_DBE()));
}
return nativeBuilder.build();
}
public static CacheType CacheType(
software.amazon.cryptography.materialproviders.internaldafny.types.CacheType dafnyValue) {
CacheType.Builder nativeBuilder = CacheType.builder();
if (dafnyValue.is_Default()) {
nativeBuilder.Default(ToNative.DefaultCache(dafnyValue.dtor_Default()));
}
if (dafnyValue.is_No()) {
nativeBuilder.No(ToNative.NoCache(dafnyValue.dtor_No()));
}
if (dafnyValue.is_SingleThreaded()) {
nativeBuilder.SingleThreaded(ToNative.SingleThreadedCache(dafnyValue.dtor_SingleThreaded()));
}
if (dafnyValue.is_MultiThreaded()) {
nativeBuilder.MultiThreaded(ToNative.MultiThreadedCache(dafnyValue.dtor_MultiThreaded()));
}
if (dafnyValue.is_StormTracking()) {
nativeBuilder.StormTracking(ToNative.StormTrackingCache(dafnyValue.dtor_StormTracking()));
}
return nativeBuilder.build();
}
public static CommitmentPolicy CommitmentPolicy(
software.amazon.cryptography.materialproviders.internaldafny.types.CommitmentPolicy dafnyValue) {
CommitmentPolicy.Builder nativeBuilder = CommitmentPolicy.builder();
if (dafnyValue.is_ESDK()) {
nativeBuilder.ESDK(ToNative.ESDKCommitmentPolicy(dafnyValue.dtor_ESDK()));
}
if (dafnyValue.is_DBE()) {
nativeBuilder.DBE(ToNative.DBECommitmentPolicy(dafnyValue.dtor_DBE()));
}
return nativeBuilder.build();
}
public static DerivationAlgorithm DerivationAlgorithm(
software.amazon.cryptography.materialproviders.internaldafny.types.DerivationAlgorithm dafnyValue) {
DerivationAlgorithm.Builder nativeBuilder = DerivationAlgorithm.builder();
if (dafnyValue.is_HKDF()) {
nativeBuilder.HKDF(ToNative.HKDF(dafnyValue.dtor_HKDF()));
}
if (dafnyValue.is_IDENTITY()) {
nativeBuilder.IDENTITY(ToNative.IDENTITY(dafnyValue.dtor_IDENTITY()));
}
if (dafnyValue.is_None()) {
nativeBuilder.None(ToNative.None(dafnyValue.dtor_None()));
}
return nativeBuilder.build();
}
public static EdkWrappingAlgorithm EdkWrappingAlgorithm(
software.amazon.cryptography.materialproviders.internaldafny.types.EdkWrappingAlgorithm dafnyValue) {
EdkWrappingAlgorithm.Builder nativeBuilder = EdkWrappingAlgorithm.builder();
if (dafnyValue.is_DIRECT__KEY__WRAPPING()) {
nativeBuilder.DIRECT_KEY_WRAPPING(ToNative.DIRECT_KEY_WRAPPING(dafnyValue.dtor_DIRECT__KEY__WRAPPING()));
}
if (dafnyValue.is_IntermediateKeyWrapping()) {
nativeBuilder.IntermediateKeyWrapping(ToNative.IntermediateKeyWrapping(dafnyValue.dtor_IntermediateKeyWrapping()));
}
return nativeBuilder.build();
}
public static Encrypt Encrypt(
software.amazon.cryptography.materialproviders.internaldafny.types.Encrypt dafnyValue) {
Encrypt.Builder nativeBuilder = Encrypt.builder();
if (dafnyValue.is_AES__GCM()) {
nativeBuilder.AES_GCM(software.amazon.cryptography.primitives.ToNative.AES_GCM(dafnyValue.dtor_AES__GCM()));
}
return nativeBuilder.build();
}
public static Materials Materials(
software.amazon.cryptography.materialproviders.internaldafny.types.Materials dafnyValue) {
Materials.Builder nativeBuilder = Materials.builder();
if (dafnyValue.is_Encryption()) {
nativeBuilder.Encryption(ToNative.EncryptionMaterials(dafnyValue.dtor_Encryption()));
}
if (dafnyValue.is_Decryption()) {
nativeBuilder.Decryption(ToNative.DecryptionMaterials(dafnyValue.dtor_Decryption()));
}
if (dafnyValue.is_BranchKey()) {
nativeBuilder.BranchKey(software.amazon.cryptography.keystore.ToNative.BranchKeyMaterials(dafnyValue.dtor_BranchKey()));
}
if (dafnyValue.is_BeaconKey()) {
nativeBuilder.BeaconKey(software.amazon.cryptography.keystore.ToNative.BeaconKeyMaterials(dafnyValue.dtor_BeaconKey()));
}
return nativeBuilder.build();
}
public static SignatureAlgorithm SignatureAlgorithm(
software.amazon.cryptography.materialproviders.internaldafny.types.SignatureAlgorithm dafnyValue) {
SignatureAlgorithm.Builder nativeBuilder = SignatureAlgorithm.builder();
if (dafnyValue.is_ECDSA()) {
nativeBuilder.ECDSA(ToNative.ECDSA(dafnyValue.dtor_ECDSA()));
}
if (dafnyValue.is_None()) {
nativeBuilder.None(ToNative.None(dafnyValue.dtor_None()));
}
return nativeBuilder.build();
}
public static SymmetricSignatureAlgorithm SymmetricSignatureAlgorithm(
software.amazon.cryptography.materialproviders.internaldafny.types.SymmetricSignatureAlgorithm dafnyValue) {
SymmetricSignatureAlgorithm.Builder nativeBuilder = SymmetricSignatureAlgorithm.builder();
if (dafnyValue.is_HMAC()) {
nativeBuilder.HMAC(software.amazon.cryptography.primitives.ToNative.DigestAlgorithm(dafnyValue.dtor_HMAC()));
}
if (dafnyValue.is_None()) {
nativeBuilder.None(ToNative.None(dafnyValue.dtor_None()));
}
return nativeBuilder.build();
}
public static List<String> AccountIdList(
DafnySequence<? extends DafnySequence<? extends Character>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String);
}
public static List<EncryptedDataKey> EncryptedDataKeyList(
DafnySequence<? extends software.amazon.cryptography.materialproviders.internaldafny.types.EncryptedDataKey> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.materialproviders.ToNative::EncryptedDataKey);
}
public static List<String> EncryptionContextKeys(
DafnySequence<? extends DafnySequence<? extends Byte>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::DafnyUtf8Bytes);
}
public static List<String> GrantTokenList(
DafnySequence<? extends DafnySequence<? extends Character>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String);
}
public static List<IKeyring> KeyringList(
DafnySequence<? extends software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.materialproviders.ToNative::Keyring);
}
public static List<String> KmsKeyIdList(
DafnySequence<? extends DafnySequence<? extends Character>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String);
}
public static List<String> RegionList(
DafnySequence<? extends DafnySequence<? extends Character>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String);
}
public static List<ByteBuffer> SymmetricSigningKeyList(
DafnySequence<? extends DafnySequence<? extends Byte>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::ByteBuffer);
}
public static Map<String, String> EncryptionContext(
DafnyMap<? extends DafnySequence<? extends Byte>, ? extends DafnySequence<? extends Byte>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::DafnyUtf8Bytes,
software.amazon.smithy.dafny.conversion.ToNative.Simple::DafnyUtf8Bytes);
}
public static IBranchKeyIdSupplier BranchKeyIdSupplier(
software.amazon.cryptography.materialproviders.internaldafny.types.IBranchKeyIdSupplier dafnyValue) {
if (dafnyValue instanceof BranchKeyIdSupplier.NativeWrapper) {
return ((BranchKeyIdSupplier.NativeWrapper) dafnyValue)._impl;
}
return BranchKeyIdSupplier.wrap(dafnyValue);
}
public static IClientSupplier ClientSupplier(
software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier dafnyValue) {
if (dafnyValue instanceof ClientSupplier.NativeWrapper) {
return ((ClientSupplier.NativeWrapper) dafnyValue)._impl;
}
return ClientSupplier.wrap(dafnyValue);
}
public static ICryptographicMaterialsCache CryptographicMaterialsCache(
software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsCache dafnyValue) {
if (dafnyValue instanceof CryptographicMaterialsCache.NativeWrapper) {
return ((CryptographicMaterialsCache.NativeWrapper) dafnyValue)._impl;
}
return CryptographicMaterialsCache.wrap(dafnyValue);
}
public static ICryptographicMaterialsManager CryptographicMaterialsManager(
software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsManager dafnyValue) {
if (dafnyValue instanceof CryptographicMaterialsManager.NativeWrapper) {
return ((CryptographicMaterialsManager.NativeWrapper) dafnyValue)._impl;
}
return CryptographicMaterialsManager.wrap(dafnyValue);
}
public static IKeyring Keyring(
software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring dafnyValue) {
if (dafnyValue instanceof Keyring.NativeWrapper) {
return ((Keyring.NativeWrapper) dafnyValue)._impl;
}
return Keyring.wrap(dafnyValue);
}
public static MaterialProviders AwsCryptographicMaterialProviders(
IAwsCryptographicMaterialProvidersClient dafnyValue) {
return new MaterialProviders(dafnyValue);
}
}
| 311 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/IBranchKeyIdSupplier.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders;
import software.amazon.cryptography.materialproviders.model.GetBranchKeyIdInput;
import software.amazon.cryptography.materialproviders.model.GetBranchKeyIdOutput;
public interface IBranchKeyIdSupplier {
/**
* Given the Encryption Context associated with this encryption or decryption, returns the branch key that should be responsible for unwrapping or wrapping the data key.
*
* @param input Inputs for determining the Branch Key which should be used to wrap or unwrap the data key for this encryption or decryption
* @return Outputs for the Branch Key responsible for wrapping or unwrapping the data key in this encryption or decryption.
*/
GetBranchKeyIdOutput GetBranchKeyId(GetBranchKeyIdInput input);
}
| 312 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/ICryptographicMaterialsManager.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders;
import software.amazon.cryptography.materialproviders.model.DecryptMaterialsInput;
import software.amazon.cryptography.materialproviders.model.DecryptMaterialsOutput;
import software.amazon.cryptography.materialproviders.model.GetEncryptionMaterialsInput;
import software.amazon.cryptography.materialproviders.model.GetEncryptionMaterialsOutput;
public interface ICryptographicMaterialsManager {
DecryptMaterialsOutput DecryptMaterials(DecryptMaterialsInput input);
GetEncryptionMaterialsOutput GetEncryptionMaterials(GetEncryptionMaterialsInput input);
}
| 313 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/ClientSupplier.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders;
import Wrappers_Compile.Result;
import java.lang.IllegalArgumentException;
import java.lang.RuntimeException;
import java.util.Objects;
import software.amazon.awssdk.services.kms.KmsClient;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error;
import software.amazon.cryptography.materialproviders.model.GetClientInput;
import software.amazon.cryptography.services.kms.internaldafny.Shim;
import software.amazon.cryptography.services.kms.internaldafny.types.IKMSClient;
public final class ClientSupplier implements IClientSupplier {
private final software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier _impl;
private ClientSupplier(
software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier iClientSupplier) {
Objects.requireNonNull(iClientSupplier, "Missing value for required argument `iClientSupplier`");
this._impl = iClientSupplier;
}
public static ClientSupplier wrap(
software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier iClientSupplier) {
return new ClientSupplier(iClientSupplier);
}
public static <I extends IClientSupplier> ClientSupplier wrap(I iClientSupplier) {
Objects.requireNonNull(iClientSupplier, "Missing value for required argument `iClientSupplier`");
if (iClientSupplier instanceof software.amazon.cryptography.materialproviders.ClientSupplier) {
return ((ClientSupplier) iClientSupplier);
}
return ClientSupplier.wrap(new NativeWrapper(iClientSupplier));
}
public software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier impl() {
return this._impl;
}
/**
* Returns an AWS KMS Client.
*
* @param input Inputs for getting a AWS KMS Client.
*
*/
public KmsClient GetClient(GetClientInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.GetClientInput dafnyValue = ToDafny.GetClientInput(input);
Result<IKMSClient, Error> result = this._impl.GetClient(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return software.amazon.cryptography.services.kms.internaldafny.ToNative.TrentService(result.dtor_value());
}
protected static final class NativeWrapper implements software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier {
protected final IClientSupplier _impl;
NativeWrapper(IClientSupplier nativeImpl) {
if (nativeImpl instanceof ClientSupplier) {
throw new IllegalArgumentException("Recursive wrapping is strictly forbidden.");
}
this._impl = nativeImpl;
}
public Result<IKMSClient, Error> GetClient(
software.amazon.cryptography.materialproviders.internaldafny.types.GetClientInput dafnyInput) {
GetClientInput nativeInput = ToNative.GetClientInput(dafnyInput);
try {
KmsClient nativeOutput = this._impl.GetClient(nativeInput);
IKMSClient dafnyOutput = new Shim(nativeOutput, null);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<IKMSClient, Error> GetClient_k(
software.amazon.cryptography.materialproviders.internaldafny.types.GetClientInput dafnyInput) {
throw new RuntimeException("Not supported at this time.");
}
}
}
| 314 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/CryptographicMaterialsManager.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders;
import Wrappers_Compile.Result;
import java.lang.IllegalArgumentException;
import java.lang.RuntimeException;
import java.util.Objects;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error;
import software.amazon.cryptography.materialproviders.model.DecryptMaterialsInput;
import software.amazon.cryptography.materialproviders.model.DecryptMaterialsOutput;
import software.amazon.cryptography.materialproviders.model.GetEncryptionMaterialsInput;
import software.amazon.cryptography.materialproviders.model.GetEncryptionMaterialsOutput;
public final class CryptographicMaterialsManager implements ICryptographicMaterialsManager {
private final software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsManager _impl;
private CryptographicMaterialsManager(
software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsManager iCryptographicMaterialsManager) {
Objects.requireNonNull(iCryptographicMaterialsManager, "Missing value for required argument `iCryptographicMaterialsManager`");
this._impl = iCryptographicMaterialsManager;
}
public static CryptographicMaterialsManager wrap(
software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsManager iCryptographicMaterialsManager) {
return new CryptographicMaterialsManager(iCryptographicMaterialsManager);
}
public static <I extends ICryptographicMaterialsManager> CryptographicMaterialsManager wrap(
I iCryptographicMaterialsManager) {
Objects.requireNonNull(iCryptographicMaterialsManager, "Missing value for required argument `iCryptographicMaterialsManager`");
if (iCryptographicMaterialsManager instanceof software.amazon.cryptography.materialproviders.CryptographicMaterialsManager) {
return ((CryptographicMaterialsManager) iCryptographicMaterialsManager);
}
return CryptographicMaterialsManager.wrap(new NativeWrapper(iCryptographicMaterialsManager));
}
public software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsManager impl(
) {
return this._impl;
}
public DecryptMaterialsOutput DecryptMaterials(DecryptMaterialsInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.DecryptMaterialsInput dafnyValue = ToDafny.DecryptMaterialsInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.DecryptMaterialsOutput, Error> result = this._impl.DecryptMaterials(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.DecryptMaterialsOutput(result.dtor_value());
}
public GetEncryptionMaterialsOutput GetEncryptionMaterials(GetEncryptionMaterialsInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.GetEncryptionMaterialsInput dafnyValue = ToDafny.GetEncryptionMaterialsInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.GetEncryptionMaterialsOutput, Error> result = this._impl.GetEncryptionMaterials(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.GetEncryptionMaterialsOutput(result.dtor_value());
}
protected static final class NativeWrapper implements software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsManager {
protected final ICryptographicMaterialsManager _impl;
NativeWrapper(ICryptographicMaterialsManager nativeImpl) {
if (nativeImpl instanceof CryptographicMaterialsManager) {
throw new IllegalArgumentException("Recursive wrapping is strictly forbidden.");
}
this._impl = nativeImpl;
}
public Result<software.amazon.cryptography.materialproviders.internaldafny.types.DecryptMaterialsOutput, Error> DecryptMaterials(
software.amazon.cryptography.materialproviders.internaldafny.types.DecryptMaterialsInput dafnyInput) {
DecryptMaterialsInput nativeInput = ToNative.DecryptMaterialsInput(dafnyInput);
try {
DecryptMaterialsOutput nativeOutput = this._impl.DecryptMaterials(nativeInput);
software.amazon.cryptography.materialproviders.internaldafny.types.DecryptMaterialsOutput dafnyOutput = ToDafny.DecryptMaterialsOutput(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<software.amazon.cryptography.materialproviders.internaldafny.types.DecryptMaterialsOutput, Error> DecryptMaterials_k(
software.amazon.cryptography.materialproviders.internaldafny.types.DecryptMaterialsInput dafnyInput) {
throw new RuntimeException("Not supported at this time.");
}
public Result<software.amazon.cryptography.materialproviders.internaldafny.types.GetEncryptionMaterialsOutput, Error> GetEncryptionMaterials(
software.amazon.cryptography.materialproviders.internaldafny.types.GetEncryptionMaterialsInput dafnyInput) {
GetEncryptionMaterialsInput nativeInput = ToNative.GetEncryptionMaterialsInput(dafnyInput);
try {
GetEncryptionMaterialsOutput nativeOutput = this._impl.GetEncryptionMaterials(nativeInput);
software.amazon.cryptography.materialproviders.internaldafny.types.GetEncryptionMaterialsOutput dafnyOutput = ToDafny.GetEncryptionMaterialsOutput(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<software.amazon.cryptography.materialproviders.internaldafny.types.GetEncryptionMaterialsOutput, Error> GetEncryptionMaterials_k(
software.amazon.cryptography.materialproviders.internaldafny.types.GetEncryptionMaterialsInput dafnyInput) {
throw new RuntimeException("Not supported at this time.");
}
}
}
| 315 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/IClientSupplier.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders;
import software.amazon.awssdk.services.kms.KmsClient;
import software.amazon.cryptography.materialproviders.model.GetClientInput;
public interface IClientSupplier {
/**
* Returns an AWS KMS Client.
*
* @param input Inputs for getting a AWS KMS Client.
*
*/
KmsClient GetClient(GetClientInput input);
}
| 316 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/MaterialProviders.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders;
import Wrappers_Compile.Result;
import dafny.DafnySequence;
import dafny.Tuple0;
import java.lang.Byte;
import java.lang.IllegalArgumentException;
import java.nio.ByteBuffer;
import java.util.Objects;
import software.amazon.cryptography.materialproviders.internaldafny.MaterialProvidersClient;
import software.amazon.cryptography.materialproviders.internaldafny.__default;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error;
import software.amazon.cryptography.materialproviders.internaldafny.types.IAwsCryptographicMaterialProvidersClient;
import software.amazon.cryptography.materialproviders.model.AlgorithmSuiteInfo;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsDiscoveryKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsDiscoveryMultiKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsHierarchicalKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsMrkDiscoveryKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsMrkDiscoveryMultiKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsMrkKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsMrkMultiKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsMultiKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateAwsKmsRsaKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateCryptographicMaterialsCacheInput;
import software.amazon.cryptography.materialproviders.model.CreateDefaultClientSupplierInput;
import software.amazon.cryptography.materialproviders.model.CreateDefaultCryptographicMaterialsManagerInput;
import software.amazon.cryptography.materialproviders.model.CreateMultiKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateRawAesKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateRawRsaKeyringInput;
import software.amazon.cryptography.materialproviders.model.CreateRequiredEncryptionContextCMMInput;
import software.amazon.cryptography.materialproviders.model.DecryptionMaterials;
import software.amazon.cryptography.materialproviders.model.EncryptionMaterials;
import software.amazon.cryptography.materialproviders.model.InitializeDecryptionMaterialsInput;
import software.amazon.cryptography.materialproviders.model.InitializeEncryptionMaterialsInput;
import software.amazon.cryptography.materialproviders.model.MaterialProvidersConfig;
import software.amazon.cryptography.materialproviders.model.ValidDecryptionMaterialsTransitionInput;
import software.amazon.cryptography.materialproviders.model.ValidEncryptionMaterialsTransitionInput;
import software.amazon.cryptography.materialproviders.model.ValidateCommitmentPolicyOnDecryptInput;
import software.amazon.cryptography.materialproviders.model.ValidateCommitmentPolicyOnEncryptInput;
public class MaterialProviders {
private final IAwsCryptographicMaterialProvidersClient _impl;
protected MaterialProviders(BuilderImpl builder) {
MaterialProvidersConfig input = builder.MaterialProvidersConfig();
software.amazon.cryptography.materialproviders.internaldafny.types.MaterialProvidersConfig dafnyValue = ToDafny.MaterialProvidersConfig(input);
Result<MaterialProvidersClient, Error> result = __default.MaterialProviders(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
this._impl = result.dtor_value();
}
MaterialProviders(IAwsCryptographicMaterialProvidersClient impl) {
this._impl = impl;
}
public static Builder builder() {
return new BuilderImpl();
}
/**
* Creates an AWS KMS Discovery Keyring, which supports unwrapping data keys wrapped by a symmetric AWS KMS Key for a single region.
*
* @param input Inputs for for creating a AWS KMS Discovery Keyring.
* @return Outputs for creating a Keyring.
*/
public IKeyring CreateAwsKmsDiscoveryKeyring(CreateAwsKmsDiscoveryKeyringInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsDiscoveryKeyringInput dafnyValue = ToDafny.CreateAwsKmsDiscoveryKeyringInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring, Error> result = this._impl.CreateAwsKmsDiscoveryKeyring(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return Keyring.wrap(result.dtor_value());
}
/**
* Creates an AWS KMS Discovery Multi-Keyring, which supports unwrapping data keys wrapped by a symmetric AWS KMS Key, for multiple regions.
*
* @param input Inputs for for creating an AWS KMS Discovery Multi-Keyring.
* @return Outputs for creating a Keyring.
*/
public IKeyring CreateAwsKmsDiscoveryMultiKeyring(CreateAwsKmsDiscoveryMultiKeyringInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsDiscoveryMultiKeyringInput dafnyValue = ToDafny.CreateAwsKmsDiscoveryMultiKeyringInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring, Error> result = this._impl.CreateAwsKmsDiscoveryMultiKeyring(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return Keyring.wrap(result.dtor_value());
}
/**
* Creates a Hierarchical Keyring, which supports wrapping and unwrapping data keys using Branch Keys persisted in DynamoDB and protected by a symmetric AWS KMS Key or AWS KMS Multi-Region Key.
*
* @param input Inputs for creating a Hierarchical Keyring.
* @return Outputs for creating a Keyring.
*/
public IKeyring CreateAwsKmsHierarchicalKeyring(CreateAwsKmsHierarchicalKeyringInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsHierarchicalKeyringInput dafnyValue = ToDafny.CreateAwsKmsHierarchicalKeyringInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring, Error> result = this._impl.CreateAwsKmsHierarchicalKeyring(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return Keyring.wrap(result.dtor_value());
}
/**
* Creates an AWS KMS Keyring, which wraps and unwraps data keys using single symmetric AWS KMS Key.
*
* @param input Inputs for for creating a AWS KMS Keyring.
* @return Outputs for creating a Keyring.
*/
public IKeyring CreateAwsKmsKeyring(CreateAwsKmsKeyringInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsKeyringInput dafnyValue = ToDafny.CreateAwsKmsKeyringInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring, Error> result = this._impl.CreateAwsKmsKeyring(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return Keyring.wrap(result.dtor_value());
}
/**
* Creates an AWS KMS MRK Discovery Keyring, which supports unwrapping data keys wrapped by a symmetric AWS KMS Key or AWS KMS Multi-Region Key in a particular region.
*
* @param input Inputs for for creating a AWS KMS MRK Discovery Keyring.
* @return Outputs for creating a Keyring.
*/
public IKeyring CreateAwsKmsMrkDiscoveryKeyring(CreateAwsKmsMrkDiscoveryKeyringInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkDiscoveryKeyringInput dafnyValue = ToDafny.CreateAwsKmsMrkDiscoveryKeyringInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring, Error> result = this._impl.CreateAwsKmsMrkDiscoveryKeyring(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return Keyring.wrap(result.dtor_value());
}
/**
* Creates an AWS KMS MRK Discovery Multi-Keyring that supports unwrapping data keys wrapped by a symmetric AWS KMS Key or AWS KMS Multi-Region Key, for a single region.
*
* @param input Inputs for for creating a AWS KMS MRK Discovery Multi-Keyring.
* @return Outputs for creating a Keyring.
*/
public IKeyring CreateAwsKmsMrkDiscoveryMultiKeyring(
CreateAwsKmsMrkDiscoveryMultiKeyringInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkDiscoveryMultiKeyringInput dafnyValue = ToDafny.CreateAwsKmsMrkDiscoveryMultiKeyringInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring, Error> result = this._impl.CreateAwsKmsMrkDiscoveryMultiKeyring(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return Keyring.wrap(result.dtor_value());
}
/**
* Creates an AWS KMS MRK Keyring, which wraps and unwraps data keys using single symmetric AWS KMS Key or AWS KMS Multi-Region Key.
*
* @param input Inputs for for creating an AWS KMS MRK Keyring.
* @return Outputs for creating a Keyring.
*/
public IKeyring CreateAwsKmsMrkKeyring(CreateAwsKmsMrkKeyringInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkKeyringInput dafnyValue = ToDafny.CreateAwsKmsMrkKeyringInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring, Error> result = this._impl.CreateAwsKmsMrkKeyring(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return Keyring.wrap(result.dtor_value());
}
/**
* Creates an AWS KMS MRK Multi-Keyring, which wraps and unwraps data keys using one or more symmetric AWS KMS Keys or AWS KMS Multi-Region Keys.
*
* @param input Inputs for for creating a AWS KMS MRK Multi-Keyring.
* @return Outputs for creating a Keyring.
*/
public IKeyring CreateAwsKmsMrkMultiKeyring(CreateAwsKmsMrkMultiKeyringInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkMultiKeyringInput dafnyValue = ToDafny.CreateAwsKmsMrkMultiKeyringInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring, Error> result = this._impl.CreateAwsKmsMrkMultiKeyring(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return Keyring.wrap(result.dtor_value());
}
/**
* Creates an AWS KMS Multi-Keyring, which wraps and unwraps data keys using one or more symmetric AWS KMS Keys.
*
* @param input Inputs for for creating a AWS KMS Multi-Keyring.
* @return Outputs for creating a Keyring.
*/
public IKeyring CreateAwsKmsMultiKeyring(CreateAwsKmsMultiKeyringInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMultiKeyringInput dafnyValue = ToDafny.CreateAwsKmsMultiKeyringInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring, Error> result = this._impl.CreateAwsKmsMultiKeyring(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return Keyring.wrap(result.dtor_value());
}
/**
* Creates an AWS KMS RSA Keyring, which wraps and unwraps data keys using a single asymmetric AWS KMS Key for RSA.
*
* @param input Inputs for creating a AWS KMS RSA Keyring.
* @return Outputs for creating a Keyring.
*/
public IKeyring CreateAwsKmsRsaKeyring(CreateAwsKmsRsaKeyringInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsRsaKeyringInput dafnyValue = ToDafny.CreateAwsKmsRsaKeyringInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring, Error> result = this._impl.CreateAwsKmsRsaKeyring(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return Keyring.wrap(result.dtor_value());
}
public ICryptographicMaterialsCache CreateCryptographicMaterialsCache(
CreateCryptographicMaterialsCacheInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.CreateCryptographicMaterialsCacheInput dafnyValue = ToDafny.CreateCryptographicMaterialsCacheInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsCache, Error> result = this._impl.CreateCryptographicMaterialsCache(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return CryptographicMaterialsCache.wrap(result.dtor_value());
}
public IClientSupplier CreateDefaultClientSupplier(CreateDefaultClientSupplierInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.CreateDefaultClientSupplierInput dafnyValue = ToDafny.CreateDefaultClientSupplierInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier, Error> result = this._impl.CreateDefaultClientSupplier(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ClientSupplier.wrap(result.dtor_value());
}
/**
* Creates a Default Cryptographic Materials Manager.
*
* @param input Inputs for creating a Default Cryptographic Materials Manager.
* @return Outputs for creating a Default Cryptographic Materials Manager.
*/
public ICryptographicMaterialsManager CreateDefaultCryptographicMaterialsManager(
CreateDefaultCryptographicMaterialsManagerInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.CreateDefaultCryptographicMaterialsManagerInput dafnyValue = ToDafny.CreateDefaultCryptographicMaterialsManagerInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsManager, Error> result = this._impl.CreateDefaultCryptographicMaterialsManager(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return CryptographicMaterialsManager.wrap(result.dtor_value());
}
/**
* Creates a Multi-Keyring comprised of one or more other Keyrings.
*
* @param input Inputs for creating a Multi-Keyring.
* @return Outputs for creating a Keyring.
*/
public IKeyring CreateMultiKeyring(CreateMultiKeyringInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.CreateMultiKeyringInput dafnyValue = ToDafny.CreateMultiKeyringInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring, Error> result = this._impl.CreateMultiKeyring(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return Keyring.wrap(result.dtor_value());
}
/**
* Creates a Raw AES Keyring, which wraps and unwraps data keys locally using AES_GCM.
*
* @param input Inputs for creating a Raw AES Keyring.
* @return Outputs for creating a Keyring.
*/
public IKeyring CreateRawAesKeyring(CreateRawAesKeyringInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.CreateRawAesKeyringInput dafnyValue = ToDafny.CreateRawAesKeyringInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring, Error> result = this._impl.CreateRawAesKeyring(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return Keyring.wrap(result.dtor_value());
}
/**
* Creates a Raw RSA Keyring, which wraps and unwraps data keys locally using RSA.
*
* @param input Inputs for creating a Raw RAW Keyring.
* @return Outputs for creating a Keyring.
*/
public IKeyring CreateRawRsaKeyring(CreateRawRsaKeyringInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.CreateRawRsaKeyringInput dafnyValue = ToDafny.CreateRawRsaKeyringInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring, Error> result = this._impl.CreateRawRsaKeyring(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return Keyring.wrap(result.dtor_value());
}
/**
* Creates an Required Encryption Context Cryptographic Materials Manager.
*
* @param input Inputs for creating an Required Encryption Context Cryptographic Materials Manager.
* @return Outputs for creating an Required Encryption Context Cryptographic Materials Manager.
*/
public ICryptographicMaterialsManager CreateRequiredEncryptionContextCMM(
CreateRequiredEncryptionContextCMMInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.CreateRequiredEncryptionContextCMMInput dafnyValue = ToDafny.CreateRequiredEncryptionContextCMMInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsManager, Error> result = this._impl.CreateRequiredEncryptionContextCMM(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return CryptographicMaterialsManager.wrap(result.dtor_value());
}
public void DecryptionMaterialsWithPlaintextDataKey(DecryptionMaterials input) {
software.amazon.cryptography.materialproviders.internaldafny.types.DecryptionMaterials dafnyValue = ToDafny.DecryptionMaterials(input);
Result<Tuple0, Error> result = this._impl.DecryptionMaterialsWithPlaintextDataKey(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
}
public void EncryptionMaterialsHasPlaintextDataKey(EncryptionMaterials input) {
software.amazon.cryptography.materialproviders.internaldafny.types.EncryptionMaterials dafnyValue = ToDafny.EncryptionMaterials(input);
Result<Tuple0, Error> result = this._impl.EncryptionMaterialsHasPlaintextDataKey(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
}
public AlgorithmSuiteInfo GetAlgorithmSuiteInfo(ByteBuffer input) {
DafnySequence<? extends Byte> dafnyValue = ToDafny.GetAlgorithmSuiteInfoInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.AlgorithmSuiteInfo, Error> result = this._impl.GetAlgorithmSuiteInfo(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.AlgorithmSuiteInfo(result.dtor_value());
}
public DecryptionMaterials InitializeDecryptionMaterials(
InitializeDecryptionMaterialsInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.InitializeDecryptionMaterialsInput dafnyValue = ToDafny.InitializeDecryptionMaterialsInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.DecryptionMaterials, Error> result = this._impl.InitializeDecryptionMaterials(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.DecryptionMaterials(result.dtor_value());
}
public EncryptionMaterials InitializeEncryptionMaterials(
InitializeEncryptionMaterialsInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.InitializeEncryptionMaterialsInput dafnyValue = ToDafny.InitializeEncryptionMaterialsInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.EncryptionMaterials, Error> result = this._impl.InitializeEncryptionMaterials(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.EncryptionMaterials(result.dtor_value());
}
public void ValidAlgorithmSuiteInfo(AlgorithmSuiteInfo input) {
software.amazon.cryptography.materialproviders.internaldafny.types.AlgorithmSuiteInfo dafnyValue = ToDafny.AlgorithmSuiteInfo(input);
Result<Tuple0, Error> result = this._impl.ValidAlgorithmSuiteInfo(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
}
public void ValidateCommitmentPolicyOnDecrypt(ValidateCommitmentPolicyOnDecryptInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.ValidateCommitmentPolicyOnDecryptInput dafnyValue = ToDafny.ValidateCommitmentPolicyOnDecryptInput(input);
Result<Tuple0, Error> result = this._impl.ValidateCommitmentPolicyOnDecrypt(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
}
public void ValidateCommitmentPolicyOnEncrypt(ValidateCommitmentPolicyOnEncryptInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.ValidateCommitmentPolicyOnEncryptInput dafnyValue = ToDafny.ValidateCommitmentPolicyOnEncryptInput(input);
Result<Tuple0, Error> result = this._impl.ValidateCommitmentPolicyOnEncrypt(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
}
public void ValidDecryptionMaterialsTransition(ValidDecryptionMaterialsTransitionInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.ValidDecryptionMaterialsTransitionInput dafnyValue = ToDafny.ValidDecryptionMaterialsTransitionInput(input);
Result<Tuple0, Error> result = this._impl.ValidDecryptionMaterialsTransition(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
}
public void ValidEncryptionMaterialsTransition(ValidEncryptionMaterialsTransitionInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.ValidEncryptionMaterialsTransitionInput dafnyValue = ToDafny.ValidEncryptionMaterialsTransitionInput(input);
Result<Tuple0, Error> result = this._impl.ValidEncryptionMaterialsTransition(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
}
protected IAwsCryptographicMaterialProvidersClient impl() {
return this._impl;
}
public interface Builder {
Builder MaterialProvidersConfig(MaterialProvidersConfig MaterialProvidersConfig);
MaterialProvidersConfig MaterialProvidersConfig();
MaterialProviders build();
}
static class BuilderImpl implements Builder {
protected MaterialProvidersConfig MaterialProvidersConfig;
protected BuilderImpl() {
}
public Builder MaterialProvidersConfig(MaterialProvidersConfig MaterialProvidersConfig) {
this.MaterialProvidersConfig = MaterialProvidersConfig;
return this;
}
public MaterialProvidersConfig MaterialProvidersConfig() {
return this.MaterialProvidersConfig;
}
public MaterialProviders build() {
if (Objects.isNull(this.MaterialProvidersConfig())) {
throw new IllegalArgumentException("Missing value for required field `MaterialProvidersConfig`");
}
return new MaterialProviders(this);
}
}
}
| 317 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/Keyring.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders;
import Wrappers_Compile.Result;
import java.lang.IllegalArgumentException;
import java.lang.RuntimeException;
import java.util.Objects;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error;
import software.amazon.cryptography.materialproviders.model.OnDecryptInput;
import software.amazon.cryptography.materialproviders.model.OnDecryptOutput;
import software.amazon.cryptography.materialproviders.model.OnEncryptInput;
import software.amazon.cryptography.materialproviders.model.OnEncryptOutput;
public final class Keyring implements IKeyring {
private final software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring _impl;
private Keyring(
software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring iKeyring) {
Objects.requireNonNull(iKeyring, "Missing value for required argument `iKeyring`");
this._impl = iKeyring;
}
public static Keyring wrap(
software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring iKeyring) {
return new Keyring(iKeyring);
}
public static <I extends IKeyring> Keyring wrap(I iKeyring) {
Objects.requireNonNull(iKeyring, "Missing value for required argument `iKeyring`");
if (iKeyring instanceof software.amazon.cryptography.materialproviders.Keyring) {
return ((Keyring) iKeyring);
}
return Keyring.wrap(new NativeWrapper(iKeyring));
}
public software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring impl() {
return this._impl;
}
public OnDecryptOutput OnDecrypt(OnDecryptInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.OnDecryptInput dafnyValue = ToDafny.OnDecryptInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.OnDecryptOutput, Error> result = this._impl.OnDecrypt(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.OnDecryptOutput(result.dtor_value());
}
public OnEncryptOutput OnEncrypt(OnEncryptInput input) {
software.amazon.cryptography.materialproviders.internaldafny.types.OnEncryptInput dafnyValue = ToDafny.OnEncryptInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.OnEncryptOutput, Error> result = this._impl.OnEncrypt(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.OnEncryptOutput(result.dtor_value());
}
protected static final class NativeWrapper implements software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring {
protected final IKeyring _impl;
NativeWrapper(IKeyring nativeImpl) {
if (nativeImpl instanceof Keyring) {
throw new IllegalArgumentException("Recursive wrapping is strictly forbidden.");
}
this._impl = nativeImpl;
}
public Result<software.amazon.cryptography.materialproviders.internaldafny.types.OnDecryptOutput, Error> OnDecrypt(
software.amazon.cryptography.materialproviders.internaldafny.types.OnDecryptInput dafnyInput) {
OnDecryptInput nativeInput = ToNative.OnDecryptInput(dafnyInput);
try {
OnDecryptOutput nativeOutput = this._impl.OnDecrypt(nativeInput);
software.amazon.cryptography.materialproviders.internaldafny.types.OnDecryptOutput dafnyOutput = ToDafny.OnDecryptOutput(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<software.amazon.cryptography.materialproviders.internaldafny.types.OnDecryptOutput, Error> OnDecrypt_k(
software.amazon.cryptography.materialproviders.internaldafny.types.OnDecryptInput dafnyInput) {
throw new RuntimeException("Not supported at this time.");
}
public Result<software.amazon.cryptography.materialproviders.internaldafny.types.OnEncryptOutput, Error> OnEncrypt(
software.amazon.cryptography.materialproviders.internaldafny.types.OnEncryptInput dafnyInput) {
OnEncryptInput nativeInput = ToNative.OnEncryptInput(dafnyInput);
try {
OnEncryptOutput nativeOutput = this._impl.OnEncrypt(nativeInput);
software.amazon.cryptography.materialproviders.internaldafny.types.OnEncryptOutput dafnyOutput = ToDafny.OnEncryptOutput(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<software.amazon.cryptography.materialproviders.internaldafny.types.OnEncryptOutput, Error> OnEncrypt_k(
software.amazon.cryptography.materialproviders.internaldafny.types.OnEncryptInput dafnyInput) {
throw new RuntimeException("Not supported at this time.");
}
}
}
| 318 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/ToDafny.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders;
import Wrappers_Compile.Option;
import dafny.DafnyMap;
import dafny.DafnySequence;
import dafny.TypeDescriptor;
import java.lang.Byte;
import java.lang.Character;
import java.lang.IllegalArgumentException;
import java.lang.Integer;
import java.lang.Long;
import java.lang.RuntimeException;
import java.lang.String;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import software.amazon.cryptography.keystore.internaldafny.types.IKeyStoreClient;
import software.amazon.cryptography.materialproviders.internaldafny.types.AesWrappingAlg;
import software.amazon.cryptography.materialproviders.internaldafny.types.AlgorithmSuiteId;
import software.amazon.cryptography.materialproviders.internaldafny.types.AlgorithmSuiteInfo;
import software.amazon.cryptography.materialproviders.internaldafny.types.CacheType;
import software.amazon.cryptography.materialproviders.internaldafny.types.CommitmentPolicy;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsDiscoveryKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsDiscoveryMultiKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsHierarchicalKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkDiscoveryKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkDiscoveryMultiKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkMultiKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMultiKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsRsaKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateCryptographicMaterialsCacheInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateDefaultClientSupplierInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateDefaultCryptographicMaterialsManagerInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateMultiKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateRawAesKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateRawRsaKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateRequiredEncryptionContextCMMInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.DBEAlgorithmSuiteId;
import software.amazon.cryptography.materialproviders.internaldafny.types.DBECommitmentPolicy;
import software.amazon.cryptography.materialproviders.internaldafny.types.DIRECT__KEY__WRAPPING;
import software.amazon.cryptography.materialproviders.internaldafny.types.DecryptMaterialsInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.DecryptMaterialsOutput;
import software.amazon.cryptography.materialproviders.internaldafny.types.DecryptionMaterials;
import software.amazon.cryptography.materialproviders.internaldafny.types.DefaultCache;
import software.amazon.cryptography.materialproviders.internaldafny.types.DeleteCacheEntryInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.DerivationAlgorithm;
import software.amazon.cryptography.materialproviders.internaldafny.types.DiscoveryFilter;
import software.amazon.cryptography.materialproviders.internaldafny.types.ECDSA;
import software.amazon.cryptography.materialproviders.internaldafny.types.ESDKAlgorithmSuiteId;
import software.amazon.cryptography.materialproviders.internaldafny.types.ESDKCommitmentPolicy;
import software.amazon.cryptography.materialproviders.internaldafny.types.EdkWrappingAlgorithm;
import software.amazon.cryptography.materialproviders.internaldafny.types.Encrypt;
import software.amazon.cryptography.materialproviders.internaldafny.types.EncryptedDataKey;
import software.amazon.cryptography.materialproviders.internaldafny.types.EncryptionMaterials;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_AwsCryptographicMaterialProvidersException;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_EntryAlreadyExists;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_EntryDoesNotExist;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_InvalidAlgorithmSuiteInfo;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_InvalidAlgorithmSuiteInfoOnDecrypt;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_InvalidAlgorithmSuiteInfoOnEncrypt;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_InvalidDecryptionMaterials;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_InvalidDecryptionMaterialsTransition;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_InvalidEncryptionMaterials;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error_InvalidEncryptionMaterialsTransition;
import software.amazon.cryptography.materialproviders.internaldafny.types.GetBranchKeyIdInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.GetBranchKeyIdOutput;
import software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryOutput;
import software.amazon.cryptography.materialproviders.internaldafny.types.GetClientInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.GetEncryptionMaterialsInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.GetEncryptionMaterialsOutput;
import software.amazon.cryptography.materialproviders.internaldafny.types.HKDF;
import software.amazon.cryptography.materialproviders.internaldafny.types.IAwsCryptographicMaterialProvidersClient;
import software.amazon.cryptography.materialproviders.internaldafny.types.IDENTITY;
import software.amazon.cryptography.materialproviders.internaldafny.types.InitializeDecryptionMaterialsInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.InitializeEncryptionMaterialsInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.IntermediateKeyWrapping;
import software.amazon.cryptography.materialproviders.internaldafny.types.MaterialProvidersConfig;
import software.amazon.cryptography.materialproviders.internaldafny.types.Materials;
import software.amazon.cryptography.materialproviders.internaldafny.types.MultiThreadedCache;
import software.amazon.cryptography.materialproviders.internaldafny.types.NoCache;
import software.amazon.cryptography.materialproviders.internaldafny.types.None;
import software.amazon.cryptography.materialproviders.internaldafny.types.OnDecryptInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.OnDecryptOutput;
import software.amazon.cryptography.materialproviders.internaldafny.types.OnEncryptInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.OnEncryptOutput;
import software.amazon.cryptography.materialproviders.internaldafny.types.PaddingScheme;
import software.amazon.cryptography.materialproviders.internaldafny.types.PutCacheEntryInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.SignatureAlgorithm;
import software.amazon.cryptography.materialproviders.internaldafny.types.SingleThreadedCache;
import software.amazon.cryptography.materialproviders.internaldafny.types.StormTrackingCache;
import software.amazon.cryptography.materialproviders.internaldafny.types.SymmetricSignatureAlgorithm;
import software.amazon.cryptography.materialproviders.internaldafny.types.UpdateUsageMetadataInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.ValidDecryptionMaterialsTransitionInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.ValidEncryptionMaterialsTransitionInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.ValidateCommitmentPolicyOnDecryptInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.ValidateCommitmentPolicyOnEncryptInput;
import software.amazon.cryptography.materialproviders.model.AwsCryptographicMaterialProvidersException;
import software.amazon.cryptography.materialproviders.model.CollectionOfErrors;
import software.amazon.cryptography.materialproviders.model.DIRECT_KEY_WRAPPING;
import software.amazon.cryptography.materialproviders.model.EntryAlreadyExists;
import software.amazon.cryptography.materialproviders.model.EntryDoesNotExist;
import software.amazon.cryptography.materialproviders.model.InvalidAlgorithmSuiteInfo;
import software.amazon.cryptography.materialproviders.model.InvalidAlgorithmSuiteInfoOnDecrypt;
import software.amazon.cryptography.materialproviders.model.InvalidAlgorithmSuiteInfoOnEncrypt;
import software.amazon.cryptography.materialproviders.model.InvalidDecryptionMaterials;
import software.amazon.cryptography.materialproviders.model.InvalidDecryptionMaterialsTransition;
import software.amazon.cryptography.materialproviders.model.InvalidEncryptionMaterials;
import software.amazon.cryptography.materialproviders.model.InvalidEncryptionMaterialsTransition;
import software.amazon.cryptography.materialproviders.model.OpaqueError;
import software.amazon.cryptography.primitives.internaldafny.types.DigestAlgorithm;
import software.amazon.cryptography.primitives.internaldafny.types.ECDSASignatureAlgorithm;
import software.amazon.cryptography.services.kms.internaldafny.types.EncryptionAlgorithmSpec;
import software.amazon.cryptography.services.kms.internaldafny.types.IKMSClient;
public class ToDafny {
public static Error Error(RuntimeException nativeValue) {
if (nativeValue instanceof AwsCryptographicMaterialProvidersException) {
return ToDafny.Error((AwsCryptographicMaterialProvidersException) nativeValue);
}
if (nativeValue instanceof EntryAlreadyExists) {
return ToDafny.Error((EntryAlreadyExists) nativeValue);
}
if (nativeValue instanceof EntryDoesNotExist) {
return ToDafny.Error((EntryDoesNotExist) nativeValue);
}
if (nativeValue instanceof InvalidAlgorithmSuiteInfo) {
return ToDafny.Error((InvalidAlgorithmSuiteInfo) nativeValue);
}
if (nativeValue instanceof InvalidAlgorithmSuiteInfoOnDecrypt) {
return ToDafny.Error((InvalidAlgorithmSuiteInfoOnDecrypt) nativeValue);
}
if (nativeValue instanceof InvalidAlgorithmSuiteInfoOnEncrypt) {
return ToDafny.Error((InvalidAlgorithmSuiteInfoOnEncrypt) nativeValue);
}
if (nativeValue instanceof InvalidDecryptionMaterials) {
return ToDafny.Error((InvalidDecryptionMaterials) nativeValue);
}
if (nativeValue instanceof InvalidDecryptionMaterialsTransition) {
return ToDafny.Error((InvalidDecryptionMaterialsTransition) nativeValue);
}
if (nativeValue instanceof InvalidEncryptionMaterials) {
return ToDafny.Error((InvalidEncryptionMaterials) nativeValue);
}
if (nativeValue instanceof InvalidEncryptionMaterialsTransition) {
return ToDafny.Error((InvalidEncryptionMaterialsTransition) nativeValue);
}
if (nativeValue instanceof OpaqueError) {
return ToDafny.Error((OpaqueError) nativeValue);
}
if (nativeValue instanceof CollectionOfErrors) {
return ToDafny.Error((CollectionOfErrors) nativeValue);
}
return Error.create_Opaque(nativeValue);
}
public static Error Error(OpaqueError nativeValue) {
return Error.create_Opaque(nativeValue.obj());
}
public static Error Error(CollectionOfErrors nativeValue) {
DafnySequence<? extends Error> list = software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue.list(),
ToDafny::Error,
Error._typeDescriptor());
DafnySequence<? extends Character> message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage());
return Error.create_CollectionOfErrors(list, message);
}
public static AlgorithmSuiteInfo AlgorithmSuiteInfo(
software.amazon.cryptography.materialproviders.model.AlgorithmSuiteInfo nativeValue) {
AlgorithmSuiteId id;
id = ToDafny.AlgorithmSuiteId(nativeValue.id());
DafnySequence<? extends Byte> binaryId;
binaryId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.binaryId());
Integer messageVersion;
messageVersion = (nativeValue.messageVersion());
Encrypt encrypt;
encrypt = ToDafny.Encrypt(nativeValue.encrypt());
DerivationAlgorithm kdf;
kdf = ToDafny.DerivationAlgorithm(nativeValue.kdf());
DerivationAlgorithm commitment;
commitment = ToDafny.DerivationAlgorithm(nativeValue.commitment());
SignatureAlgorithm signature;
signature = ToDafny.SignatureAlgorithm(nativeValue.signature());
SymmetricSignatureAlgorithm symmetricSignature;
symmetricSignature = ToDafny.SymmetricSignatureAlgorithm(nativeValue.symmetricSignature());
EdkWrappingAlgorithm edkWrapping;
edkWrapping = ToDafny.EdkWrappingAlgorithm(nativeValue.edkWrapping());
return new AlgorithmSuiteInfo(id, binaryId, messageVersion, encrypt, kdf, commitment, signature, symmetricSignature, edkWrapping);
}
public static CreateAwsKmsDiscoveryKeyringInput CreateAwsKmsDiscoveryKeyringInput(
software.amazon.cryptography.materialproviders.model.CreateAwsKmsDiscoveryKeyringInput nativeValue) {
IKMSClient kmsClient;
kmsClient = software.amazon.cryptography.services.kms.internaldafny.ToDafny.TrentService(nativeValue.kmsClient());
Option<DiscoveryFilter> discoveryFilter;
discoveryFilter = Objects.nonNull(nativeValue.discoveryFilter()) ?
Option.create_Some(ToDafny.DiscoveryFilter(nativeValue.discoveryFilter()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
return new CreateAwsKmsDiscoveryKeyringInput(kmsClient, discoveryFilter, grantTokens);
}
public static CreateAwsKmsDiscoveryMultiKeyringInput CreateAwsKmsDiscoveryMultiKeyringInput(
software.amazon.cryptography.materialproviders.model.CreateAwsKmsDiscoveryMultiKeyringInput nativeValue) {
DafnySequence<? extends DafnySequence<? extends Character>> regions;
regions = ToDafny.RegionList(nativeValue.regions());
Option<DiscoveryFilter> discoveryFilter;
discoveryFilter = Objects.nonNull(nativeValue.discoveryFilter()) ?
Option.create_Some(ToDafny.DiscoveryFilter(nativeValue.discoveryFilter()))
: Option.create_None();
Option<software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier> clientSupplier;
clientSupplier = Objects.nonNull(nativeValue.clientSupplier()) ?
Option.create_Some(ToDafny.ClientSupplier(nativeValue.clientSupplier()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
return new CreateAwsKmsDiscoveryMultiKeyringInput(regions, discoveryFilter, clientSupplier, grantTokens);
}
public static CreateAwsKmsHierarchicalKeyringInput CreateAwsKmsHierarchicalKeyringInput(
software.amazon.cryptography.materialproviders.model.CreateAwsKmsHierarchicalKeyringInput nativeValue) {
Option<DafnySequence<? extends Character>> branchKeyId;
branchKeyId = Objects.nonNull(nativeValue.branchKeyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.branchKeyId()))
: Option.create_None();
Option<software.amazon.cryptography.materialproviders.internaldafny.types.IBranchKeyIdSupplier> branchKeyIdSupplier;
branchKeyIdSupplier = Objects.nonNull(nativeValue.branchKeyIdSupplier()) ?
Option.create_Some(ToDafny.BranchKeyIdSupplier(nativeValue.branchKeyIdSupplier()))
: Option.create_None();
IKeyStoreClient keyStore;
keyStore = software.amazon.cryptography.keystore.ToDafny.KeyStore(nativeValue.keyStore());
Long ttlSeconds;
ttlSeconds = (nativeValue.ttlSeconds());
Option<CacheType> cache;
cache = Objects.nonNull(nativeValue.cache()) ?
Option.create_Some(ToDafny.CacheType(nativeValue.cache()))
: Option.create_None();
return new CreateAwsKmsHierarchicalKeyringInput(branchKeyId, branchKeyIdSupplier, keyStore, ttlSeconds, cache);
}
public static CreateAwsKmsKeyringInput CreateAwsKmsKeyringInput(
software.amazon.cryptography.materialproviders.model.CreateAwsKmsKeyringInput nativeValue) {
DafnySequence<? extends Character> kmsKeyId;
kmsKeyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.kmsKeyId());
IKMSClient kmsClient;
kmsClient = software.amazon.cryptography.services.kms.internaldafny.ToDafny.TrentService(nativeValue.kmsClient());
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
return new CreateAwsKmsKeyringInput(kmsKeyId, kmsClient, grantTokens);
}
public static CreateAwsKmsMrkDiscoveryKeyringInput CreateAwsKmsMrkDiscoveryKeyringInput(
software.amazon.cryptography.materialproviders.model.CreateAwsKmsMrkDiscoveryKeyringInput nativeValue) {
IKMSClient kmsClient;
kmsClient = software.amazon.cryptography.services.kms.internaldafny.ToDafny.TrentService(nativeValue.kmsClient());
Option<DiscoveryFilter> discoveryFilter;
discoveryFilter = Objects.nonNull(nativeValue.discoveryFilter()) ?
Option.create_Some(ToDafny.DiscoveryFilter(nativeValue.discoveryFilter()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
DafnySequence<? extends Character> region;
region = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.region());
return new CreateAwsKmsMrkDiscoveryKeyringInput(kmsClient, discoveryFilter, grantTokens, region);
}
public static CreateAwsKmsMrkDiscoveryMultiKeyringInput CreateAwsKmsMrkDiscoveryMultiKeyringInput(
software.amazon.cryptography.materialproviders.model.CreateAwsKmsMrkDiscoveryMultiKeyringInput nativeValue) {
DafnySequence<? extends DafnySequence<? extends Character>> regions;
regions = ToDafny.RegionList(nativeValue.regions());
Option<DiscoveryFilter> discoveryFilter;
discoveryFilter = Objects.nonNull(nativeValue.discoveryFilter()) ?
Option.create_Some(ToDafny.DiscoveryFilter(nativeValue.discoveryFilter()))
: Option.create_None();
Option<software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier> clientSupplier;
clientSupplier = Objects.nonNull(nativeValue.clientSupplier()) ?
Option.create_Some(ToDafny.ClientSupplier(nativeValue.clientSupplier()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
return new CreateAwsKmsMrkDiscoveryMultiKeyringInput(regions, discoveryFilter, clientSupplier, grantTokens);
}
public static CreateAwsKmsMrkKeyringInput CreateAwsKmsMrkKeyringInput(
software.amazon.cryptography.materialproviders.model.CreateAwsKmsMrkKeyringInput nativeValue) {
DafnySequence<? extends Character> kmsKeyId;
kmsKeyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.kmsKeyId());
IKMSClient kmsClient;
kmsClient = software.amazon.cryptography.services.kms.internaldafny.ToDafny.TrentService(nativeValue.kmsClient());
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
return new CreateAwsKmsMrkKeyringInput(kmsKeyId, kmsClient, grantTokens);
}
public static CreateAwsKmsMrkMultiKeyringInput CreateAwsKmsMrkMultiKeyringInput(
software.amazon.cryptography.materialproviders.model.CreateAwsKmsMrkMultiKeyringInput nativeValue) {
Option<DafnySequence<? extends Character>> generator;
generator = Objects.nonNull(nativeValue.generator()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.generator()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> kmsKeyIds;
kmsKeyIds = (Objects.nonNull(nativeValue.kmsKeyIds()) && nativeValue.kmsKeyIds().size() > 0) ?
Option.create_Some(ToDafny.KmsKeyIdList(nativeValue.kmsKeyIds()))
: Option.create_None();
Option<software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier> clientSupplier;
clientSupplier = Objects.nonNull(nativeValue.clientSupplier()) ?
Option.create_Some(ToDafny.ClientSupplier(nativeValue.clientSupplier()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
return new CreateAwsKmsMrkMultiKeyringInput(generator, kmsKeyIds, clientSupplier, grantTokens);
}
public static CreateAwsKmsMultiKeyringInput CreateAwsKmsMultiKeyringInput(
software.amazon.cryptography.materialproviders.model.CreateAwsKmsMultiKeyringInput nativeValue) {
Option<DafnySequence<? extends Character>> generator;
generator = Objects.nonNull(nativeValue.generator()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.generator()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> kmsKeyIds;
kmsKeyIds = (Objects.nonNull(nativeValue.kmsKeyIds()) && nativeValue.kmsKeyIds().size() > 0) ?
Option.create_Some(ToDafny.KmsKeyIdList(nativeValue.kmsKeyIds()))
: Option.create_None();
Option<software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier> clientSupplier;
clientSupplier = Objects.nonNull(nativeValue.clientSupplier()) ?
Option.create_Some(ToDafny.ClientSupplier(nativeValue.clientSupplier()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
return new CreateAwsKmsMultiKeyringInput(generator, kmsKeyIds, clientSupplier, grantTokens);
}
public static CreateAwsKmsRsaKeyringInput CreateAwsKmsRsaKeyringInput(
software.amazon.cryptography.materialproviders.model.CreateAwsKmsRsaKeyringInput nativeValue) {
Option<DafnySequence<? extends Byte>> publicKey;
publicKey = Objects.nonNull(nativeValue.publicKey()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.publicKey()))
: Option.create_None();
DafnySequence<? extends Character> kmsKeyId;
kmsKeyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.kmsKeyId());
EncryptionAlgorithmSpec encryptionAlgorithm;
encryptionAlgorithm = software.amazon.cryptography.services.kms.internaldafny.ToDafny.EncryptionAlgorithmSpec(nativeValue.encryptionAlgorithm());
Option<IKMSClient> kmsClient;
kmsClient = Objects.nonNull(nativeValue.kmsClient()) ?
Option.create_Some(software.amazon.cryptography.services.kms.internaldafny.ToDafny.TrentService(nativeValue.kmsClient()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
return new CreateAwsKmsRsaKeyringInput(publicKey, kmsKeyId, encryptionAlgorithm, kmsClient, grantTokens);
}
public static CreateCryptographicMaterialsCacheInput CreateCryptographicMaterialsCacheInput(
software.amazon.cryptography.materialproviders.model.CreateCryptographicMaterialsCacheInput nativeValue) {
CacheType cache;
cache = ToDafny.CacheType(nativeValue.cache());
return new CreateCryptographicMaterialsCacheInput(cache);
}
public static CreateDefaultClientSupplierInput CreateDefaultClientSupplierInput(
software.amazon.cryptography.materialproviders.model.CreateDefaultClientSupplierInput nativeValue) {
return new CreateDefaultClientSupplierInput();
}
public static CreateDefaultCryptographicMaterialsManagerInput CreateDefaultCryptographicMaterialsManagerInput(
software.amazon.cryptography.materialproviders.model.CreateDefaultCryptographicMaterialsManagerInput nativeValue) {
software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring keyring;
keyring = ToDafny.Keyring(nativeValue.keyring());
return new CreateDefaultCryptographicMaterialsManagerInput(keyring);
}
public static CreateMultiKeyringInput CreateMultiKeyringInput(
software.amazon.cryptography.materialproviders.model.CreateMultiKeyringInput nativeValue) {
Option<software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring> generator;
generator = Objects.nonNull(nativeValue.generator()) ?
Option.create_Some(ToDafny.Keyring(nativeValue.generator()))
: Option.create_None();
DafnySequence<? extends software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring> childKeyrings;
childKeyrings = ToDafny.KeyringList(nativeValue.childKeyrings());
return new CreateMultiKeyringInput(generator, childKeyrings);
}
public static CreateRawAesKeyringInput CreateRawAesKeyringInput(
software.amazon.cryptography.materialproviders.model.CreateRawAesKeyringInput nativeValue) {
DafnySequence<? extends Character> keyNamespace;
keyNamespace = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyNamespace());
DafnySequence<? extends Character> keyName;
keyName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyName());
DafnySequence<? extends Byte> wrappingKey;
wrappingKey = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.wrappingKey());
AesWrappingAlg wrappingAlg;
wrappingAlg = ToDafny.AesWrappingAlg(nativeValue.wrappingAlg());
return new CreateRawAesKeyringInput(keyNamespace, keyName, wrappingKey, wrappingAlg);
}
public static CreateRawRsaKeyringInput CreateRawRsaKeyringInput(
software.amazon.cryptography.materialproviders.model.CreateRawRsaKeyringInput nativeValue) {
DafnySequence<? extends Character> keyNamespace;
keyNamespace = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyNamespace());
DafnySequence<? extends Character> keyName;
keyName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyName());
PaddingScheme paddingScheme;
paddingScheme = ToDafny.PaddingScheme(nativeValue.paddingScheme());
Option<DafnySequence<? extends Byte>> publicKey;
publicKey = Objects.nonNull(nativeValue.publicKey()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.publicKey()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> privateKey;
privateKey = Objects.nonNull(nativeValue.privateKey()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.privateKey()))
: Option.create_None();
return new CreateRawRsaKeyringInput(keyNamespace, keyName, paddingScheme, publicKey, privateKey);
}
public static CreateRequiredEncryptionContextCMMInput CreateRequiredEncryptionContextCMMInput(
software.amazon.cryptography.materialproviders.model.CreateRequiredEncryptionContextCMMInput nativeValue) {
Option<software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsManager> underlyingCMM;
underlyingCMM = Objects.nonNull(nativeValue.underlyingCMM()) ?
Option.create_Some(ToDafny.CryptographicMaterialsManager(nativeValue.underlyingCMM()))
: Option.create_None();
Option<software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring> keyring;
keyring = Objects.nonNull(nativeValue.keyring()) ?
Option.create_Some(ToDafny.Keyring(nativeValue.keyring()))
: Option.create_None();
DafnySequence<? extends DafnySequence<? extends Byte>> requiredEncryptionContextKeys;
requiredEncryptionContextKeys = ToDafny.EncryptionContextKeys(nativeValue.requiredEncryptionContextKeys());
return new CreateRequiredEncryptionContextCMMInput(underlyingCMM, keyring, requiredEncryptionContextKeys);
}
public static DecryptionMaterials DecryptionMaterials(
software.amazon.cryptography.materialproviders.model.DecryptionMaterials nativeValue) {
AlgorithmSuiteInfo algorithmSuite;
algorithmSuite = ToDafny.AlgorithmSuiteInfo(nativeValue.algorithmSuite());
DafnyMap<? extends DafnySequence<? extends Byte>, ? extends DafnySequence<? extends Byte>> encryptionContext;
encryptionContext = ToDafny.EncryptionContext(nativeValue.encryptionContext());
DafnySequence<? extends DafnySequence<? extends Byte>> requiredEncryptionContextKeys;
requiredEncryptionContextKeys = ToDafny.EncryptionContextKeys(nativeValue.requiredEncryptionContextKeys());
Option<DafnySequence<? extends Byte>> plaintextDataKey;
plaintextDataKey = Objects.nonNull(nativeValue.plaintextDataKey()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.plaintextDataKey()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> verificationKey;
verificationKey = Objects.nonNull(nativeValue.verificationKey()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.verificationKey()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> symmetricSigningKey;
symmetricSigningKey = Objects.nonNull(nativeValue.symmetricSigningKey()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.symmetricSigningKey()))
: Option.create_None();
return new DecryptionMaterials(algorithmSuite, encryptionContext, requiredEncryptionContextKeys, plaintextDataKey, verificationKey, symmetricSigningKey);
}
public static DecryptMaterialsInput DecryptMaterialsInput(
software.amazon.cryptography.materialproviders.model.DecryptMaterialsInput nativeValue) {
AlgorithmSuiteId algorithmSuiteId;
algorithmSuiteId = ToDafny.AlgorithmSuiteId(nativeValue.algorithmSuiteId());
CommitmentPolicy commitmentPolicy;
commitmentPolicy = ToDafny.CommitmentPolicy(nativeValue.commitmentPolicy());
DafnySequence<? extends EncryptedDataKey> encryptedDataKeys;
encryptedDataKeys = ToDafny.EncryptedDataKeyList(nativeValue.encryptedDataKeys());
DafnyMap<? extends DafnySequence<? extends Byte>, ? extends DafnySequence<? extends Byte>> encryptionContext;
encryptionContext = ToDafny.EncryptionContext(nativeValue.encryptionContext());
Option<DafnyMap<? extends DafnySequence<? extends Byte>, ? extends DafnySequence<? extends Byte>>> reproducedEncryptionContext;
reproducedEncryptionContext = (Objects.nonNull(nativeValue.reproducedEncryptionContext()) && nativeValue.reproducedEncryptionContext().size() > 0) ?
Option.create_Some(ToDafny.EncryptionContext(nativeValue.reproducedEncryptionContext()))
: Option.create_None();
return new DecryptMaterialsInput(algorithmSuiteId, commitmentPolicy, encryptedDataKeys, encryptionContext, reproducedEncryptionContext);
}
public static DecryptMaterialsOutput DecryptMaterialsOutput(
software.amazon.cryptography.materialproviders.model.DecryptMaterialsOutput nativeValue) {
DecryptionMaterials decryptionMaterials;
decryptionMaterials = ToDafny.DecryptionMaterials(nativeValue.decryptionMaterials());
return new DecryptMaterialsOutput(decryptionMaterials);
}
public static DefaultCache DefaultCache(
software.amazon.cryptography.materialproviders.model.DefaultCache nativeValue) {
Integer entryCapacity;
entryCapacity = (nativeValue.entryCapacity());
return new DefaultCache(entryCapacity);
}
public static DeleteCacheEntryInput DeleteCacheEntryInput(
software.amazon.cryptography.materialproviders.model.DeleteCacheEntryInput nativeValue) {
DafnySequence<? extends Byte> identifier;
identifier = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.identifier());
return new DeleteCacheEntryInput(identifier);
}
public static DIRECT__KEY__WRAPPING DIRECT_KEY_WRAPPING(DIRECT_KEY_WRAPPING nativeValue) {
return new DIRECT__KEY__WRAPPING();
}
public static DiscoveryFilter DiscoveryFilter(
software.amazon.cryptography.materialproviders.model.DiscoveryFilter nativeValue) {
DafnySequence<? extends DafnySequence<? extends Character>> accountIds;
accountIds = ToDafny.AccountIdList(nativeValue.accountIds());
DafnySequence<? extends Character> partition;
partition = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.partition());
return new DiscoveryFilter(accountIds, partition);
}
public static ECDSA ECDSA(
software.amazon.cryptography.materialproviders.model.ECDSA nativeValue) {
ECDSASignatureAlgorithm curve;
curve = software.amazon.cryptography.primitives.ToDafny.ECDSASignatureAlgorithm(nativeValue.curve());
return new ECDSA(curve);
}
public static EncryptedDataKey EncryptedDataKey(
software.amazon.cryptography.materialproviders.model.EncryptedDataKey nativeValue) {
DafnySequence<? extends Byte> keyProviderId;
keyProviderId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.DafnyUtf8Bytes(nativeValue.keyProviderId());
DafnySequence<? extends Byte> keyProviderInfo;
keyProviderInfo = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.keyProviderInfo());
DafnySequence<? extends Byte> ciphertext;
ciphertext = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.ciphertext());
return new EncryptedDataKey(keyProviderId, keyProviderInfo, ciphertext);
}
public static EncryptionMaterials EncryptionMaterials(
software.amazon.cryptography.materialproviders.model.EncryptionMaterials nativeValue) {
AlgorithmSuiteInfo algorithmSuite;
algorithmSuite = ToDafny.AlgorithmSuiteInfo(nativeValue.algorithmSuite());
DafnyMap<? extends DafnySequence<? extends Byte>, ? extends DafnySequence<? extends Byte>> encryptionContext;
encryptionContext = ToDafny.EncryptionContext(nativeValue.encryptionContext());
DafnySequence<? extends EncryptedDataKey> encryptedDataKeys;
encryptedDataKeys = ToDafny.EncryptedDataKeyList(nativeValue.encryptedDataKeys());
DafnySequence<? extends DafnySequence<? extends Byte>> requiredEncryptionContextKeys;
requiredEncryptionContextKeys = ToDafny.EncryptionContextKeys(nativeValue.requiredEncryptionContextKeys());
Option<DafnySequence<? extends Byte>> plaintextDataKey;
plaintextDataKey = Objects.nonNull(nativeValue.plaintextDataKey()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.plaintextDataKey()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> signingKey;
signingKey = Objects.nonNull(nativeValue.signingKey()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.signingKey()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Byte>>> symmetricSigningKeys;
symmetricSigningKeys = (Objects.nonNull(nativeValue.symmetricSigningKeys()) && nativeValue.symmetricSigningKeys().size() > 0) ?
Option.create_Some(ToDafny.SymmetricSigningKeyList(nativeValue.symmetricSigningKeys()))
: Option.create_None();
return new EncryptionMaterials(algorithmSuite, encryptionContext, encryptedDataKeys, requiredEncryptionContextKeys, plaintextDataKey, signingKey, symmetricSigningKeys);
}
public static DafnySequence<? extends Byte> GetAlgorithmSuiteInfoInput(ByteBuffer nativeValue) {
DafnySequence<? extends Byte> binaryId;
binaryId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue);
return binaryId;
}
public static GetBranchKeyIdInput GetBranchKeyIdInput(
software.amazon.cryptography.materialproviders.model.GetBranchKeyIdInput nativeValue) {
DafnyMap<? extends DafnySequence<? extends Byte>, ? extends DafnySequence<? extends Byte>> encryptionContext;
encryptionContext = ToDafny.EncryptionContext(nativeValue.encryptionContext());
return new GetBranchKeyIdInput(encryptionContext);
}
public static GetBranchKeyIdOutput GetBranchKeyIdOutput(
software.amazon.cryptography.materialproviders.model.GetBranchKeyIdOutput nativeValue) {
DafnySequence<? extends Character> branchKeyId;
branchKeyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.branchKeyId());
return new GetBranchKeyIdOutput(branchKeyId);
}
public static GetCacheEntryInput GetCacheEntryInput(
software.amazon.cryptography.materialproviders.model.GetCacheEntryInput nativeValue) {
DafnySequence<? extends Byte> identifier;
identifier = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.identifier());
Option<Long> bytesUsed;
bytesUsed = Objects.nonNull(nativeValue.bytesUsed()) ?
Option.create_Some((nativeValue.bytesUsed()))
: Option.create_None();
return new GetCacheEntryInput(identifier, bytesUsed);
}
public static GetCacheEntryOutput GetCacheEntryOutput(
software.amazon.cryptography.materialproviders.model.GetCacheEntryOutput nativeValue) {
Materials materials;
materials = ToDafny.Materials(nativeValue.materials());
Long creationTime;
creationTime = (nativeValue.creationTime());
Long expiryTime;
expiryTime = (nativeValue.expiryTime());
Integer messagesUsed;
messagesUsed = (nativeValue.messagesUsed());
Integer bytesUsed;
bytesUsed = (nativeValue.bytesUsed());
return new GetCacheEntryOutput(materials, creationTime, expiryTime, messagesUsed, bytesUsed);
}
public static GetClientInput GetClientInput(
software.amazon.cryptography.materialproviders.model.GetClientInput nativeValue) {
DafnySequence<? extends Character> region;
region = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.region());
return new GetClientInput(region);
}
public static GetEncryptionMaterialsInput GetEncryptionMaterialsInput(
software.amazon.cryptography.materialproviders.model.GetEncryptionMaterialsInput nativeValue) {
DafnyMap<? extends DafnySequence<? extends Byte>, ? extends DafnySequence<? extends Byte>> encryptionContext;
encryptionContext = ToDafny.EncryptionContext(nativeValue.encryptionContext());
CommitmentPolicy commitmentPolicy;
commitmentPolicy = ToDafny.CommitmentPolicy(nativeValue.commitmentPolicy());
Option<AlgorithmSuiteId> algorithmSuiteId;
algorithmSuiteId = Objects.nonNull(nativeValue.algorithmSuiteId()) ?
Option.create_Some(ToDafny.AlgorithmSuiteId(nativeValue.algorithmSuiteId()))
: Option.create_None();
Option<Long> maxPlaintextLength;
maxPlaintextLength = Objects.nonNull(nativeValue.maxPlaintextLength()) ?
Option.create_Some((nativeValue.maxPlaintextLength()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Byte>>> requiredEncryptionContextKeys;
requiredEncryptionContextKeys = (Objects.nonNull(nativeValue.requiredEncryptionContextKeys()) && nativeValue.requiredEncryptionContextKeys().size() > 0) ?
Option.create_Some(ToDafny.EncryptionContextKeys(nativeValue.requiredEncryptionContextKeys()))
: Option.create_None();
return new GetEncryptionMaterialsInput(encryptionContext, commitmentPolicy, algorithmSuiteId, maxPlaintextLength, requiredEncryptionContextKeys);
}
public static GetEncryptionMaterialsOutput GetEncryptionMaterialsOutput(
software.amazon.cryptography.materialproviders.model.GetEncryptionMaterialsOutput nativeValue) {
EncryptionMaterials encryptionMaterials;
encryptionMaterials = ToDafny.EncryptionMaterials(nativeValue.encryptionMaterials());
return new GetEncryptionMaterialsOutput(encryptionMaterials);
}
public static HKDF HKDF(software.amazon.cryptography.materialproviders.model.HKDF nativeValue) {
DigestAlgorithm hmac;
hmac = software.amazon.cryptography.primitives.ToDafny.DigestAlgorithm(nativeValue.hmac());
Integer saltLength;
saltLength = (nativeValue.saltLength());
Integer inputKeyLength;
inputKeyLength = (nativeValue.inputKeyLength());
Integer outputKeyLength;
outputKeyLength = (nativeValue.outputKeyLength());
return new HKDF(hmac, saltLength, inputKeyLength, outputKeyLength);
}
public static IDENTITY IDENTITY(
software.amazon.cryptography.materialproviders.model.IDENTITY nativeValue) {
return new IDENTITY();
}
public static InitializeDecryptionMaterialsInput InitializeDecryptionMaterialsInput(
software.amazon.cryptography.materialproviders.model.InitializeDecryptionMaterialsInput nativeValue) {
AlgorithmSuiteId algorithmSuiteId;
algorithmSuiteId = ToDafny.AlgorithmSuiteId(nativeValue.algorithmSuiteId());
DafnyMap<? extends DafnySequence<? extends Byte>, ? extends DafnySequence<? extends Byte>> encryptionContext;
encryptionContext = ToDafny.EncryptionContext(nativeValue.encryptionContext());
DafnySequence<? extends DafnySequence<? extends Byte>> requiredEncryptionContextKeys;
requiredEncryptionContextKeys = ToDafny.EncryptionContextKeys(nativeValue.requiredEncryptionContextKeys());
return new InitializeDecryptionMaterialsInput(algorithmSuiteId, encryptionContext, requiredEncryptionContextKeys);
}
public static InitializeEncryptionMaterialsInput InitializeEncryptionMaterialsInput(
software.amazon.cryptography.materialproviders.model.InitializeEncryptionMaterialsInput nativeValue) {
AlgorithmSuiteId algorithmSuiteId;
algorithmSuiteId = ToDafny.AlgorithmSuiteId(nativeValue.algorithmSuiteId());
DafnyMap<? extends DafnySequence<? extends Byte>, ? extends DafnySequence<? extends Byte>> encryptionContext;
encryptionContext = ToDafny.EncryptionContext(nativeValue.encryptionContext());
DafnySequence<? extends DafnySequence<? extends Byte>> requiredEncryptionContextKeys;
requiredEncryptionContextKeys = ToDafny.EncryptionContextKeys(nativeValue.requiredEncryptionContextKeys());
Option<DafnySequence<? extends Byte>> signingKey;
signingKey = Objects.nonNull(nativeValue.signingKey()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.signingKey()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> verificationKey;
verificationKey = Objects.nonNull(nativeValue.verificationKey()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.verificationKey()))
: Option.create_None();
return new InitializeEncryptionMaterialsInput(algorithmSuiteId, encryptionContext, requiredEncryptionContextKeys, signingKey, verificationKey);
}
public static IntermediateKeyWrapping IntermediateKeyWrapping(
software.amazon.cryptography.materialproviders.model.IntermediateKeyWrapping nativeValue) {
DerivationAlgorithm keyEncryptionKeyKdf;
keyEncryptionKeyKdf = ToDafny.DerivationAlgorithm(nativeValue.keyEncryptionKeyKdf());
DerivationAlgorithm macKeyKdf;
macKeyKdf = ToDafny.DerivationAlgorithm(nativeValue.macKeyKdf());
Encrypt pdkEncryptAlgorithm;
pdkEncryptAlgorithm = ToDafny.Encrypt(nativeValue.pdkEncryptAlgorithm());
return new IntermediateKeyWrapping(keyEncryptionKeyKdf, macKeyKdf, pdkEncryptAlgorithm);
}
public static MaterialProvidersConfig MaterialProvidersConfig(
software.amazon.cryptography.materialproviders.model.MaterialProvidersConfig nativeValue) {
return new MaterialProvidersConfig();
}
public static MultiThreadedCache MultiThreadedCache(
software.amazon.cryptography.materialproviders.model.MultiThreadedCache nativeValue) {
Integer entryCapacity;
entryCapacity = (nativeValue.entryCapacity());
Option<Integer> entryPruningTailSize;
entryPruningTailSize = Objects.nonNull(nativeValue.entryPruningTailSize()) ?
Option.create_Some((nativeValue.entryPruningTailSize()))
: Option.create_None();
return new MultiThreadedCache(entryCapacity, entryPruningTailSize);
}
public static NoCache NoCache(
software.amazon.cryptography.materialproviders.model.NoCache nativeValue) {
return new NoCache();
}
public static None None(software.amazon.cryptography.materialproviders.model.None nativeValue) {
return new None();
}
public static OnDecryptInput OnDecryptInput(
software.amazon.cryptography.materialproviders.model.OnDecryptInput nativeValue) {
DecryptionMaterials materials;
materials = ToDafny.DecryptionMaterials(nativeValue.materials());
DafnySequence<? extends EncryptedDataKey> encryptedDataKeys;
encryptedDataKeys = ToDafny.EncryptedDataKeyList(nativeValue.encryptedDataKeys());
return new OnDecryptInput(materials, encryptedDataKeys);
}
public static OnDecryptOutput OnDecryptOutput(
software.amazon.cryptography.materialproviders.model.OnDecryptOutput nativeValue) {
DecryptionMaterials materials;
materials = ToDafny.DecryptionMaterials(nativeValue.materials());
return new OnDecryptOutput(materials);
}
public static OnEncryptInput OnEncryptInput(
software.amazon.cryptography.materialproviders.model.OnEncryptInput nativeValue) {
EncryptionMaterials materials;
materials = ToDafny.EncryptionMaterials(nativeValue.materials());
return new OnEncryptInput(materials);
}
public static OnEncryptOutput OnEncryptOutput(
software.amazon.cryptography.materialproviders.model.OnEncryptOutput nativeValue) {
EncryptionMaterials materials;
materials = ToDafny.EncryptionMaterials(nativeValue.materials());
return new OnEncryptOutput(materials);
}
public static PutCacheEntryInput PutCacheEntryInput(
software.amazon.cryptography.materialproviders.model.PutCacheEntryInput nativeValue) {
DafnySequence<? extends Byte> identifier;
identifier = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.identifier());
Materials materials;
materials = ToDafny.Materials(nativeValue.materials());
Long creationTime;
creationTime = (nativeValue.creationTime());
Long expiryTime;
expiryTime = (nativeValue.expiryTime());
Option<Integer> messagesUsed;
messagesUsed = Objects.nonNull(nativeValue.messagesUsed()) ?
Option.create_Some((nativeValue.messagesUsed()))
: Option.create_None();
Option<Integer> bytesUsed;
bytesUsed = Objects.nonNull(nativeValue.bytesUsed()) ?
Option.create_Some((nativeValue.bytesUsed()))
: Option.create_None();
return new PutCacheEntryInput(identifier, materials, creationTime, expiryTime, messagesUsed, bytesUsed);
}
public static SingleThreadedCache SingleThreadedCache(
software.amazon.cryptography.materialproviders.model.SingleThreadedCache nativeValue) {
Integer entryCapacity;
entryCapacity = (nativeValue.entryCapacity());
Option<Integer> entryPruningTailSize;
entryPruningTailSize = Objects.nonNull(nativeValue.entryPruningTailSize()) ?
Option.create_Some((nativeValue.entryPruningTailSize()))
: Option.create_None();
return new SingleThreadedCache(entryCapacity, entryPruningTailSize);
}
public static StormTrackingCache StormTrackingCache(
software.amazon.cryptography.materialproviders.model.StormTrackingCache nativeValue) {
Integer entryCapacity;
entryCapacity = (nativeValue.entryCapacity());
Option<Integer> entryPruningTailSize;
entryPruningTailSize = Objects.nonNull(nativeValue.entryPruningTailSize()) ?
Option.create_Some((nativeValue.entryPruningTailSize()))
: Option.create_None();
Integer gracePeriod;
gracePeriod = (nativeValue.gracePeriod());
Integer graceInterval;
graceInterval = (nativeValue.graceInterval());
Integer fanOut;
fanOut = (nativeValue.fanOut());
Integer inFlightTTL;
inFlightTTL = (nativeValue.inFlightTTL());
Integer sleepMilli;
sleepMilli = (nativeValue.sleepMilli());
return new StormTrackingCache(entryCapacity, entryPruningTailSize, gracePeriod, graceInterval, fanOut, inFlightTTL, sleepMilli);
}
public static UpdateUsageMetadataInput UpdateUsageMetadataInput(
software.amazon.cryptography.materialproviders.model.UpdateUsageMetadataInput nativeValue) {
DafnySequence<? extends Byte> identifier;
identifier = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.identifier());
Integer bytesUsed;
bytesUsed = (nativeValue.bytesUsed());
return new UpdateUsageMetadataInput(identifier, bytesUsed);
}
public static ValidateCommitmentPolicyOnDecryptInput ValidateCommitmentPolicyOnDecryptInput(
software.amazon.cryptography.materialproviders.model.ValidateCommitmentPolicyOnDecryptInput nativeValue) {
AlgorithmSuiteId algorithm;
algorithm = ToDafny.AlgorithmSuiteId(nativeValue.algorithm());
CommitmentPolicy commitmentPolicy;
commitmentPolicy = ToDafny.CommitmentPolicy(nativeValue.commitmentPolicy());
return new ValidateCommitmentPolicyOnDecryptInput(algorithm, commitmentPolicy);
}
public static ValidateCommitmentPolicyOnEncryptInput ValidateCommitmentPolicyOnEncryptInput(
software.amazon.cryptography.materialproviders.model.ValidateCommitmentPolicyOnEncryptInput nativeValue) {
AlgorithmSuiteId algorithm;
algorithm = ToDafny.AlgorithmSuiteId(nativeValue.algorithm());
CommitmentPolicy commitmentPolicy;
commitmentPolicy = ToDafny.CommitmentPolicy(nativeValue.commitmentPolicy());
return new ValidateCommitmentPolicyOnEncryptInput(algorithm, commitmentPolicy);
}
public static ValidDecryptionMaterialsTransitionInput ValidDecryptionMaterialsTransitionInput(
software.amazon.cryptography.materialproviders.model.ValidDecryptionMaterialsTransitionInput nativeValue) {
DecryptionMaterials start;
start = ToDafny.DecryptionMaterials(nativeValue.start());
DecryptionMaterials stop;
stop = ToDafny.DecryptionMaterials(nativeValue.stop());
return new ValidDecryptionMaterialsTransitionInput(start, stop);
}
public static ValidEncryptionMaterialsTransitionInput ValidEncryptionMaterialsTransitionInput(
software.amazon.cryptography.materialproviders.model.ValidEncryptionMaterialsTransitionInput nativeValue) {
EncryptionMaterials start;
start = ToDafny.EncryptionMaterials(nativeValue.start());
EncryptionMaterials stop;
stop = ToDafny.EncryptionMaterials(nativeValue.stop());
return new ValidEncryptionMaterialsTransitionInput(start, stop);
}
public static Error Error(AwsCryptographicMaterialProvidersException nativeValue) {
DafnySequence<? extends Character> message;
message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message());
return new Error_AwsCryptographicMaterialProvidersException(message);
}
public static Error Error(EntryAlreadyExists nativeValue) {
DafnySequence<? extends Character> message;
message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message());
return new Error_EntryAlreadyExists(message);
}
public static Error Error(EntryDoesNotExist nativeValue) {
DafnySequence<? extends Character> message;
message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message());
return new Error_EntryDoesNotExist(message);
}
public static Error Error(InvalidAlgorithmSuiteInfo nativeValue) {
DafnySequence<? extends Character> message;
message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message());
return new Error_InvalidAlgorithmSuiteInfo(message);
}
public static Error Error(InvalidAlgorithmSuiteInfoOnDecrypt nativeValue) {
DafnySequence<? extends Character> message;
message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message());
return new Error_InvalidAlgorithmSuiteInfoOnDecrypt(message);
}
public static Error Error(InvalidAlgorithmSuiteInfoOnEncrypt nativeValue) {
DafnySequence<? extends Character> message;
message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message());
return new Error_InvalidAlgorithmSuiteInfoOnEncrypt(message);
}
public static Error Error(InvalidDecryptionMaterials nativeValue) {
DafnySequence<? extends Character> message;
message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message());
return new Error_InvalidDecryptionMaterials(message);
}
public static Error Error(InvalidDecryptionMaterialsTransition nativeValue) {
DafnySequence<? extends Character> message;
message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message());
return new Error_InvalidDecryptionMaterialsTransition(message);
}
public static Error Error(InvalidEncryptionMaterials nativeValue) {
DafnySequence<? extends Character> message;
message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message());
return new Error_InvalidEncryptionMaterials(message);
}
public static Error Error(InvalidEncryptionMaterialsTransition nativeValue) {
DafnySequence<? extends Character> message;
message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message());
return new Error_InvalidEncryptionMaterialsTransition(message);
}
public static AesWrappingAlg AesWrappingAlg(
software.amazon.cryptography.materialproviders.model.AesWrappingAlg nativeValue) {
switch (nativeValue) {
case ALG_AES128_GCM_IV12_TAG16: {
return AesWrappingAlg.create_ALG__AES128__GCM__IV12__TAG16();
}
case ALG_AES192_GCM_IV12_TAG16: {
return AesWrappingAlg.create_ALG__AES192__GCM__IV12__TAG16();
}
case ALG_AES256_GCM_IV12_TAG16: {
return AesWrappingAlg.create_ALG__AES256__GCM__IV12__TAG16();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.materialproviders.internaldafny.types.AesWrappingAlg.");
}
}
}
public static DBEAlgorithmSuiteId DBEAlgorithmSuiteId(
software.amazon.cryptography.materialproviders.model.DBEAlgorithmSuiteId nativeValue) {
switch (nativeValue) {
case ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384: {
return DBEAlgorithmSuiteId.create_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__SYMSIG__HMAC__SHA384();
}
case ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384_SYMSIG_HMAC_SHA384: {
return DBEAlgorithmSuiteId.create_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__ECDSA__P384__SYMSIG__HMAC__SHA384();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.materialproviders.internaldafny.types.DBEAlgorithmSuiteId.");
}
}
}
public static DBECommitmentPolicy DBECommitmentPolicy(
software.amazon.cryptography.materialproviders.model.DBECommitmentPolicy nativeValue) {
switch (nativeValue) {
case REQUIRE_ENCRYPT_REQUIRE_DECRYPT: {
return DBECommitmentPolicy.create();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.materialproviders.internaldafny.types.DBECommitmentPolicy.");
}
}
}
public static ESDKAlgorithmSuiteId ESDKAlgorithmSuiteId(
software.amazon.cryptography.materialproviders.model.ESDKAlgorithmSuiteId nativeValue) {
switch (nativeValue) {
case ALG_AES_128_GCM_IV12_TAG16_NO_KDF: {
return ESDKAlgorithmSuiteId.create_ALG__AES__128__GCM__IV12__TAG16__NO__KDF();
}
case ALG_AES_192_GCM_IV12_TAG16_NO_KDF: {
return ESDKAlgorithmSuiteId.create_ALG__AES__192__GCM__IV12__TAG16__NO__KDF();
}
case ALG_AES_256_GCM_IV12_TAG16_NO_KDF: {
return ESDKAlgorithmSuiteId.create_ALG__AES__256__GCM__IV12__TAG16__NO__KDF();
}
case ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256: {
return ESDKAlgorithmSuiteId.create_ALG__AES__128__GCM__IV12__TAG16__HKDF__SHA256();
}
case ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA256: {
return ESDKAlgorithmSuiteId.create_ALG__AES__192__GCM__IV12__TAG16__HKDF__SHA256();
}
case ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA256: {
return ESDKAlgorithmSuiteId.create_ALG__AES__256__GCM__IV12__TAG16__HKDF__SHA256();
}
case ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256: {
return ESDKAlgorithmSuiteId.create_ALG__AES__128__GCM__IV12__TAG16__HKDF__SHA256__ECDSA__P256();
}
case ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384: {
return ESDKAlgorithmSuiteId.create_ALG__AES__192__GCM__IV12__TAG16__HKDF__SHA384__ECDSA__P384();
}
case ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384: {
return ESDKAlgorithmSuiteId.create_ALG__AES__256__GCM__IV12__TAG16__HKDF__SHA384__ECDSA__P384();
}
case ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY: {
return ESDKAlgorithmSuiteId.create_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY();
}
case ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384: {
return ESDKAlgorithmSuiteId.create_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__ECDSA__P384();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.materialproviders.internaldafny.types.ESDKAlgorithmSuiteId.");
}
}
}
public static ESDKCommitmentPolicy ESDKCommitmentPolicy(
software.amazon.cryptography.materialproviders.model.ESDKCommitmentPolicy nativeValue) {
switch (nativeValue) {
case FORBID_ENCRYPT_ALLOW_DECRYPT: {
return ESDKCommitmentPolicy.create_FORBID__ENCRYPT__ALLOW__DECRYPT();
}
case REQUIRE_ENCRYPT_ALLOW_DECRYPT: {
return ESDKCommitmentPolicy.create_REQUIRE__ENCRYPT__ALLOW__DECRYPT();
}
case REQUIRE_ENCRYPT_REQUIRE_DECRYPT: {
return ESDKCommitmentPolicy.create_REQUIRE__ENCRYPT__REQUIRE__DECRYPT();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.materialproviders.internaldafny.types.ESDKCommitmentPolicy.");
}
}
}
public static PaddingScheme PaddingScheme(
software.amazon.cryptography.materialproviders.model.PaddingScheme nativeValue) {
switch (nativeValue) {
case PKCS1: {
return PaddingScheme.create_PKCS1();
}
case OAEP_SHA1_MGF1: {
return PaddingScheme.create_OAEP__SHA1__MGF1();
}
case OAEP_SHA256_MGF1: {
return PaddingScheme.create_OAEP__SHA256__MGF1();
}
case OAEP_SHA384_MGF1: {
return PaddingScheme.create_OAEP__SHA384__MGF1();
}
case OAEP_SHA512_MGF1: {
return PaddingScheme.create_OAEP__SHA512__MGF1();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.materialproviders.internaldafny.types.PaddingScheme.");
}
}
}
public static AlgorithmSuiteId AlgorithmSuiteId(
software.amazon.cryptography.materialproviders.model.AlgorithmSuiteId nativeValue) {
if (Objects.nonNull(nativeValue.ESDK())) {
return AlgorithmSuiteId.create_ESDK(ToDafny.ESDKAlgorithmSuiteId(nativeValue.ESDK()));
}
if (Objects.nonNull(nativeValue.DBE())) {
return AlgorithmSuiteId.create_DBE(ToDafny.DBEAlgorithmSuiteId(nativeValue.DBE()));
}
throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.materialproviders.internaldafny.types.AlgorithmSuiteId.");
}
public static CacheType CacheType(
software.amazon.cryptography.materialproviders.model.CacheType nativeValue) {
if (Objects.nonNull(nativeValue.Default())) {
return CacheType.create_Default(ToDafny.DefaultCache(nativeValue.Default()));
}
if (Objects.nonNull(nativeValue.No())) {
return CacheType.create_No(ToDafny.NoCache(nativeValue.No()));
}
if (Objects.nonNull(nativeValue.SingleThreaded())) {
return CacheType.create_SingleThreaded(ToDafny.SingleThreadedCache(nativeValue.SingleThreaded()));
}
if (Objects.nonNull(nativeValue.MultiThreaded())) {
return CacheType.create_MultiThreaded(ToDafny.MultiThreadedCache(nativeValue.MultiThreaded()));
}
if (Objects.nonNull(nativeValue.StormTracking())) {
return CacheType.create_StormTracking(ToDafny.StormTrackingCache(nativeValue.StormTracking()));
}
throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.materialproviders.internaldafny.types.CacheType.");
}
public static CommitmentPolicy CommitmentPolicy(
software.amazon.cryptography.materialproviders.model.CommitmentPolicy nativeValue) {
if (Objects.nonNull(nativeValue.ESDK())) {
return CommitmentPolicy.create_ESDK(ToDafny.ESDKCommitmentPolicy(nativeValue.ESDK()));
}
if (Objects.nonNull(nativeValue.DBE())) {
return CommitmentPolicy.create_DBE(ToDafny.DBECommitmentPolicy(nativeValue.DBE()));
}
throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.materialproviders.internaldafny.types.CommitmentPolicy.");
}
public static DerivationAlgorithm DerivationAlgorithm(
software.amazon.cryptography.materialproviders.model.DerivationAlgorithm nativeValue) {
if (Objects.nonNull(nativeValue.HKDF())) {
return DerivationAlgorithm.create_HKDF(ToDafny.HKDF(nativeValue.HKDF()));
}
if (Objects.nonNull(nativeValue.IDENTITY())) {
return DerivationAlgorithm.create_IDENTITY(ToDafny.IDENTITY(nativeValue.IDENTITY()));
}
if (Objects.nonNull(nativeValue.None())) {
return DerivationAlgorithm.create_None(ToDafny.None(nativeValue.None()));
}
throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.materialproviders.internaldafny.types.DerivationAlgorithm.");
}
public static EdkWrappingAlgorithm EdkWrappingAlgorithm(
software.amazon.cryptography.materialproviders.model.EdkWrappingAlgorithm nativeValue) {
if (Objects.nonNull(nativeValue.DIRECT_KEY_WRAPPING())) {
return EdkWrappingAlgorithm.create_DIRECT__KEY__WRAPPING(ToDafny.DIRECT_KEY_WRAPPING(nativeValue.DIRECT_KEY_WRAPPING()));
}
if (Objects.nonNull(nativeValue.IntermediateKeyWrapping())) {
return EdkWrappingAlgorithm.create_IntermediateKeyWrapping(ToDafny.IntermediateKeyWrapping(nativeValue.IntermediateKeyWrapping()));
}
throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.materialproviders.internaldafny.types.EdkWrappingAlgorithm.");
}
public static Encrypt Encrypt(
software.amazon.cryptography.materialproviders.model.Encrypt nativeValue) {
if (Objects.nonNull(nativeValue.AES_GCM())) {
return Encrypt.create(software.amazon.cryptography.primitives.ToDafny.AES_GCM(nativeValue.AES_GCM()));
}
throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.materialproviders.internaldafny.types.Encrypt.");
}
public static Materials Materials(
software.amazon.cryptography.materialproviders.model.Materials nativeValue) {
if (Objects.nonNull(nativeValue.Encryption())) {
return Materials.create_Encryption(ToDafny.EncryptionMaterials(nativeValue.Encryption()));
}
if (Objects.nonNull(nativeValue.Decryption())) {
return Materials.create_Decryption(ToDafny.DecryptionMaterials(nativeValue.Decryption()));
}
if (Objects.nonNull(nativeValue.BranchKey())) {
return Materials.create_BranchKey(software.amazon.cryptography.keystore.ToDafny.BranchKeyMaterials(nativeValue.BranchKey()));
}
if (Objects.nonNull(nativeValue.BeaconKey())) {
return Materials.create_BeaconKey(software.amazon.cryptography.keystore.ToDafny.BeaconKeyMaterials(nativeValue.BeaconKey()));
}
throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.materialproviders.internaldafny.types.Materials.");
}
public static SignatureAlgorithm SignatureAlgorithm(
software.amazon.cryptography.materialproviders.model.SignatureAlgorithm nativeValue) {
if (Objects.nonNull(nativeValue.ECDSA())) {
return SignatureAlgorithm.create_ECDSA(ToDafny.ECDSA(nativeValue.ECDSA()));
}
if (Objects.nonNull(nativeValue.None())) {
return SignatureAlgorithm.create_None(ToDafny.None(nativeValue.None()));
}
throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.materialproviders.internaldafny.types.SignatureAlgorithm.");
}
public static SymmetricSignatureAlgorithm SymmetricSignatureAlgorithm(
software.amazon.cryptography.materialproviders.model.SymmetricSignatureAlgorithm nativeValue) {
if (Objects.nonNull(nativeValue.HMAC())) {
return SymmetricSignatureAlgorithm.create_HMAC(software.amazon.cryptography.primitives.ToDafny.DigestAlgorithm(nativeValue.HMAC()));
}
if (Objects.nonNull(nativeValue.None())) {
return SymmetricSignatureAlgorithm.create_None(ToDafny.None(nativeValue.None()));
}
throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.materialproviders.internaldafny.types.SymmetricSignatureAlgorithm.");
}
public static DafnySequence<? extends DafnySequence<? extends Character>> AccountIdList(
List<String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
DafnySequence._typeDescriptor(TypeDescriptor.CHAR));
}
public static DafnySequence<? extends EncryptedDataKey> EncryptedDataKeyList(
List<software.amazon.cryptography.materialproviders.model.EncryptedDataKey> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.materialproviders.ToDafny::EncryptedDataKey,
EncryptedDataKey._typeDescriptor());
}
public static DafnySequence<? extends DafnySequence<? extends Byte>> EncryptionContextKeys(
List<String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::DafnyUtf8Bytes,
DafnySequence._typeDescriptor(TypeDescriptor.BYTE));
}
public static DafnySequence<? extends DafnySequence<? extends Character>> GrantTokenList(
List<String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
DafnySequence._typeDescriptor(TypeDescriptor.CHAR));
}
public static DafnySequence<? extends software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring> KeyringList(
List<IKeyring> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.materialproviders.ToDafny::Keyring,
TypeDescriptor.reference(software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring.class));
}
public static DafnySequence<? extends DafnySequence<? extends Character>> KmsKeyIdList(
List<String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
DafnySequence._typeDescriptor(TypeDescriptor.CHAR));
}
public static DafnySequence<? extends DafnySequence<? extends Character>> RegionList(
List<String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
DafnySequence._typeDescriptor(TypeDescriptor.CHAR));
}
public static DafnySequence<? extends DafnySequence<? extends Byte>> SymmetricSigningKeyList(
List<ByteBuffer> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::ByteSequence,
DafnySequence._typeDescriptor(TypeDescriptor.BYTE));
}
public static DafnyMap<? extends DafnySequence<? extends Byte>, ? extends DafnySequence<? extends Byte>> EncryptionContext(
Map<String, String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::DafnyUtf8Bytes,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::DafnyUtf8Bytes);
}
public static software.amazon.cryptography.materialproviders.internaldafny.types.IBranchKeyIdSupplier BranchKeyIdSupplier(
IBranchKeyIdSupplier nativeValue) {
return BranchKeyIdSupplier.wrap(nativeValue).impl();
}
public static software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier ClientSupplier(
IClientSupplier nativeValue) {
return ClientSupplier.wrap(nativeValue).impl();
}
public static software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsCache CryptographicMaterialsCache(
ICryptographicMaterialsCache nativeValue) {
return CryptographicMaterialsCache.wrap(nativeValue).impl();
}
public static software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsManager CryptographicMaterialsManager(
ICryptographicMaterialsManager nativeValue) {
return CryptographicMaterialsManager.wrap(nativeValue).impl();
}
public static software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring Keyring(
IKeyring nativeValue) {
return Keyring.wrap(nativeValue).impl();
}
public static IAwsCryptographicMaterialProvidersClient AwsCryptographicMaterialProviders(
MaterialProviders nativeValue) {
return nativeValue.impl();
}
}
| 319 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/ICryptographicMaterialsCache.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders;
import software.amazon.cryptography.materialproviders.model.DeleteCacheEntryInput;
import software.amazon.cryptography.materialproviders.model.GetCacheEntryInput;
import software.amazon.cryptography.materialproviders.model.GetCacheEntryOutput;
import software.amazon.cryptography.materialproviders.model.PutCacheEntryInput;
import software.amazon.cryptography.materialproviders.model.UpdateUsageMetadataInput;
public interface ICryptographicMaterialsCache {
void DeleteCacheEntry(DeleteCacheEntryInput input);
GetCacheEntryOutput GetCacheEntry(GetCacheEntryInput input);
void PutCacheEntry(PutCacheEntryInput input);
void UpdateUsageMetadata(UpdateUsageMetadataInput input);
}
| 320 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CreateAwsKmsDiscoveryMultiKeyringInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.List;
import java.util.Objects;
import software.amazon.cryptography.materialproviders.ClientSupplier;
import software.amazon.cryptography.materialproviders.IClientSupplier;
/**
* Inputs for for creating an AWS KMS Discovery Multi-Keyring.
*/
public class CreateAwsKmsDiscoveryMultiKeyringInput {
/**
* The list of regions this Keyring will creates KMS clients for.
*/
private final List<String> regions;
/**
* A filter which restricts which KMS Keys this Keyring may attempt to decrypt with by AWS partition and account.
*/
private final DiscoveryFilter discoveryFilter;
/**
* The Client Supplier which will be used to get KMS Clients for use with this Keyring. If not specified on input, a Default Client Supplier is created which creates a KMS Client for each region in the 'regions' input.
*/
private final IClientSupplier clientSupplier;
/**
* A list of grant tokens to be used when calling KMS.
*/
private final List<String> grantTokens;
protected CreateAwsKmsDiscoveryMultiKeyringInput(BuilderImpl builder) {
this.regions = builder.regions();
this.discoveryFilter = builder.discoveryFilter();
this.clientSupplier = builder.clientSupplier();
this.grantTokens = builder.grantTokens();
}
/**
* @return The list of regions this Keyring will creates KMS clients for.
*/
public List<String> regions() {
return this.regions;
}
/**
* @return A filter which restricts which KMS Keys this Keyring may attempt to decrypt with by AWS partition and account.
*/
public DiscoveryFilter discoveryFilter() {
return this.discoveryFilter;
}
/**
* @return The Client Supplier which will be used to get KMS Clients for use with this Keyring. If not specified on input, a Default Client Supplier is created which creates a KMS Client for each region in the 'regions' input.
*/
public IClientSupplier clientSupplier() {
return this.clientSupplier;
}
/**
* @return A list of grant tokens to be used when calling KMS.
*/
public List<String> grantTokens() {
return this.grantTokens;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param regions The list of regions this Keyring will creates KMS clients for.
*/
Builder regions(List<String> regions);
/**
* @return The list of regions this Keyring will creates KMS clients for.
*/
List<String> regions();
/**
* @param discoveryFilter A filter which restricts which KMS Keys this Keyring may attempt to decrypt with by AWS partition and account.
*/
Builder discoveryFilter(DiscoveryFilter discoveryFilter);
/**
* @return A filter which restricts which KMS Keys this Keyring may attempt to decrypt with by AWS partition and account.
*/
DiscoveryFilter discoveryFilter();
/**
* @param clientSupplier The Client Supplier which will be used to get KMS Clients for use with this Keyring. If not specified on input, a Default Client Supplier is created which creates a KMS Client for each region in the 'regions' input.
*/
Builder clientSupplier(IClientSupplier clientSupplier);
/**
* @return The Client Supplier which will be used to get KMS Clients for use with this Keyring. If not specified on input, a Default Client Supplier is created which creates a KMS Client for each region in the 'regions' input.
*/
IClientSupplier clientSupplier();
/**
* @param grantTokens A list of grant tokens to be used when calling KMS.
*/
Builder grantTokens(List<String> grantTokens);
/**
* @return A list of grant tokens to be used when calling KMS.
*/
List<String> grantTokens();
CreateAwsKmsDiscoveryMultiKeyringInput build();
}
static class BuilderImpl implements Builder {
protected List<String> regions;
protected DiscoveryFilter discoveryFilter;
protected IClientSupplier clientSupplier;
protected List<String> grantTokens;
protected BuilderImpl() {
}
protected BuilderImpl(CreateAwsKmsDiscoveryMultiKeyringInput model) {
this.regions = model.regions();
this.discoveryFilter = model.discoveryFilter();
this.clientSupplier = model.clientSupplier();
this.grantTokens = model.grantTokens();
}
public Builder regions(List<String> regions) {
this.regions = regions;
return this;
}
public List<String> regions() {
return this.regions;
}
public Builder discoveryFilter(DiscoveryFilter discoveryFilter) {
this.discoveryFilter = discoveryFilter;
return this;
}
public DiscoveryFilter discoveryFilter() {
return this.discoveryFilter;
}
public Builder clientSupplier(IClientSupplier clientSupplier) {
this.clientSupplier = ClientSupplier.wrap(clientSupplier);
return this;
}
public IClientSupplier clientSupplier() {
return this.clientSupplier;
}
public Builder grantTokens(List<String> grantTokens) {
this.grantTokens = grantTokens;
return this;
}
public List<String> grantTokens() {
return this.grantTokens;
}
public CreateAwsKmsDiscoveryMultiKeyringInput build() {
if (Objects.isNull(this.regions())) {
throw new IllegalArgumentException("Missing value for required field `regions`");
}
return new CreateAwsKmsDiscoveryMultiKeyringInput(this);
}
}
}
| 321 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/AwsCryptographicMaterialProvidersException.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class AwsCryptographicMaterialProvidersException extends RuntimeException {
protected AwsCryptographicMaterialProvidersException(BuilderImpl builder) {
super(messageFromBuilder(builder), builder.cause());
}
private static String messageFromBuilder(Builder builder) {
if (builder.message() != null) {
return builder.message();
}
if (builder.cause() != null) {
return builder.cause().getMessage();
}
return null;
}
/**
* See {@link Throwable#getMessage()}.
*/
public String message() {
return this.getMessage();
}
/**
* See {@link Throwable#getCause()}.
*/
public Throwable cause() {
return this.getCause();
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param message The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
Builder message(String message);
/**
* @return The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
String message();
/**
* @param cause The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Builder cause(Throwable cause);
/**
* @return The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Throwable cause();
AwsCryptographicMaterialProvidersException build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected BuilderImpl() {
}
protected BuilderImpl(AwsCryptographicMaterialProvidersException model) {
this.message = model.message();
this.cause = model.cause();
}
public Builder message(String message) {
this.message = message;
return this;
}
public String message() {
return this.message;
}
public Builder cause(Throwable cause) {
this.cause = cause;
return this;
}
public Throwable cause() {
return this.cause;
}
public AwsCryptographicMaterialProvidersException build() {
if (Objects.isNull(this.message())) {
throw new IllegalArgumentException("Missing value for required field `message`");
}
return new AwsCryptographicMaterialProvidersException(this);
}
}
}
| 322 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/ValidateCommitmentPolicyOnDecryptInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class ValidateCommitmentPolicyOnDecryptInput {
private final AlgorithmSuiteId algorithm;
private final CommitmentPolicy commitmentPolicy;
protected ValidateCommitmentPolicyOnDecryptInput(BuilderImpl builder) {
this.algorithm = builder.algorithm();
this.commitmentPolicy = builder.commitmentPolicy();
}
public AlgorithmSuiteId algorithm() {
return this.algorithm;
}
public CommitmentPolicy commitmentPolicy() {
return this.commitmentPolicy;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder algorithm(AlgorithmSuiteId algorithm);
AlgorithmSuiteId algorithm();
Builder commitmentPolicy(CommitmentPolicy commitmentPolicy);
CommitmentPolicy commitmentPolicy();
ValidateCommitmentPolicyOnDecryptInput build();
}
static class BuilderImpl implements Builder {
protected AlgorithmSuiteId algorithm;
protected CommitmentPolicy commitmentPolicy;
protected BuilderImpl() {
}
protected BuilderImpl(ValidateCommitmentPolicyOnDecryptInput model) {
this.algorithm = model.algorithm();
this.commitmentPolicy = model.commitmentPolicy();
}
public Builder algorithm(AlgorithmSuiteId algorithm) {
this.algorithm = algorithm;
return this;
}
public AlgorithmSuiteId algorithm() {
return this.algorithm;
}
public Builder commitmentPolicy(CommitmentPolicy commitmentPolicy) {
this.commitmentPolicy = commitmentPolicy;
return this;
}
public CommitmentPolicy commitmentPolicy() {
return this.commitmentPolicy;
}
public ValidateCommitmentPolicyOnDecryptInput build() {
if (Objects.isNull(this.algorithm())) {
throw new IllegalArgumentException("Missing value for required field `algorithm`");
}
if (Objects.isNull(this.commitmentPolicy())) {
throw new IllegalArgumentException("Missing value for required field `commitmentPolicy`");
}
return new ValidateCommitmentPolicyOnDecryptInput(this);
}
}
}
| 323 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/GetBranchKeyIdOutput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
/**
* Outputs for the Branch Key responsible for wrapping or unwrapping the data key in this encryption or decryption.
*/
public class GetBranchKeyIdOutput {
/**
* The identifier of the Branch Key that should be responsible for wrapping or unwrapping the data key in this encryption or decryption.
*/
private final String branchKeyId;
protected GetBranchKeyIdOutput(BuilderImpl builder) {
this.branchKeyId = builder.branchKeyId();
}
/**
* @return The identifier of the Branch Key that should be responsible for wrapping or unwrapping the data key in this encryption or decryption.
*/
public String branchKeyId() {
return this.branchKeyId;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param branchKeyId The identifier of the Branch Key that should be responsible for wrapping or unwrapping the data key in this encryption or decryption.
*/
Builder branchKeyId(String branchKeyId);
/**
* @return The identifier of the Branch Key that should be responsible for wrapping or unwrapping the data key in this encryption or decryption.
*/
String branchKeyId();
GetBranchKeyIdOutput build();
}
static class BuilderImpl implements Builder {
protected String branchKeyId;
protected BuilderImpl() {
}
protected BuilderImpl(GetBranchKeyIdOutput model) {
this.branchKeyId = model.branchKeyId();
}
public Builder branchKeyId(String branchKeyId) {
this.branchKeyId = branchKeyId;
return this;
}
public String branchKeyId() {
return this.branchKeyId;
}
public GetBranchKeyIdOutput build() {
if (Objects.isNull(this.branchKeyId())) {
throw new IllegalArgumentException("Missing value for required field `branchKeyId`");
}
return new GetBranchKeyIdOutput(this);
}
}
}
| 324 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/DecryptMaterialsInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.List;
import java.util.Map;
import java.util.Objects;
public class DecryptMaterialsInput {
private final AlgorithmSuiteId algorithmSuiteId;
private final CommitmentPolicy commitmentPolicy;
private final List<EncryptedDataKey> encryptedDataKeys;
private final Map<String, String> encryptionContext;
private final Map<String, String> reproducedEncryptionContext;
protected DecryptMaterialsInput(BuilderImpl builder) {
this.algorithmSuiteId = builder.algorithmSuiteId();
this.commitmentPolicy = builder.commitmentPolicy();
this.encryptedDataKeys = builder.encryptedDataKeys();
this.encryptionContext = builder.encryptionContext();
this.reproducedEncryptionContext = builder.reproducedEncryptionContext();
}
public AlgorithmSuiteId algorithmSuiteId() {
return this.algorithmSuiteId;
}
public CommitmentPolicy commitmentPolicy() {
return this.commitmentPolicy;
}
public List<EncryptedDataKey> encryptedDataKeys() {
return this.encryptedDataKeys;
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public Map<String, String> reproducedEncryptionContext() {
return this.reproducedEncryptionContext;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder algorithmSuiteId(AlgorithmSuiteId algorithmSuiteId);
AlgorithmSuiteId algorithmSuiteId();
Builder commitmentPolicy(CommitmentPolicy commitmentPolicy);
CommitmentPolicy commitmentPolicy();
Builder encryptedDataKeys(List<EncryptedDataKey> encryptedDataKeys);
List<EncryptedDataKey> encryptedDataKeys();
Builder encryptionContext(Map<String, String> encryptionContext);
Map<String, String> encryptionContext();
Builder reproducedEncryptionContext(Map<String, String> reproducedEncryptionContext);
Map<String, String> reproducedEncryptionContext();
DecryptMaterialsInput build();
}
static class BuilderImpl implements Builder {
protected AlgorithmSuiteId algorithmSuiteId;
protected CommitmentPolicy commitmentPolicy;
protected List<EncryptedDataKey> encryptedDataKeys;
protected Map<String, String> encryptionContext;
protected Map<String, String> reproducedEncryptionContext;
protected BuilderImpl() {
}
protected BuilderImpl(DecryptMaterialsInput model) {
this.algorithmSuiteId = model.algorithmSuiteId();
this.commitmentPolicy = model.commitmentPolicy();
this.encryptedDataKeys = model.encryptedDataKeys();
this.encryptionContext = model.encryptionContext();
this.reproducedEncryptionContext = model.reproducedEncryptionContext();
}
public Builder algorithmSuiteId(AlgorithmSuiteId algorithmSuiteId) {
this.algorithmSuiteId = algorithmSuiteId;
return this;
}
public AlgorithmSuiteId algorithmSuiteId() {
return this.algorithmSuiteId;
}
public Builder commitmentPolicy(CommitmentPolicy commitmentPolicy) {
this.commitmentPolicy = commitmentPolicy;
return this;
}
public CommitmentPolicy commitmentPolicy() {
return this.commitmentPolicy;
}
public Builder encryptedDataKeys(List<EncryptedDataKey> encryptedDataKeys) {
this.encryptedDataKeys = encryptedDataKeys;
return this;
}
public List<EncryptedDataKey> encryptedDataKeys() {
return this.encryptedDataKeys;
}
public Builder encryptionContext(Map<String, String> encryptionContext) {
this.encryptionContext = encryptionContext;
return this;
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public Builder reproducedEncryptionContext(Map<String, String> reproducedEncryptionContext) {
this.reproducedEncryptionContext = reproducedEncryptionContext;
return this;
}
public Map<String, String> reproducedEncryptionContext() {
return this.reproducedEncryptionContext;
}
public DecryptMaterialsInput build() {
if (Objects.isNull(this.algorithmSuiteId())) {
throw new IllegalArgumentException("Missing value for required field `algorithmSuiteId`");
}
if (Objects.isNull(this.commitmentPolicy())) {
throw new IllegalArgumentException("Missing value for required field `commitmentPolicy`");
}
if (Objects.isNull(this.encryptedDataKeys())) {
throw new IllegalArgumentException("Missing value for required field `encryptedDataKeys`");
}
if (Objects.isNull(this.encryptionContext())) {
throw new IllegalArgumentException("Missing value for required field `encryptionContext`");
}
return new DecryptMaterialsInput(this);
}
}
}
| 325 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/InvalidDecryptionMaterials.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class InvalidDecryptionMaterials extends RuntimeException {
protected InvalidDecryptionMaterials(BuilderImpl builder) {
super(messageFromBuilder(builder), builder.cause());
}
private static String messageFromBuilder(Builder builder) {
if (builder.message() != null) {
return builder.message();
}
if (builder.cause() != null) {
return builder.cause().getMessage();
}
return null;
}
/**
* See {@link Throwable#getMessage()}.
*/
public String message() {
return this.getMessage();
}
/**
* See {@link Throwable#getCause()}.
*/
public Throwable cause() {
return this.getCause();
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param message The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
Builder message(String message);
/**
* @return The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
String message();
/**
* @param cause The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Builder cause(Throwable cause);
/**
* @return The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Throwable cause();
InvalidDecryptionMaterials build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected BuilderImpl() {
}
protected BuilderImpl(InvalidDecryptionMaterials model) {
this.message = model.message();
this.cause = model.cause();
}
public Builder message(String message) {
this.message = message;
return this;
}
public String message() {
return this.message;
}
public Builder cause(Throwable cause) {
this.cause = cause;
return this;
}
public Throwable cause() {
return this.cause;
}
public InvalidDecryptionMaterials build() {
if (Objects.isNull(this.message())) {
throw new IllegalArgumentException("Missing value for required field `message`");
}
return new InvalidDecryptionMaterials(this);
}
}
}
| 326 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/AesWrappingAlg.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
public enum AesWrappingAlg {
ALG_AES128_GCM_IV12_TAG16("ALG_AES128_GCM_IV12_TAG16"),
ALG_AES192_GCM_IV12_TAG16("ALG_AES192_GCM_IV12_TAG16"),
ALG_AES256_GCM_IV12_TAG16("ALG_AES256_GCM_IV12_TAG16");
private final String value;
private AesWrappingAlg(String value) {
this.value = value;
}
public String toString() {
return String.valueOf(value);
}
}
| 327 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/PutCacheEntryInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class PutCacheEntryInput {
private final ByteBuffer identifier;
private final Materials materials;
private final long creationTime;
private final long expiryTime;
private final int messagesUsed;
private final int bytesUsed;
protected PutCacheEntryInput(BuilderImpl builder) {
this.identifier = builder.identifier();
this.materials = builder.materials();
this.creationTime = builder.creationTime();
this.expiryTime = builder.expiryTime();
this.messagesUsed = builder.messagesUsed();
this.bytesUsed = builder.bytesUsed();
}
public ByteBuffer identifier() {
return this.identifier;
}
public Materials materials() {
return this.materials;
}
public long creationTime() {
return this.creationTime;
}
public long expiryTime() {
return this.expiryTime;
}
public int messagesUsed() {
return this.messagesUsed;
}
public int bytesUsed() {
return this.bytesUsed;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder identifier(ByteBuffer identifier);
ByteBuffer identifier();
Builder materials(Materials materials);
Materials materials();
Builder creationTime(long creationTime);
long creationTime();
Builder expiryTime(long expiryTime);
long expiryTime();
Builder messagesUsed(int messagesUsed);
int messagesUsed();
Builder bytesUsed(int bytesUsed);
int bytesUsed();
PutCacheEntryInput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer identifier;
protected Materials materials;
protected long creationTime;
private boolean _creationTimeSet = false;
protected long expiryTime;
private boolean _expiryTimeSet = false;
protected int messagesUsed;
private boolean _messagesUsedSet = false;
protected int bytesUsed;
private boolean _bytesUsedSet = false;
protected BuilderImpl() {
}
protected BuilderImpl(PutCacheEntryInput model) {
this.identifier = model.identifier();
this.materials = model.materials();
this.creationTime = model.creationTime();
this._creationTimeSet = true;
this.expiryTime = model.expiryTime();
this._expiryTimeSet = true;
this.messagesUsed = model.messagesUsed();
this._messagesUsedSet = true;
this.bytesUsed = model.bytesUsed();
this._bytesUsedSet = true;
}
public Builder identifier(ByteBuffer identifier) {
this.identifier = identifier;
return this;
}
public ByteBuffer identifier() {
return this.identifier;
}
public Builder materials(Materials materials) {
this.materials = materials;
return this;
}
public Materials materials() {
return this.materials;
}
public Builder creationTime(long creationTime) {
this.creationTime = creationTime;
this._creationTimeSet = true;
return this;
}
public long creationTime() {
return this.creationTime;
}
public Builder expiryTime(long expiryTime) {
this.expiryTime = expiryTime;
this._expiryTimeSet = true;
return this;
}
public long expiryTime() {
return this.expiryTime;
}
public Builder messagesUsed(int messagesUsed) {
this.messagesUsed = messagesUsed;
this._messagesUsedSet = true;
return this;
}
public int messagesUsed() {
return this.messagesUsed;
}
public Builder bytesUsed(int bytesUsed) {
this.bytesUsed = bytesUsed;
this._bytesUsedSet = true;
return this;
}
public int bytesUsed() {
return this.bytesUsed;
}
public PutCacheEntryInput build() {
if (Objects.isNull(this.identifier())) {
throw new IllegalArgumentException("Missing value for required field `identifier`");
}
if (Objects.isNull(this.materials())) {
throw new IllegalArgumentException("Missing value for required field `materials`");
}
if (!this._creationTimeSet) {
throw new IllegalArgumentException("Missing value for required field `creationTime`");
}
if (this._creationTimeSet && this.creationTime() < 0) {
throw new IllegalArgumentException("`creationTime` must be greater than or equal to 0");
}
if (!this._expiryTimeSet) {
throw new IllegalArgumentException("Missing value for required field `expiryTime`");
}
if (this._expiryTimeSet && this.expiryTime() < 0) {
throw new IllegalArgumentException("`expiryTime` must be greater than or equal to 0");
}
if (this._messagesUsedSet && this.messagesUsed() < 0) {
throw new IllegalArgumentException("`messagesUsed` must be greater than or equal to 0");
}
if (this._bytesUsedSet && this.bytesUsed() < 0) {
throw new IllegalArgumentException("`bytesUsed` must be greater than or equal to 0");
}
return new PutCacheEntryInput(this);
}
}
}
| 328 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/GetCacheEntryInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class GetCacheEntryInput {
private final ByteBuffer identifier;
private final Long bytesUsed;
protected GetCacheEntryInput(BuilderImpl builder) {
this.identifier = builder.identifier();
this.bytesUsed = builder.bytesUsed();
}
public ByteBuffer identifier() {
return this.identifier;
}
public Long bytesUsed() {
return this.bytesUsed;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder identifier(ByteBuffer identifier);
ByteBuffer identifier();
Builder bytesUsed(Long bytesUsed);
Long bytesUsed();
GetCacheEntryInput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer identifier;
protected Long bytesUsed;
protected BuilderImpl() {
}
protected BuilderImpl(GetCacheEntryInput model) {
this.identifier = model.identifier();
this.bytesUsed = model.bytesUsed();
}
public Builder identifier(ByteBuffer identifier) {
this.identifier = identifier;
return this;
}
public ByteBuffer identifier() {
return this.identifier;
}
public Builder bytesUsed(Long bytesUsed) {
this.bytesUsed = bytesUsed;
return this;
}
public Long bytesUsed() {
return this.bytesUsed;
}
public GetCacheEntryInput build() {
if (Objects.isNull(this.identifier())) {
throw new IllegalArgumentException("Missing value for required field `identifier`");
}
return new GetCacheEntryInput(this);
}
}
}
| 329 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/DefaultCache.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
/**
* The best choice for most situations. Probably a StormTrackingCache.
*/
public class DefaultCache {
/**
* Maximum number of entries cached.
*/
private final int entryCapacity;
protected DefaultCache(BuilderImpl builder) {
this.entryCapacity = builder.entryCapacity();
}
/**
* @return Maximum number of entries cached.
*/
public int entryCapacity() {
return this.entryCapacity;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param entryCapacity Maximum number of entries cached.
*/
Builder entryCapacity(int entryCapacity);
/**
* @return Maximum number of entries cached.
*/
int entryCapacity();
DefaultCache build();
}
static class BuilderImpl implements Builder {
protected int entryCapacity;
private boolean _entryCapacitySet = false;
protected BuilderImpl() {
}
protected BuilderImpl(DefaultCache model) {
this.entryCapacity = model.entryCapacity();
this._entryCapacitySet = true;
}
public Builder entryCapacity(int entryCapacity) {
this.entryCapacity = entryCapacity;
this._entryCapacitySet = true;
return this;
}
public int entryCapacity() {
return this.entryCapacity;
}
public DefaultCache build() {
if (!this._entryCapacitySet) {
throw new IllegalArgumentException("Missing value for required field `entryCapacity`");
}
if (this._entryCapacitySet && this.entryCapacity() < 1) {
throw new IllegalArgumentException("`entryCapacity` must be greater than or equal to 1");
}
return new DefaultCache(this);
}
}
}
| 330 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/InitializeDecryptionMaterialsInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.List;
import java.util.Map;
import java.util.Objects;
public class InitializeDecryptionMaterialsInput {
private final AlgorithmSuiteId algorithmSuiteId;
private final Map<String, String> encryptionContext;
private final List<String> requiredEncryptionContextKeys;
protected InitializeDecryptionMaterialsInput(BuilderImpl builder) {
this.algorithmSuiteId = builder.algorithmSuiteId();
this.encryptionContext = builder.encryptionContext();
this.requiredEncryptionContextKeys = builder.requiredEncryptionContextKeys();
}
public AlgorithmSuiteId algorithmSuiteId() {
return this.algorithmSuiteId;
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public List<String> requiredEncryptionContextKeys() {
return this.requiredEncryptionContextKeys;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder algorithmSuiteId(AlgorithmSuiteId algorithmSuiteId);
AlgorithmSuiteId algorithmSuiteId();
Builder encryptionContext(Map<String, String> encryptionContext);
Map<String, String> encryptionContext();
Builder requiredEncryptionContextKeys(List<String> requiredEncryptionContextKeys);
List<String> requiredEncryptionContextKeys();
InitializeDecryptionMaterialsInput build();
}
static class BuilderImpl implements Builder {
protected AlgorithmSuiteId algorithmSuiteId;
protected Map<String, String> encryptionContext;
protected List<String> requiredEncryptionContextKeys;
protected BuilderImpl() {
}
protected BuilderImpl(InitializeDecryptionMaterialsInput model) {
this.algorithmSuiteId = model.algorithmSuiteId();
this.encryptionContext = model.encryptionContext();
this.requiredEncryptionContextKeys = model.requiredEncryptionContextKeys();
}
public Builder algorithmSuiteId(AlgorithmSuiteId algorithmSuiteId) {
this.algorithmSuiteId = algorithmSuiteId;
return this;
}
public AlgorithmSuiteId algorithmSuiteId() {
return this.algorithmSuiteId;
}
public Builder encryptionContext(Map<String, String> encryptionContext) {
this.encryptionContext = encryptionContext;
return this;
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public Builder requiredEncryptionContextKeys(List<String> requiredEncryptionContextKeys) {
this.requiredEncryptionContextKeys = requiredEncryptionContextKeys;
return this;
}
public List<String> requiredEncryptionContextKeys() {
return this.requiredEncryptionContextKeys;
}
public InitializeDecryptionMaterialsInput build() {
if (Objects.isNull(this.algorithmSuiteId())) {
throw new IllegalArgumentException("Missing value for required field `algorithmSuiteId`");
}
if (Objects.isNull(this.encryptionContext())) {
throw new IllegalArgumentException("Missing value for required field `encryptionContext`");
}
if (Objects.isNull(this.requiredEncryptionContextKeys())) {
throw new IllegalArgumentException("Missing value for required field `requiredEncryptionContextKeys`");
}
return new InitializeDecryptionMaterialsInput(this);
}
}
}
| 331 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/InvalidEncryptionMaterialsTransition.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class InvalidEncryptionMaterialsTransition extends RuntimeException {
protected InvalidEncryptionMaterialsTransition(BuilderImpl builder) {
super(messageFromBuilder(builder), builder.cause());
}
private static String messageFromBuilder(Builder builder) {
if (builder.message() != null) {
return builder.message();
}
if (builder.cause() != null) {
return builder.cause().getMessage();
}
return null;
}
/**
* See {@link Throwable#getMessage()}.
*/
public String message() {
return this.getMessage();
}
/**
* See {@link Throwable#getCause()}.
*/
public Throwable cause() {
return this.getCause();
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param message The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
Builder message(String message);
/**
* @return The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
String message();
/**
* @param cause The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Builder cause(Throwable cause);
/**
* @return The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Throwable cause();
InvalidEncryptionMaterialsTransition build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected BuilderImpl() {
}
protected BuilderImpl(InvalidEncryptionMaterialsTransition model) {
this.message = model.message();
this.cause = model.cause();
}
public Builder message(String message) {
this.message = message;
return this;
}
public String message() {
return this.message;
}
public Builder cause(Throwable cause) {
this.cause = cause;
return this;
}
public Throwable cause() {
return this.cause;
}
public InvalidEncryptionMaterialsTransition build() {
if (Objects.isNull(this.message())) {
throw new IllegalArgumentException("Missing value for required field `message`");
}
return new InvalidEncryptionMaterialsTransition(this);
}
}
}
| 332 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/EntryDoesNotExist.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class EntryDoesNotExist extends RuntimeException {
protected EntryDoesNotExist(BuilderImpl builder) {
super(messageFromBuilder(builder), builder.cause());
}
private static String messageFromBuilder(Builder builder) {
if (builder.message() != null) {
return builder.message();
}
if (builder.cause() != null) {
return builder.cause().getMessage();
}
return null;
}
/**
* See {@link Throwable#getMessage()}.
*/
public String message() {
return this.getMessage();
}
/**
* See {@link Throwable#getCause()}.
*/
public Throwable cause() {
return this.getCause();
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param message The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
Builder message(String message);
/**
* @return The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
String message();
/**
* @param cause The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Builder cause(Throwable cause);
/**
* @return The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Throwable cause();
EntryDoesNotExist build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected BuilderImpl() {
}
protected BuilderImpl(EntryDoesNotExist model) {
this.message = model.message();
this.cause = model.cause();
}
public Builder message(String message) {
this.message = message;
return this;
}
public String message() {
return this.message;
}
public Builder cause(Throwable cause) {
this.cause = cause;
return this;
}
public Throwable cause() {
return this.cause;
}
public EntryDoesNotExist build() {
if (Objects.isNull(this.message())) {
throw new IllegalArgumentException("Missing value for required field `message`");
}
return new EntryDoesNotExist(this);
}
}
}
| 333 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/DiscoveryFilter.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.List;
import java.util.Objects;
/**
* A filter which defines what AWS partition and AWS accounts a KMS Key may be in for a Keyring to be allowed to attempt to decrypt it.
*/
public class DiscoveryFilter {
/**
* A list of allowed AWS account IDs.
*/
private final List<String> accountIds;
/**
* The AWS partition which is allowed.
*/
private final String partition;
protected DiscoveryFilter(BuilderImpl builder) {
this.accountIds = builder.accountIds();
this.partition = builder.partition();
}
/**
* @return A list of allowed AWS account IDs.
*/
public List<String> accountIds() {
return this.accountIds;
}
/**
* @return The AWS partition which is allowed.
*/
public String partition() {
return this.partition;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param accountIds A list of allowed AWS account IDs.
*/
Builder accountIds(List<String> accountIds);
/**
* @return A list of allowed AWS account IDs.
*/
List<String> accountIds();
/**
* @param partition The AWS partition which is allowed.
*/
Builder partition(String partition);
/**
* @return The AWS partition which is allowed.
*/
String partition();
DiscoveryFilter build();
}
static class BuilderImpl implements Builder {
protected List<String> accountIds;
protected String partition;
protected BuilderImpl() {
}
protected BuilderImpl(DiscoveryFilter model) {
this.accountIds = model.accountIds();
this.partition = model.partition();
}
public Builder accountIds(List<String> accountIds) {
this.accountIds = accountIds;
return this;
}
public List<String> accountIds() {
return this.accountIds;
}
public Builder partition(String partition) {
this.partition = partition;
return this;
}
public String partition() {
return this.partition;
}
public DiscoveryFilter build() {
if (Objects.isNull(this.accountIds())) {
throw new IllegalArgumentException("Missing value for required field `accountIds`");
}
if (Objects.isNull(this.partition())) {
throw new IllegalArgumentException("Missing value for required field `partition`");
}
return new DiscoveryFilter(this);
}
}
}
| 334 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/SignatureAlgorithm.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class SignatureAlgorithm {
private final ECDSA ECDSA;
private final None None;
protected SignatureAlgorithm(BuilderImpl builder) {
this.ECDSA = builder.ECDSA();
this.None = builder.None();
}
public ECDSA ECDSA() {
return this.ECDSA;
}
public None None() {
return this.None;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder ECDSA(ECDSA ECDSA);
ECDSA ECDSA();
Builder None(None None);
None None();
SignatureAlgorithm build();
}
static class BuilderImpl implements Builder {
protected ECDSA ECDSA;
protected None None;
protected BuilderImpl() {
}
protected BuilderImpl(SignatureAlgorithm model) {
this.ECDSA = model.ECDSA();
this.None = model.None();
}
public Builder ECDSA(ECDSA ECDSA) {
this.ECDSA = ECDSA;
return this;
}
public ECDSA ECDSA() {
return this.ECDSA;
}
public Builder None(None None) {
this.None = None;
return this;
}
public None None() {
return this.None;
}
public SignatureAlgorithm build() {
if (!onlyOneNonNull()) {
throw new IllegalArgumentException("`SignatureAlgorithm` is a Union. A Union MUST have one and only one value set.");
}
return new SignatureAlgorithm(this);
}
private boolean onlyOneNonNull() {
Object[] allValues = {this.ECDSA, this.None};
boolean haveOneNonNull = false;
for (Object o : allValues) {
if (Objects.nonNull(o)) {
if (haveOneNonNull) {
return false;
}
haveOneNonNull = true;
}
}
return haveOneNonNull;
}
}
}
| 335 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/ValidateCommitmentPolicyOnEncryptInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class ValidateCommitmentPolicyOnEncryptInput {
private final AlgorithmSuiteId algorithm;
private final CommitmentPolicy commitmentPolicy;
protected ValidateCommitmentPolicyOnEncryptInput(BuilderImpl builder) {
this.algorithm = builder.algorithm();
this.commitmentPolicy = builder.commitmentPolicy();
}
public AlgorithmSuiteId algorithm() {
return this.algorithm;
}
public CommitmentPolicy commitmentPolicy() {
return this.commitmentPolicy;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder algorithm(AlgorithmSuiteId algorithm);
AlgorithmSuiteId algorithm();
Builder commitmentPolicy(CommitmentPolicy commitmentPolicy);
CommitmentPolicy commitmentPolicy();
ValidateCommitmentPolicyOnEncryptInput build();
}
static class BuilderImpl implements Builder {
protected AlgorithmSuiteId algorithm;
protected CommitmentPolicy commitmentPolicy;
protected BuilderImpl() {
}
protected BuilderImpl(ValidateCommitmentPolicyOnEncryptInput model) {
this.algorithm = model.algorithm();
this.commitmentPolicy = model.commitmentPolicy();
}
public Builder algorithm(AlgorithmSuiteId algorithm) {
this.algorithm = algorithm;
return this;
}
public AlgorithmSuiteId algorithm() {
return this.algorithm;
}
public Builder commitmentPolicy(CommitmentPolicy commitmentPolicy) {
this.commitmentPolicy = commitmentPolicy;
return this;
}
public CommitmentPolicy commitmentPolicy() {
return this.commitmentPolicy;
}
public ValidateCommitmentPolicyOnEncryptInput build() {
if (Objects.isNull(this.algorithm())) {
throw new IllegalArgumentException("Missing value for required field `algorithm`");
}
if (Objects.isNull(this.commitmentPolicy())) {
throw new IllegalArgumentException("Missing value for required field `commitmentPolicy`");
}
return new ValidateCommitmentPolicyOnEncryptInput(this);
}
}
}
| 336 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/HKDF.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
import software.amazon.cryptography.primitives.model.DigestAlgorithm;
public class HKDF {
private final DigestAlgorithm hmac;
private final int saltLength;
private final int inputKeyLength;
private final int outputKeyLength;
protected HKDF(BuilderImpl builder) {
this.hmac = builder.hmac();
this.saltLength = builder.saltLength();
this.inputKeyLength = builder.inputKeyLength();
this.outputKeyLength = builder.outputKeyLength();
}
public DigestAlgorithm hmac() {
return this.hmac;
}
public int saltLength() {
return this.saltLength;
}
public int inputKeyLength() {
return this.inputKeyLength;
}
public int outputKeyLength() {
return this.outputKeyLength;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder hmac(DigestAlgorithm hmac);
DigestAlgorithm hmac();
Builder saltLength(int saltLength);
int saltLength();
Builder inputKeyLength(int inputKeyLength);
int inputKeyLength();
Builder outputKeyLength(int outputKeyLength);
int outputKeyLength();
HKDF build();
}
static class BuilderImpl implements Builder {
protected DigestAlgorithm hmac;
protected int saltLength;
private boolean _saltLengthSet = false;
protected int inputKeyLength;
private boolean _inputKeyLengthSet = false;
protected int outputKeyLength;
private boolean _outputKeyLengthSet = false;
protected BuilderImpl() {
}
protected BuilderImpl(HKDF model) {
this.hmac = model.hmac();
this.saltLength = model.saltLength();
this._saltLengthSet = true;
this.inputKeyLength = model.inputKeyLength();
this._inputKeyLengthSet = true;
this.outputKeyLength = model.outputKeyLength();
this._outputKeyLengthSet = true;
}
public Builder hmac(DigestAlgorithm hmac) {
this.hmac = hmac;
return this;
}
public DigestAlgorithm hmac() {
return this.hmac;
}
public Builder saltLength(int saltLength) {
this.saltLength = saltLength;
this._saltLengthSet = true;
return this;
}
public int saltLength() {
return this.saltLength;
}
public Builder inputKeyLength(int inputKeyLength) {
this.inputKeyLength = inputKeyLength;
this._inputKeyLengthSet = true;
return this;
}
public int inputKeyLength() {
return this.inputKeyLength;
}
public Builder outputKeyLength(int outputKeyLength) {
this.outputKeyLength = outputKeyLength;
this._outputKeyLengthSet = true;
return this;
}
public int outputKeyLength() {
return this.outputKeyLength;
}
public HKDF build() {
if (Objects.isNull(this.hmac())) {
throw new IllegalArgumentException("Missing value for required field `hmac`");
}
if (!this._saltLengthSet) {
throw new IllegalArgumentException("Missing value for required field `saltLength`");
}
if (this._saltLengthSet && this.saltLength() < 0) {
throw new IllegalArgumentException("`saltLength` must be greater than or equal to 0");
}
if (!this._inputKeyLengthSet) {
throw new IllegalArgumentException("Missing value for required field `inputKeyLength`");
}
if (this._inputKeyLengthSet && this.inputKeyLength() < 1) {
throw new IllegalArgumentException("`inputKeyLength` must be greater than or equal to 1");
}
if (this._inputKeyLengthSet && this.inputKeyLength() > 32) {
throw new IllegalArgumentException("`inputKeyLength` must be less than or equal to 32.");
}
if (!this._outputKeyLengthSet) {
throw new IllegalArgumentException("Missing value for required field `outputKeyLength`");
}
if (this._outputKeyLengthSet && this.outputKeyLength() < 1) {
throw new IllegalArgumentException("`outputKeyLength` must be greater than or equal to 1");
}
if (this._outputKeyLengthSet && this.outputKeyLength() > 32) {
throw new IllegalArgumentException("`outputKeyLength` must be less than or equal to 32.");
}
return new HKDF(this);
}
}
}
| 337 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/DBEAlgorithmSuiteId.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
public enum DBEAlgorithmSuiteId {
ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384("0x6700"),
ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384_SYMSIG_HMAC_SHA384("0x6701");
private final String value;
private DBEAlgorithmSuiteId(String value) {
this.value = value;
}
public String toString() {
return String.valueOf(value);
}
}
| 338 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/ECDSA.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
import software.amazon.cryptography.primitives.model.ECDSASignatureAlgorithm;
public class ECDSA {
private final ECDSASignatureAlgorithm curve;
protected ECDSA(BuilderImpl builder) {
this.curve = builder.curve();
}
public ECDSASignatureAlgorithm curve() {
return this.curve;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder curve(ECDSASignatureAlgorithm curve);
ECDSASignatureAlgorithm curve();
ECDSA build();
}
static class BuilderImpl implements Builder {
protected ECDSASignatureAlgorithm curve;
protected BuilderImpl() {
}
protected BuilderImpl(ECDSA model) {
this.curve = model.curve();
}
public Builder curve(ECDSASignatureAlgorithm curve) {
this.curve = curve;
return this;
}
public ECDSASignatureAlgorithm curve() {
return this.curve;
}
public ECDSA build() {
if (Objects.isNull(this.curve())) {
throw new IllegalArgumentException("Missing value for required field `curve`");
}
return new ECDSA(this);
}
}
}
| 339 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/IntermediateKeyWrapping.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class IntermediateKeyWrapping {
private final DerivationAlgorithm keyEncryptionKeyKdf;
private final DerivationAlgorithm macKeyKdf;
private final Encrypt pdkEncryptAlgorithm;
protected IntermediateKeyWrapping(BuilderImpl builder) {
this.keyEncryptionKeyKdf = builder.keyEncryptionKeyKdf();
this.macKeyKdf = builder.macKeyKdf();
this.pdkEncryptAlgorithm = builder.pdkEncryptAlgorithm();
}
public DerivationAlgorithm keyEncryptionKeyKdf() {
return this.keyEncryptionKeyKdf;
}
public DerivationAlgorithm macKeyKdf() {
return this.macKeyKdf;
}
public Encrypt pdkEncryptAlgorithm() {
return this.pdkEncryptAlgorithm;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder keyEncryptionKeyKdf(DerivationAlgorithm keyEncryptionKeyKdf);
DerivationAlgorithm keyEncryptionKeyKdf();
Builder macKeyKdf(DerivationAlgorithm macKeyKdf);
DerivationAlgorithm macKeyKdf();
Builder pdkEncryptAlgorithm(Encrypt pdkEncryptAlgorithm);
Encrypt pdkEncryptAlgorithm();
IntermediateKeyWrapping build();
}
static class BuilderImpl implements Builder {
protected DerivationAlgorithm keyEncryptionKeyKdf;
protected DerivationAlgorithm macKeyKdf;
protected Encrypt pdkEncryptAlgorithm;
protected BuilderImpl() {
}
protected BuilderImpl(IntermediateKeyWrapping model) {
this.keyEncryptionKeyKdf = model.keyEncryptionKeyKdf();
this.macKeyKdf = model.macKeyKdf();
this.pdkEncryptAlgorithm = model.pdkEncryptAlgorithm();
}
public Builder keyEncryptionKeyKdf(DerivationAlgorithm keyEncryptionKeyKdf) {
this.keyEncryptionKeyKdf = keyEncryptionKeyKdf;
return this;
}
public DerivationAlgorithm keyEncryptionKeyKdf() {
return this.keyEncryptionKeyKdf;
}
public Builder macKeyKdf(DerivationAlgorithm macKeyKdf) {
this.macKeyKdf = macKeyKdf;
return this;
}
public DerivationAlgorithm macKeyKdf() {
return this.macKeyKdf;
}
public Builder pdkEncryptAlgorithm(Encrypt pdkEncryptAlgorithm) {
this.pdkEncryptAlgorithm = pdkEncryptAlgorithm;
return this;
}
public Encrypt pdkEncryptAlgorithm() {
return this.pdkEncryptAlgorithm;
}
public IntermediateKeyWrapping build() {
if (Objects.isNull(this.keyEncryptionKeyKdf())) {
throw new IllegalArgumentException("Missing value for required field `keyEncryptionKeyKdf`");
}
if (Objects.isNull(this.macKeyKdf())) {
throw new IllegalArgumentException("Missing value for required field `macKeyKdf`");
}
if (Objects.isNull(this.pdkEncryptAlgorithm())) {
throw new IllegalArgumentException("Missing value for required field `pdkEncryptAlgorithm`");
}
return new IntermediateKeyWrapping(this);
}
}
}
| 340 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/EdkWrappingAlgorithm.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class EdkWrappingAlgorithm {
private final DIRECT_KEY_WRAPPING DIRECT_KEY_WRAPPING;
private final IntermediateKeyWrapping IntermediateKeyWrapping;
protected EdkWrappingAlgorithm(BuilderImpl builder) {
this.DIRECT_KEY_WRAPPING = builder.DIRECT_KEY_WRAPPING();
this.IntermediateKeyWrapping = builder.IntermediateKeyWrapping();
}
public DIRECT_KEY_WRAPPING DIRECT_KEY_WRAPPING() {
return this.DIRECT_KEY_WRAPPING;
}
public IntermediateKeyWrapping IntermediateKeyWrapping() {
return this.IntermediateKeyWrapping;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder DIRECT_KEY_WRAPPING(DIRECT_KEY_WRAPPING DIRECT_KEY_WRAPPING);
DIRECT_KEY_WRAPPING DIRECT_KEY_WRAPPING();
Builder IntermediateKeyWrapping(IntermediateKeyWrapping IntermediateKeyWrapping);
IntermediateKeyWrapping IntermediateKeyWrapping();
EdkWrappingAlgorithm build();
}
static class BuilderImpl implements Builder {
protected DIRECT_KEY_WRAPPING DIRECT_KEY_WRAPPING;
protected IntermediateKeyWrapping IntermediateKeyWrapping;
protected BuilderImpl() {
}
protected BuilderImpl(EdkWrappingAlgorithm model) {
this.DIRECT_KEY_WRAPPING = model.DIRECT_KEY_WRAPPING();
this.IntermediateKeyWrapping = model.IntermediateKeyWrapping();
}
public Builder DIRECT_KEY_WRAPPING(DIRECT_KEY_WRAPPING DIRECT_KEY_WRAPPING) {
this.DIRECT_KEY_WRAPPING = DIRECT_KEY_WRAPPING;
return this;
}
public DIRECT_KEY_WRAPPING DIRECT_KEY_WRAPPING() {
return this.DIRECT_KEY_WRAPPING;
}
public Builder IntermediateKeyWrapping(IntermediateKeyWrapping IntermediateKeyWrapping) {
this.IntermediateKeyWrapping = IntermediateKeyWrapping;
return this;
}
public IntermediateKeyWrapping IntermediateKeyWrapping() {
return this.IntermediateKeyWrapping;
}
public EdkWrappingAlgorithm build() {
if (!onlyOneNonNull()) {
throw new IllegalArgumentException("`EdkWrappingAlgorithm` is a Union. A Union MUST have one and only one value set.");
}
return new EdkWrappingAlgorithm(this);
}
private boolean onlyOneNonNull() {
Object[] allValues = {this.DIRECT_KEY_WRAPPING, this.IntermediateKeyWrapping};
boolean haveOneNonNull = false;
for (Object o : allValues) {
if (Objects.nonNull(o)) {
if (haveOneNonNull) {
return false;
}
haveOneNonNull = true;
}
}
return haveOneNonNull;
}
}
}
| 341 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/InvalidAlgorithmSuiteInfoOnEncrypt.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class InvalidAlgorithmSuiteInfoOnEncrypt extends RuntimeException {
protected InvalidAlgorithmSuiteInfoOnEncrypt(BuilderImpl builder) {
super(messageFromBuilder(builder), builder.cause());
}
private static String messageFromBuilder(Builder builder) {
if (builder.message() != null) {
return builder.message();
}
if (builder.cause() != null) {
return builder.cause().getMessage();
}
return null;
}
/**
* See {@link Throwable#getMessage()}.
*/
public String message() {
return this.getMessage();
}
/**
* See {@link Throwable#getCause()}.
*/
public Throwable cause() {
return this.getCause();
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param message The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
Builder message(String message);
/**
* @return The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
String message();
/**
* @param cause The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Builder cause(Throwable cause);
/**
* @return The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Throwable cause();
InvalidAlgorithmSuiteInfoOnEncrypt build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected BuilderImpl() {
}
protected BuilderImpl(InvalidAlgorithmSuiteInfoOnEncrypt model) {
this.message = model.message();
this.cause = model.cause();
}
public Builder message(String message) {
this.message = message;
return this;
}
public String message() {
return this.message;
}
public Builder cause(Throwable cause) {
this.cause = cause;
return this;
}
public Throwable cause() {
return this.cause;
}
public InvalidAlgorithmSuiteInfoOnEncrypt build() {
if (Objects.isNull(this.message())) {
throw new IllegalArgumentException("Missing value for required field `message`");
}
return new InvalidAlgorithmSuiteInfoOnEncrypt(this);
}
}
}
| 342 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CacheType.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class CacheType {
/**
* The best choice for most situations. Probably a StormTrackingCache.
*/
private final DefaultCache Default;
/**
* Nothing should ever be cached.
*/
private final NoCache No;
/**
* A cache that is NOT safe for use in a multi threaded environment.
*/
private final SingleThreadedCache SingleThreaded;
/**
* A cache that is safe for use in a multi threaded environment, but no extra functionality.
*/
private final MultiThreadedCache MultiThreaded;
/**
* A cache that is safe for use in a multi threaded environment,
* and tries to prevent redundant or overly parallel backend calls.
*/
private final StormTrackingCache StormTracking;
protected CacheType(BuilderImpl builder) {
this.Default = builder.Default();
this.No = builder.No();
this.SingleThreaded = builder.SingleThreaded();
this.MultiThreaded = builder.MultiThreaded();
this.StormTracking = builder.StormTracking();
}
/**
* @return The best choice for most situations. Probably a StormTrackingCache.
*/
public DefaultCache Default() {
return this.Default;
}
/**
* @return Nothing should ever be cached.
*/
public NoCache No() {
return this.No;
}
/**
* @return A cache that is NOT safe for use in a multi threaded environment.
*/
public SingleThreadedCache SingleThreaded() {
return this.SingleThreaded;
}
/**
* @return A cache that is safe for use in a multi threaded environment, but no extra functionality.
*/
public MultiThreadedCache MultiThreaded() {
return this.MultiThreaded;
}
/**
* @return A cache that is safe for use in a multi threaded environment,
* and tries to prevent redundant or overly parallel backend calls.
*/
public StormTrackingCache StormTracking() {
return this.StormTracking;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param Default The best choice for most situations. Probably a StormTrackingCache.
*/
Builder Default(DefaultCache Default);
/**
* @return The best choice for most situations. Probably a StormTrackingCache.
*/
DefaultCache Default();
/**
* @param No Nothing should ever be cached.
*/
Builder No(NoCache No);
/**
* @return Nothing should ever be cached.
*/
NoCache No();
/**
* @param SingleThreaded A cache that is NOT safe for use in a multi threaded environment.
*/
Builder SingleThreaded(SingleThreadedCache SingleThreaded);
/**
* @return A cache that is NOT safe for use in a multi threaded environment.
*/
SingleThreadedCache SingleThreaded();
/**
* @param MultiThreaded A cache that is safe for use in a multi threaded environment, but no extra functionality.
*/
Builder MultiThreaded(MultiThreadedCache MultiThreaded);
/**
* @return A cache that is safe for use in a multi threaded environment, but no extra functionality.
*/
MultiThreadedCache MultiThreaded();
/**
* @param StormTracking A cache that is safe for use in a multi threaded environment,
* and tries to prevent redundant or overly parallel backend calls.
*/
Builder StormTracking(StormTrackingCache StormTracking);
/**
* @return A cache that is safe for use in a multi threaded environment,
* and tries to prevent redundant or overly parallel backend calls.
*/
StormTrackingCache StormTracking();
CacheType build();
}
static class BuilderImpl implements Builder {
protected DefaultCache Default;
protected NoCache No;
protected SingleThreadedCache SingleThreaded;
protected MultiThreadedCache MultiThreaded;
protected StormTrackingCache StormTracking;
protected BuilderImpl() {
}
protected BuilderImpl(CacheType model) {
this.Default = model.Default();
this.No = model.No();
this.SingleThreaded = model.SingleThreaded();
this.MultiThreaded = model.MultiThreaded();
this.StormTracking = model.StormTracking();
}
public Builder Default(DefaultCache Default) {
this.Default = Default;
return this;
}
public DefaultCache Default() {
return this.Default;
}
public Builder No(NoCache No) {
this.No = No;
return this;
}
public NoCache No() {
return this.No;
}
public Builder SingleThreaded(SingleThreadedCache SingleThreaded) {
this.SingleThreaded = SingleThreaded;
return this;
}
public SingleThreadedCache SingleThreaded() {
return this.SingleThreaded;
}
public Builder MultiThreaded(MultiThreadedCache MultiThreaded) {
this.MultiThreaded = MultiThreaded;
return this;
}
public MultiThreadedCache MultiThreaded() {
return this.MultiThreaded;
}
public Builder StormTracking(StormTrackingCache StormTracking) {
this.StormTracking = StormTracking;
return this;
}
public StormTrackingCache StormTracking() {
return this.StormTracking;
}
public CacheType build() {
if (!onlyOneNonNull()) {
throw new IllegalArgumentException("`CacheType` is a Union. A Union MUST have one and only one value set.");
}
return new CacheType(this);
}
private boolean onlyOneNonNull() {
Object[] allValues = {this.Default, this.No, this.SingleThreaded, this.MultiThreaded, this.StormTracking};
boolean haveOneNonNull = false;
for (Object o : allValues) {
if (Objects.nonNull(o)) {
if (haveOneNonNull) {
return false;
}
haveOneNonNull = true;
}
}
return haveOneNonNull;
}
}
}
| 343 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/PaddingScheme.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
public enum PaddingScheme {
PKCS1("PKCS1"),
OAEP_SHA1_MGF1("OAEP_SHA1_MGF1"),
OAEP_SHA256_MGF1("OAEP_SHA256_MGF1"),
OAEP_SHA384_MGF1("OAEP_SHA384_MGF1"),
OAEP_SHA512_MGF1("OAEP_SHA512_MGF1");
private final String value;
private PaddingScheme(String value) {
this.value = value;
}
public String toString() {
return String.valueOf(value);
}
}
| 344 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/OnEncryptOutput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class OnEncryptOutput {
private final EncryptionMaterials materials;
protected OnEncryptOutput(BuilderImpl builder) {
this.materials = builder.materials();
}
public EncryptionMaterials materials() {
return this.materials;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder materials(EncryptionMaterials materials);
EncryptionMaterials materials();
OnEncryptOutput build();
}
static class BuilderImpl implements Builder {
protected EncryptionMaterials materials;
protected BuilderImpl() {
}
protected BuilderImpl(OnEncryptOutput model) {
this.materials = model.materials();
}
public Builder materials(EncryptionMaterials materials) {
this.materials = materials;
return this;
}
public EncryptionMaterials materials() {
return this.materials;
}
public OnEncryptOutput build() {
if (Objects.isNull(this.materials())) {
throw new IllegalArgumentException("Missing value for required field `materials`");
}
return new OnEncryptOutput(this);
}
}
}
| 345 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CreateRequiredEncryptionContextCMMInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.List;
import java.util.Objects;
import software.amazon.cryptography.materialproviders.CryptographicMaterialsManager;
import software.amazon.cryptography.materialproviders.ICryptographicMaterialsManager;
import software.amazon.cryptography.materialproviders.IKeyring;
import software.amazon.cryptography.materialproviders.Keyring;
/**
* Inputs for creating an Required Encryption Context Cryptographic Materials Manager.
*/
public class CreateRequiredEncryptionContextCMMInput {
/**
* The Cryprographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryprographic Materials Manager must be specified.
*/
private final ICryptographicMaterialsManager underlyingCMM;
/**
* The Keyring that the created Cryprographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryprographic Materials Manager must be specified as input.
*/
private final IKeyring keyring;
/**
* A list of Encryption Context keys which are required to be supplied during encryption and decryption, and correspond to Encryption Context key-value pairs which are not stored on the resulting message.
*/
private final List<String> requiredEncryptionContextKeys;
protected CreateRequiredEncryptionContextCMMInput(BuilderImpl builder) {
this.underlyingCMM = builder.underlyingCMM();
this.keyring = builder.keyring();
this.requiredEncryptionContextKeys = builder.requiredEncryptionContextKeys();
}
/**
* @return The Cryprographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryprographic Materials Manager must be specified.
*/
public ICryptographicMaterialsManager underlyingCMM() {
return this.underlyingCMM;
}
/**
* @return The Keyring that the created Cryprographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryprographic Materials Manager must be specified as input.
*/
public IKeyring keyring() {
return this.keyring;
}
/**
* @return A list of Encryption Context keys which are required to be supplied during encryption and decryption, and correspond to Encryption Context key-value pairs which are not stored on the resulting message.
*/
public List<String> requiredEncryptionContextKeys() {
return this.requiredEncryptionContextKeys;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param underlyingCMM The Cryprographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryprographic Materials Manager must be specified.
*/
Builder underlyingCMM(ICryptographicMaterialsManager underlyingCMM);
/**
* @return The Cryprographic Materials Manager that the created Required Encryption Context Cryptographic Materials Manager will delegate to. Either a Keyring or underlying Cryprographic Materials Manager must be specified.
*/
ICryptographicMaterialsManager underlyingCMM();
/**
* @param keyring The Keyring that the created Cryprographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryprographic Materials Manager must be specified as input.
*/
Builder keyring(IKeyring keyring);
/**
* @return The Keyring that the created Cryprographic Materials Manager will use to wrap data keys. The created Required Encryption Context CMM will delegate to a Default Cryptographic Materials Manager created with this Keyring. Either a Keyring or an underlying Cryprographic Materials Manager must be specified as input.
*/
IKeyring keyring();
/**
* @param requiredEncryptionContextKeys A list of Encryption Context keys which are required to be supplied during encryption and decryption, and correspond to Encryption Context key-value pairs which are not stored on the resulting message.
*/
Builder requiredEncryptionContextKeys(List<String> requiredEncryptionContextKeys);
/**
* @return A list of Encryption Context keys which are required to be supplied during encryption and decryption, and correspond to Encryption Context key-value pairs which are not stored on the resulting message.
*/
List<String> requiredEncryptionContextKeys();
CreateRequiredEncryptionContextCMMInput build();
}
static class BuilderImpl implements Builder {
protected ICryptographicMaterialsManager underlyingCMM;
protected IKeyring keyring;
protected List<String> requiredEncryptionContextKeys;
protected BuilderImpl() {
}
protected BuilderImpl(CreateRequiredEncryptionContextCMMInput model) {
this.underlyingCMM = model.underlyingCMM();
this.keyring = model.keyring();
this.requiredEncryptionContextKeys = model.requiredEncryptionContextKeys();
}
public Builder underlyingCMM(ICryptographicMaterialsManager underlyingCMM) {
this.underlyingCMM = CryptographicMaterialsManager.wrap(underlyingCMM);
return this;
}
public ICryptographicMaterialsManager underlyingCMM() {
return this.underlyingCMM;
}
public Builder keyring(IKeyring keyring) {
this.keyring = Keyring.wrap(keyring);
return this;
}
public IKeyring keyring() {
return this.keyring;
}
public Builder requiredEncryptionContextKeys(List<String> requiredEncryptionContextKeys) {
this.requiredEncryptionContextKeys = requiredEncryptionContextKeys;
return this;
}
public List<String> requiredEncryptionContextKeys() {
return this.requiredEncryptionContextKeys;
}
public CreateRequiredEncryptionContextCMMInput build() {
if (Objects.isNull(this.requiredEncryptionContextKeys())) {
throw new IllegalArgumentException("Missing value for required field `requiredEncryptionContextKeys`");
}
return new CreateRequiredEncryptionContextCMMInput(this);
}
}
}
| 346 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CreateCryptographicMaterialsCacheInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class CreateCryptographicMaterialsCacheInput {
/**
* Which type of local cache to use.
*/
private final CacheType cache;
protected CreateCryptographicMaterialsCacheInput(BuilderImpl builder) {
this.cache = builder.cache();
}
/**
* @return Which type of local cache to use.
*/
public CacheType cache() {
return this.cache;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param cache Which type of local cache to use.
*/
Builder cache(CacheType cache);
/**
* @return Which type of local cache to use.
*/
CacheType cache();
CreateCryptographicMaterialsCacheInput build();
}
static class BuilderImpl implements Builder {
protected CacheType cache;
protected BuilderImpl() {
}
protected BuilderImpl(CreateCryptographicMaterialsCacheInput model) {
this.cache = model.cache();
}
public Builder cache(CacheType cache) {
this.cache = cache;
return this;
}
public CacheType cache() {
return this.cache;
}
public CreateCryptographicMaterialsCacheInput build() {
if (Objects.isNull(this.cache())) {
throw new IllegalArgumentException("Missing value for required field `cache`");
}
return new CreateCryptographicMaterialsCacheInput(this);
}
}
}
| 347 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/DeleteCacheEntryInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class DeleteCacheEntryInput {
private final ByteBuffer identifier;
protected DeleteCacheEntryInput(BuilderImpl builder) {
this.identifier = builder.identifier();
}
public ByteBuffer identifier() {
return this.identifier;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder identifier(ByteBuffer identifier);
ByteBuffer identifier();
DeleteCacheEntryInput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer identifier;
protected BuilderImpl() {
}
protected BuilderImpl(DeleteCacheEntryInput model) {
this.identifier = model.identifier();
}
public Builder identifier(ByteBuffer identifier) {
this.identifier = identifier;
return this;
}
public ByteBuffer identifier() {
return this.identifier;
}
public DeleteCacheEntryInput build() {
if (Objects.isNull(this.identifier())) {
throw new IllegalArgumentException("Missing value for required field `identifier`");
}
return new DeleteCacheEntryInput(this);
}
}
}
| 348 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/Materials.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
import software.amazon.cryptography.keystore.model.BeaconKeyMaterials;
import software.amazon.cryptography.keystore.model.BranchKeyMaterials;
public class Materials {
private final EncryptionMaterials Encryption;
private final DecryptionMaterials Decryption;
private final BranchKeyMaterials BranchKey;
private final BeaconKeyMaterials BeaconKey;
protected Materials(BuilderImpl builder) {
this.Encryption = builder.Encryption();
this.Decryption = builder.Decryption();
this.BranchKey = builder.BranchKey();
this.BeaconKey = builder.BeaconKey();
}
public EncryptionMaterials Encryption() {
return this.Encryption;
}
public DecryptionMaterials Decryption() {
return this.Decryption;
}
public BranchKeyMaterials BranchKey() {
return this.BranchKey;
}
public BeaconKeyMaterials BeaconKey() {
return this.BeaconKey;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder Encryption(EncryptionMaterials Encryption);
EncryptionMaterials Encryption();
Builder Decryption(DecryptionMaterials Decryption);
DecryptionMaterials Decryption();
Builder BranchKey(BranchKeyMaterials BranchKey);
BranchKeyMaterials BranchKey();
Builder BeaconKey(BeaconKeyMaterials BeaconKey);
BeaconKeyMaterials BeaconKey();
Materials build();
}
static class BuilderImpl implements Builder {
protected EncryptionMaterials Encryption;
protected DecryptionMaterials Decryption;
protected BranchKeyMaterials BranchKey;
protected BeaconKeyMaterials BeaconKey;
protected BuilderImpl() {
}
protected BuilderImpl(Materials model) {
this.Encryption = model.Encryption();
this.Decryption = model.Decryption();
this.BranchKey = model.BranchKey();
this.BeaconKey = model.BeaconKey();
}
public Builder Encryption(EncryptionMaterials Encryption) {
this.Encryption = Encryption;
return this;
}
public EncryptionMaterials Encryption() {
return this.Encryption;
}
public Builder Decryption(DecryptionMaterials Decryption) {
this.Decryption = Decryption;
return this;
}
public DecryptionMaterials Decryption() {
return this.Decryption;
}
public Builder BranchKey(BranchKeyMaterials BranchKey) {
this.BranchKey = BranchKey;
return this;
}
public BranchKeyMaterials BranchKey() {
return this.BranchKey;
}
public Builder BeaconKey(BeaconKeyMaterials BeaconKey) {
this.BeaconKey = BeaconKey;
return this;
}
public BeaconKeyMaterials BeaconKey() {
return this.BeaconKey;
}
public Materials build() {
if (!onlyOneNonNull()) {
throw new IllegalArgumentException("`Materials` is a Union. A Union MUST have one and only one value set.");
}
return new Materials(this);
}
private boolean onlyOneNonNull() {
Object[] allValues = {this.Encryption, this.Decryption, this.BranchKey, this.BeaconKey};
boolean haveOneNonNull = false;
for (Object o : allValues) {
if (Objects.nonNull(o)) {
if (haveOneNonNull) {
return false;
}
haveOneNonNull = true;
}
}
return haveOneNonNull;
}
}
}
| 349 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CreateRawRsaKeyringInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.nio.ByteBuffer;
import java.util.Objects;
/**
* Inputs for creating a Raw RAW Keyring.
*/
public class CreateRawRsaKeyringInput {
/**
* A namespace associated with this wrapping key.
*/
private final String keyNamespace;
/**
* A name associated with this wrapping key.
*/
private final String keyName;
/**
* The RSA padding scheme to use with this keyring.
*/
private final PaddingScheme paddingScheme;
/**
* The public RSA Key responsible for wrapping data keys, as a UTF8 encoded, PEM encoded X.509 SubjectPublicKeyInfo structure. If not specified, this Keyring cannot be used on encrypt. A public key and/or a private key must be specified.
*/
private final ByteBuffer publicKey;
/**
* The private RSA Key responsible for wrapping data keys, as a UTF8 encoded, PEM encoded PKCS #8 PrivateKeyInfo structure. If not specified, this Keyring cannot be used on decrypt. A public key and/or a private key must be specified.
*/
private final ByteBuffer privateKey;
protected CreateRawRsaKeyringInput(BuilderImpl builder) {
this.keyNamespace = builder.keyNamespace();
this.keyName = builder.keyName();
this.paddingScheme = builder.paddingScheme();
this.publicKey = builder.publicKey();
this.privateKey = builder.privateKey();
}
/**
* @return A namespace associated with this wrapping key.
*/
public String keyNamespace() {
return this.keyNamespace;
}
/**
* @return A name associated with this wrapping key.
*/
public String keyName() {
return this.keyName;
}
/**
* @return The RSA padding scheme to use with this keyring.
*/
public PaddingScheme paddingScheme() {
return this.paddingScheme;
}
/**
* @return The public RSA Key responsible for wrapping data keys, as a UTF8 encoded, PEM encoded X.509 SubjectPublicKeyInfo structure. If not specified, this Keyring cannot be used on encrypt. A public key and/or a private key must be specified.
*/
public ByteBuffer publicKey() {
return this.publicKey;
}
/**
* @return The private RSA Key responsible for wrapping data keys, as a UTF8 encoded, PEM encoded PKCS #8 PrivateKeyInfo structure. If not specified, this Keyring cannot be used on decrypt. A public key and/or a private key must be specified.
*/
public ByteBuffer privateKey() {
return this.privateKey;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param keyNamespace A namespace associated with this wrapping key.
*/
Builder keyNamespace(String keyNamespace);
/**
* @return A namespace associated with this wrapping key.
*/
String keyNamespace();
/**
* @param keyName A name associated with this wrapping key.
*/
Builder keyName(String keyName);
/**
* @return A name associated with this wrapping key.
*/
String keyName();
/**
* @param paddingScheme The RSA padding scheme to use with this keyring.
*/
Builder paddingScheme(PaddingScheme paddingScheme);
/**
* @return The RSA padding scheme to use with this keyring.
*/
PaddingScheme paddingScheme();
/**
* @param publicKey The public RSA Key responsible for wrapping data keys, as a UTF8 encoded, PEM encoded X.509 SubjectPublicKeyInfo structure. If not specified, this Keyring cannot be used on encrypt. A public key and/or a private key must be specified.
*/
Builder publicKey(ByteBuffer publicKey);
/**
* @return The public RSA Key responsible for wrapping data keys, as a UTF8 encoded, PEM encoded X.509 SubjectPublicKeyInfo structure. If not specified, this Keyring cannot be used on encrypt. A public key and/or a private key must be specified.
*/
ByteBuffer publicKey();
/**
* @param privateKey The private RSA Key responsible for wrapping data keys, as a UTF8 encoded, PEM encoded PKCS #8 PrivateKeyInfo structure. If not specified, this Keyring cannot be used on decrypt. A public key and/or a private key must be specified.
*/
Builder privateKey(ByteBuffer privateKey);
/**
* @return The private RSA Key responsible for wrapping data keys, as a UTF8 encoded, PEM encoded PKCS #8 PrivateKeyInfo structure. If not specified, this Keyring cannot be used on decrypt. A public key and/or a private key must be specified.
*/
ByteBuffer privateKey();
CreateRawRsaKeyringInput build();
}
static class BuilderImpl implements Builder {
protected String keyNamespace;
protected String keyName;
protected PaddingScheme paddingScheme;
protected ByteBuffer publicKey;
protected ByteBuffer privateKey;
protected BuilderImpl() {
}
protected BuilderImpl(CreateRawRsaKeyringInput model) {
this.keyNamespace = model.keyNamespace();
this.keyName = model.keyName();
this.paddingScheme = model.paddingScheme();
this.publicKey = model.publicKey();
this.privateKey = model.privateKey();
}
public Builder keyNamespace(String keyNamespace) {
this.keyNamespace = keyNamespace;
return this;
}
public String keyNamespace() {
return this.keyNamespace;
}
public Builder keyName(String keyName) {
this.keyName = keyName;
return this;
}
public String keyName() {
return this.keyName;
}
public Builder paddingScheme(PaddingScheme paddingScheme) {
this.paddingScheme = paddingScheme;
return this;
}
public PaddingScheme paddingScheme() {
return this.paddingScheme;
}
public Builder publicKey(ByteBuffer publicKey) {
this.publicKey = publicKey;
return this;
}
public ByteBuffer publicKey() {
return this.publicKey;
}
public Builder privateKey(ByteBuffer privateKey) {
this.privateKey = privateKey;
return this;
}
public ByteBuffer privateKey() {
return this.privateKey;
}
public CreateRawRsaKeyringInput build() {
if (Objects.isNull(this.keyNamespace())) {
throw new IllegalArgumentException("Missing value for required field `keyNamespace`");
}
if (Objects.isNull(this.keyName())) {
throw new IllegalArgumentException("Missing value for required field `keyName`");
}
if (Objects.isNull(this.paddingScheme())) {
throw new IllegalArgumentException("Missing value for required field `paddingScheme`");
}
return new CreateRawRsaKeyringInput(this);
}
}
}
| 350 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/GetEncryptionMaterialsInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.List;
import java.util.Map;
import java.util.Objects;
public class GetEncryptionMaterialsInput {
private final Map<String, String> encryptionContext;
private final CommitmentPolicy commitmentPolicy;
private final AlgorithmSuiteId algorithmSuiteId;
private final Long maxPlaintextLength;
private final List<String> requiredEncryptionContextKeys;
protected GetEncryptionMaterialsInput(BuilderImpl builder) {
this.encryptionContext = builder.encryptionContext();
this.commitmentPolicy = builder.commitmentPolicy();
this.algorithmSuiteId = builder.algorithmSuiteId();
this.maxPlaintextLength = builder.maxPlaintextLength();
this.requiredEncryptionContextKeys = builder.requiredEncryptionContextKeys();
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public CommitmentPolicy commitmentPolicy() {
return this.commitmentPolicy;
}
public AlgorithmSuiteId algorithmSuiteId() {
return this.algorithmSuiteId;
}
public Long maxPlaintextLength() {
return this.maxPlaintextLength;
}
public List<String> requiredEncryptionContextKeys() {
return this.requiredEncryptionContextKeys;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder encryptionContext(Map<String, String> encryptionContext);
Map<String, String> encryptionContext();
Builder commitmentPolicy(CommitmentPolicy commitmentPolicy);
CommitmentPolicy commitmentPolicy();
Builder algorithmSuiteId(AlgorithmSuiteId algorithmSuiteId);
AlgorithmSuiteId algorithmSuiteId();
Builder maxPlaintextLength(Long maxPlaintextLength);
Long maxPlaintextLength();
Builder requiredEncryptionContextKeys(List<String> requiredEncryptionContextKeys);
List<String> requiredEncryptionContextKeys();
GetEncryptionMaterialsInput build();
}
static class BuilderImpl implements Builder {
protected Map<String, String> encryptionContext;
protected CommitmentPolicy commitmentPolicy;
protected AlgorithmSuiteId algorithmSuiteId;
protected Long maxPlaintextLength;
protected List<String> requiredEncryptionContextKeys;
protected BuilderImpl() {
}
protected BuilderImpl(GetEncryptionMaterialsInput model) {
this.encryptionContext = model.encryptionContext();
this.commitmentPolicy = model.commitmentPolicy();
this.algorithmSuiteId = model.algorithmSuiteId();
this.maxPlaintextLength = model.maxPlaintextLength();
this.requiredEncryptionContextKeys = model.requiredEncryptionContextKeys();
}
public Builder encryptionContext(Map<String, String> encryptionContext) {
this.encryptionContext = encryptionContext;
return this;
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public Builder commitmentPolicy(CommitmentPolicy commitmentPolicy) {
this.commitmentPolicy = commitmentPolicy;
return this;
}
public CommitmentPolicy commitmentPolicy() {
return this.commitmentPolicy;
}
public Builder algorithmSuiteId(AlgorithmSuiteId algorithmSuiteId) {
this.algorithmSuiteId = algorithmSuiteId;
return this;
}
public AlgorithmSuiteId algorithmSuiteId() {
return this.algorithmSuiteId;
}
public Builder maxPlaintextLength(Long maxPlaintextLength) {
this.maxPlaintextLength = maxPlaintextLength;
return this;
}
public Long maxPlaintextLength() {
return this.maxPlaintextLength;
}
public Builder requiredEncryptionContextKeys(List<String> requiredEncryptionContextKeys) {
this.requiredEncryptionContextKeys = requiredEncryptionContextKeys;
return this;
}
public List<String> requiredEncryptionContextKeys() {
return this.requiredEncryptionContextKeys;
}
public GetEncryptionMaterialsInput build() {
if (Objects.isNull(this.encryptionContext())) {
throw new IllegalArgumentException("Missing value for required field `encryptionContext`");
}
if (Objects.isNull(this.commitmentPolicy())) {
throw new IllegalArgumentException("Missing value for required field `commitmentPolicy`");
}
return new GetEncryptionMaterialsInput(this);
}
}
}
| 351 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CreateAwsKmsMrkDiscoveryMultiKeyringInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.List;
import java.util.Objects;
import software.amazon.cryptography.materialproviders.ClientSupplier;
import software.amazon.cryptography.materialproviders.IClientSupplier;
/**
* Inputs for for creating a AWS KMS MRK Discovery Multi-Keyring.
*/
public class CreateAwsKmsMrkDiscoveryMultiKeyringInput {
/**
* The list of regions this Keyring will creates KMS clients for.
*/
private final List<String> regions;
/**
* A filter which restricts which KMS Keys this Keyring may attempt to decrypt with by AWS partition and account.
*/
private final DiscoveryFilter discoveryFilter;
/**
* The Client Supplier which will be used to get KMS Clients for use with this Keyring. If not specified on input, a Default Client Supplier is created which creates a KMS Client for each region in the 'regions' input.
*/
private final IClientSupplier clientSupplier;
/**
* A list of grant tokens to be used when calling KMS.
*/
private final List<String> grantTokens;
protected CreateAwsKmsMrkDiscoveryMultiKeyringInput(BuilderImpl builder) {
this.regions = builder.regions();
this.discoveryFilter = builder.discoveryFilter();
this.clientSupplier = builder.clientSupplier();
this.grantTokens = builder.grantTokens();
}
/**
* @return The list of regions this Keyring will creates KMS clients for.
*/
public List<String> regions() {
return this.regions;
}
/**
* @return A filter which restricts which KMS Keys this Keyring may attempt to decrypt with by AWS partition and account.
*/
public DiscoveryFilter discoveryFilter() {
return this.discoveryFilter;
}
/**
* @return The Client Supplier which will be used to get KMS Clients for use with this Keyring. If not specified on input, a Default Client Supplier is created which creates a KMS Client for each region in the 'regions' input.
*/
public IClientSupplier clientSupplier() {
return this.clientSupplier;
}
/**
* @return A list of grant tokens to be used when calling KMS.
*/
public List<String> grantTokens() {
return this.grantTokens;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param regions The list of regions this Keyring will creates KMS clients for.
*/
Builder regions(List<String> regions);
/**
* @return The list of regions this Keyring will creates KMS clients for.
*/
List<String> regions();
/**
* @param discoveryFilter A filter which restricts which KMS Keys this Keyring may attempt to decrypt with by AWS partition and account.
*/
Builder discoveryFilter(DiscoveryFilter discoveryFilter);
/**
* @return A filter which restricts which KMS Keys this Keyring may attempt to decrypt with by AWS partition and account.
*/
DiscoveryFilter discoveryFilter();
/**
* @param clientSupplier The Client Supplier which will be used to get KMS Clients for use with this Keyring. If not specified on input, a Default Client Supplier is created which creates a KMS Client for each region in the 'regions' input.
*/
Builder clientSupplier(IClientSupplier clientSupplier);
/**
* @return The Client Supplier which will be used to get KMS Clients for use with this Keyring. If not specified on input, a Default Client Supplier is created which creates a KMS Client for each region in the 'regions' input.
*/
IClientSupplier clientSupplier();
/**
* @param grantTokens A list of grant tokens to be used when calling KMS.
*/
Builder grantTokens(List<String> grantTokens);
/**
* @return A list of grant tokens to be used when calling KMS.
*/
List<String> grantTokens();
CreateAwsKmsMrkDiscoveryMultiKeyringInput build();
}
static class BuilderImpl implements Builder {
protected List<String> regions;
protected DiscoveryFilter discoveryFilter;
protected IClientSupplier clientSupplier;
protected List<String> grantTokens;
protected BuilderImpl() {
}
protected BuilderImpl(CreateAwsKmsMrkDiscoveryMultiKeyringInput model) {
this.regions = model.regions();
this.discoveryFilter = model.discoveryFilter();
this.clientSupplier = model.clientSupplier();
this.grantTokens = model.grantTokens();
}
public Builder regions(List<String> regions) {
this.regions = regions;
return this;
}
public List<String> regions() {
return this.regions;
}
public Builder discoveryFilter(DiscoveryFilter discoveryFilter) {
this.discoveryFilter = discoveryFilter;
return this;
}
public DiscoveryFilter discoveryFilter() {
return this.discoveryFilter;
}
public Builder clientSupplier(IClientSupplier clientSupplier) {
this.clientSupplier = ClientSupplier.wrap(clientSupplier);
return this;
}
public IClientSupplier clientSupplier() {
return this.clientSupplier;
}
public Builder grantTokens(List<String> grantTokens) {
this.grantTokens = grantTokens;
return this;
}
public List<String> grantTokens() {
return this.grantTokens;
}
public CreateAwsKmsMrkDiscoveryMultiKeyringInput build() {
if (Objects.isNull(this.regions())) {
throw new IllegalArgumentException("Missing value for required field `regions`");
}
return new CreateAwsKmsMrkDiscoveryMultiKeyringInput(this);
}
}
}
| 352 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/IDENTITY.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
public class IDENTITY {
protected IDENTITY(BuilderImpl builder) {
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
IDENTITY build();
}
static class BuilderImpl implements Builder {
protected BuilderImpl() {
}
protected BuilderImpl(IDENTITY model) {
}
public IDENTITY build() {
return new IDENTITY(this);
}
}
}
| 353 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/OpaqueError.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
public class OpaqueError extends RuntimeException {
/**
* The unexpected object encountered. It MIGHT BE an Exception, but that is not guaranteed.
*/
private final Object obj;
protected OpaqueError(BuilderImpl builder) {
super(messageFromBuilder(builder), builder.cause());
this.obj = builder.obj();
}
private static String messageFromBuilder(Builder builder) {
if (builder.message() != null) {
return builder.message();
}
if (builder.cause() != null) {
return builder.cause().getMessage();
}
return null;
}
/**
* See {@link Throwable#getMessage()}.
*/
public String message() {
return this.getMessage();
}
/**
* See {@link Throwable#getCause()}.
*/
public Throwable cause() {
return this.getCause();
}
/**
* @return The unexpected object encountered. It MIGHT BE an Exception, but that is not guaranteed.
*/
public Object obj() {
return this.obj;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param message The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
Builder message(String message);
/**
* @return The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
String message();
/**
* @param cause The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Builder cause(Throwable cause);
/**
* @return The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Throwable cause();
/**
* @param obj The unexpected object encountered. It MIGHT BE an Exception, but that is not guaranteed.
*/
Builder obj(Object obj);
/**
* @return The unexpected object encountered. It MIGHT BE an Exception, but that is not guaranteed.
*/
Object obj();
OpaqueError build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected Object obj;
protected BuilderImpl() {
}
protected BuilderImpl(OpaqueError model) {
this.cause = model.getCause();
this.message = model.getMessage();
this.obj = model.obj();
}
public Builder message(String message) {
this.message = message;
return this;
}
public String message() {
return this.message;
}
public Builder cause(Throwable cause) {
this.cause = cause;
return this;
}
public Throwable cause() {
return this.cause;
}
public Builder obj(Object obj) {
this.obj = obj;
return this;
}
public Object obj() {
return this.obj;
}
public OpaqueError build() {
if (this.obj != null && this.cause == null && this.obj instanceof Throwable) {
this.cause = (Throwable) this.obj;
} else if (this.obj == null && this.cause != null) {
this.obj = this.cause;
}
return new OpaqueError(this);
}
}
}
| 354 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/NoCache.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
/**
* Nothing should ever be cached.
*/
public class NoCache {
protected NoCache(BuilderImpl builder) {
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
NoCache build();
}
static class BuilderImpl implements Builder {
protected BuilderImpl() {
}
protected BuilderImpl(NoCache model) {
}
public NoCache build() {
return new NoCache(this);
}
}
}
| 355 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/DBECommitmentPolicy.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
public enum DBECommitmentPolicy {
REQUIRE_ENCRYPT_REQUIRE_DECRYPT("REQUIRE_ENCRYPT_REQUIRE_DECRYPT");
private final String value;
private DBECommitmentPolicy(String value) {
this.value = value;
}
public String toString() {
return String.valueOf(value);
}
}
| 356 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/InitializeEncryptionMaterialsInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.Map;
import java.util.Objects;
public class InitializeEncryptionMaterialsInput {
private final AlgorithmSuiteId algorithmSuiteId;
private final Map<String, String> encryptionContext;
private final List<String> requiredEncryptionContextKeys;
private final ByteBuffer signingKey;
private final ByteBuffer verificationKey;
protected InitializeEncryptionMaterialsInput(BuilderImpl builder) {
this.algorithmSuiteId = builder.algorithmSuiteId();
this.encryptionContext = builder.encryptionContext();
this.requiredEncryptionContextKeys = builder.requiredEncryptionContextKeys();
this.signingKey = builder.signingKey();
this.verificationKey = builder.verificationKey();
}
public AlgorithmSuiteId algorithmSuiteId() {
return this.algorithmSuiteId;
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public List<String> requiredEncryptionContextKeys() {
return this.requiredEncryptionContextKeys;
}
public ByteBuffer signingKey() {
return this.signingKey;
}
public ByteBuffer verificationKey() {
return this.verificationKey;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder algorithmSuiteId(AlgorithmSuiteId algorithmSuiteId);
AlgorithmSuiteId algorithmSuiteId();
Builder encryptionContext(Map<String, String> encryptionContext);
Map<String, String> encryptionContext();
Builder requiredEncryptionContextKeys(List<String> requiredEncryptionContextKeys);
List<String> requiredEncryptionContextKeys();
Builder signingKey(ByteBuffer signingKey);
ByteBuffer signingKey();
Builder verificationKey(ByteBuffer verificationKey);
ByteBuffer verificationKey();
InitializeEncryptionMaterialsInput build();
}
static class BuilderImpl implements Builder {
protected AlgorithmSuiteId algorithmSuiteId;
protected Map<String, String> encryptionContext;
protected List<String> requiredEncryptionContextKeys;
protected ByteBuffer signingKey;
protected ByteBuffer verificationKey;
protected BuilderImpl() {
}
protected BuilderImpl(InitializeEncryptionMaterialsInput model) {
this.algorithmSuiteId = model.algorithmSuiteId();
this.encryptionContext = model.encryptionContext();
this.requiredEncryptionContextKeys = model.requiredEncryptionContextKeys();
this.signingKey = model.signingKey();
this.verificationKey = model.verificationKey();
}
public Builder algorithmSuiteId(AlgorithmSuiteId algorithmSuiteId) {
this.algorithmSuiteId = algorithmSuiteId;
return this;
}
public AlgorithmSuiteId algorithmSuiteId() {
return this.algorithmSuiteId;
}
public Builder encryptionContext(Map<String, String> encryptionContext) {
this.encryptionContext = encryptionContext;
return this;
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public Builder requiredEncryptionContextKeys(List<String> requiredEncryptionContextKeys) {
this.requiredEncryptionContextKeys = requiredEncryptionContextKeys;
return this;
}
public List<String> requiredEncryptionContextKeys() {
return this.requiredEncryptionContextKeys;
}
public Builder signingKey(ByteBuffer signingKey) {
this.signingKey = signingKey;
return this;
}
public ByteBuffer signingKey() {
return this.signingKey;
}
public Builder verificationKey(ByteBuffer verificationKey) {
this.verificationKey = verificationKey;
return this;
}
public ByteBuffer verificationKey() {
return this.verificationKey;
}
public InitializeEncryptionMaterialsInput build() {
if (Objects.isNull(this.algorithmSuiteId())) {
throw new IllegalArgumentException("Missing value for required field `algorithmSuiteId`");
}
if (Objects.isNull(this.encryptionContext())) {
throw new IllegalArgumentException("Missing value for required field `encryptionContext`");
}
if (Objects.isNull(this.requiredEncryptionContextKeys())) {
throw new IllegalArgumentException("Missing value for required field `requiredEncryptionContextKeys`");
}
return new InitializeEncryptionMaterialsInput(this);
}
}
}
| 357 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/EncryptionMaterials.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.Map;
import java.util.Objects;
public class EncryptionMaterials {
private final AlgorithmSuiteInfo algorithmSuite;
private final Map<String, String> encryptionContext;
private final List<EncryptedDataKey> encryptedDataKeys;
private final List<String> requiredEncryptionContextKeys;
private final ByteBuffer plaintextDataKey;
private final ByteBuffer signingKey;
private final List<ByteBuffer> symmetricSigningKeys;
protected EncryptionMaterials(BuilderImpl builder) {
this.algorithmSuite = builder.algorithmSuite();
this.encryptionContext = builder.encryptionContext();
this.encryptedDataKeys = builder.encryptedDataKeys();
this.requiredEncryptionContextKeys = builder.requiredEncryptionContextKeys();
this.plaintextDataKey = builder.plaintextDataKey();
this.signingKey = builder.signingKey();
this.symmetricSigningKeys = builder.symmetricSigningKeys();
}
public AlgorithmSuiteInfo algorithmSuite() {
return this.algorithmSuite;
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public List<EncryptedDataKey> encryptedDataKeys() {
return this.encryptedDataKeys;
}
public List<String> requiredEncryptionContextKeys() {
return this.requiredEncryptionContextKeys;
}
public ByteBuffer plaintextDataKey() {
return this.plaintextDataKey;
}
public ByteBuffer signingKey() {
return this.signingKey;
}
public List<ByteBuffer> symmetricSigningKeys() {
return this.symmetricSigningKeys;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder algorithmSuite(AlgorithmSuiteInfo algorithmSuite);
AlgorithmSuiteInfo algorithmSuite();
Builder encryptionContext(Map<String, String> encryptionContext);
Map<String, String> encryptionContext();
Builder encryptedDataKeys(List<EncryptedDataKey> encryptedDataKeys);
List<EncryptedDataKey> encryptedDataKeys();
Builder requiredEncryptionContextKeys(List<String> requiredEncryptionContextKeys);
List<String> requiredEncryptionContextKeys();
Builder plaintextDataKey(ByteBuffer plaintextDataKey);
ByteBuffer plaintextDataKey();
Builder signingKey(ByteBuffer signingKey);
ByteBuffer signingKey();
Builder symmetricSigningKeys(List<ByteBuffer> symmetricSigningKeys);
List<ByteBuffer> symmetricSigningKeys();
EncryptionMaterials build();
}
static class BuilderImpl implements Builder {
protected AlgorithmSuiteInfo algorithmSuite;
protected Map<String, String> encryptionContext;
protected List<EncryptedDataKey> encryptedDataKeys;
protected List<String> requiredEncryptionContextKeys;
protected ByteBuffer plaintextDataKey;
protected ByteBuffer signingKey;
protected List<ByteBuffer> symmetricSigningKeys;
protected BuilderImpl() {
}
protected BuilderImpl(EncryptionMaterials model) {
this.algorithmSuite = model.algorithmSuite();
this.encryptionContext = model.encryptionContext();
this.encryptedDataKeys = model.encryptedDataKeys();
this.requiredEncryptionContextKeys = model.requiredEncryptionContextKeys();
this.plaintextDataKey = model.plaintextDataKey();
this.signingKey = model.signingKey();
this.symmetricSigningKeys = model.symmetricSigningKeys();
}
public Builder algorithmSuite(AlgorithmSuiteInfo algorithmSuite) {
this.algorithmSuite = algorithmSuite;
return this;
}
public AlgorithmSuiteInfo algorithmSuite() {
return this.algorithmSuite;
}
public Builder encryptionContext(Map<String, String> encryptionContext) {
this.encryptionContext = encryptionContext;
return this;
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public Builder encryptedDataKeys(List<EncryptedDataKey> encryptedDataKeys) {
this.encryptedDataKeys = encryptedDataKeys;
return this;
}
public List<EncryptedDataKey> encryptedDataKeys() {
return this.encryptedDataKeys;
}
public Builder requiredEncryptionContextKeys(List<String> requiredEncryptionContextKeys) {
this.requiredEncryptionContextKeys = requiredEncryptionContextKeys;
return this;
}
public List<String> requiredEncryptionContextKeys() {
return this.requiredEncryptionContextKeys;
}
public Builder plaintextDataKey(ByteBuffer plaintextDataKey) {
this.plaintextDataKey = plaintextDataKey;
return this;
}
public ByteBuffer plaintextDataKey() {
return this.plaintextDataKey;
}
public Builder signingKey(ByteBuffer signingKey) {
this.signingKey = signingKey;
return this;
}
public ByteBuffer signingKey() {
return this.signingKey;
}
public Builder symmetricSigningKeys(List<ByteBuffer> symmetricSigningKeys) {
this.symmetricSigningKeys = symmetricSigningKeys;
return this;
}
public List<ByteBuffer> symmetricSigningKeys() {
return this.symmetricSigningKeys;
}
public EncryptionMaterials build() {
if (Objects.isNull(this.algorithmSuite())) {
throw new IllegalArgumentException("Missing value for required field `algorithmSuite`");
}
if (Objects.isNull(this.encryptionContext())) {
throw new IllegalArgumentException("Missing value for required field `encryptionContext`");
}
if (Objects.isNull(this.encryptedDataKeys())) {
throw new IllegalArgumentException("Missing value for required field `encryptedDataKeys`");
}
if (Objects.isNull(this.requiredEncryptionContextKeys())) {
throw new IllegalArgumentException("Missing value for required field `requiredEncryptionContextKeys`");
}
return new EncryptionMaterials(this);
}
}
}
| 358 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CreateAwsKmsKeyringInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.List;
import java.util.Objects;
import software.amazon.awssdk.services.kms.KmsClient;
/**
* Inputs for for creating a AWS KMS Keyring.
*/
public class CreateAwsKmsKeyringInput {
/**
* The identifier for the symmetric AWS KMS Key responsible for wrapping and unwrapping data keys. This should not be a AWS KMS Multi-Region Key.
*/
private final String kmsKeyId;
/**
* The KMS Client this Keyring will use to call KMS.
*/
private final KmsClient kmsClient;
/**
* A list of grant tokens to be used when calling KMS.
*/
private final List<String> grantTokens;
protected CreateAwsKmsKeyringInput(BuilderImpl builder) {
this.kmsKeyId = builder.kmsKeyId();
this.kmsClient = builder.kmsClient();
this.grantTokens = builder.grantTokens();
}
/**
* @return The identifier for the symmetric AWS KMS Key responsible for wrapping and unwrapping data keys. This should not be a AWS KMS Multi-Region Key.
*/
public String kmsKeyId() {
return this.kmsKeyId;
}
/**
* @return The KMS Client this Keyring will use to call KMS.
*/
public KmsClient kmsClient() {
return this.kmsClient;
}
/**
* @return A list of grant tokens to be used when calling KMS.
*/
public List<String> grantTokens() {
return this.grantTokens;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param kmsKeyId The identifier for the symmetric AWS KMS Key responsible for wrapping and unwrapping data keys. This should not be a AWS KMS Multi-Region Key.
*/
Builder kmsKeyId(String kmsKeyId);
/**
* @return The identifier for the symmetric AWS KMS Key responsible for wrapping and unwrapping data keys. This should not be a AWS KMS Multi-Region Key.
*/
String kmsKeyId();
/**
* @param kmsClient The KMS Client this Keyring will use to call KMS.
*/
Builder kmsClient(KmsClient kmsClient);
/**
* @return The KMS Client this Keyring will use to call KMS.
*/
KmsClient kmsClient();
/**
* @param grantTokens A list of grant tokens to be used when calling KMS.
*/
Builder grantTokens(List<String> grantTokens);
/**
* @return A list of grant tokens to be used when calling KMS.
*/
List<String> grantTokens();
CreateAwsKmsKeyringInput build();
}
static class BuilderImpl implements Builder {
protected String kmsKeyId;
protected KmsClient kmsClient;
protected List<String> grantTokens;
protected BuilderImpl() {
}
protected BuilderImpl(CreateAwsKmsKeyringInput model) {
this.kmsKeyId = model.kmsKeyId();
this.kmsClient = model.kmsClient();
this.grantTokens = model.grantTokens();
}
public Builder kmsKeyId(String kmsKeyId) {
this.kmsKeyId = kmsKeyId;
return this;
}
public String kmsKeyId() {
return this.kmsKeyId;
}
public Builder kmsClient(KmsClient kmsClient) {
this.kmsClient = kmsClient;
return this;
}
public KmsClient kmsClient() {
return this.kmsClient;
}
public Builder grantTokens(List<String> grantTokens) {
this.grantTokens = grantTokens;
return this;
}
public List<String> grantTokens() {
return this.grantTokens;
}
public CreateAwsKmsKeyringInput build() {
if (Objects.isNull(this.kmsKeyId())) {
throw new IllegalArgumentException("Missing value for required field `kmsKeyId`");
}
if (Objects.isNull(this.kmsClient())) {
throw new IllegalArgumentException("Missing value for required field `kmsClient`");
}
return new CreateAwsKmsKeyringInput(this);
}
}
}
| 359 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CreateMultiKeyringInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.List;
import java.util.Objects;
import software.amazon.cryptography.materialproviders.IKeyring;
import software.amazon.cryptography.materialproviders.Keyring;
/**
* Inputs for creating a Multi-Keyring.
*/
public class CreateMultiKeyringInput {
/**
* A keyring responsible for wrapping and unwrapping the data key. This is the first keyring that will be used to wrap the data key, and may be responsible for additionally generating the data key.
*/
private final IKeyring generator;
/**
* A list of keyrings (other than the generator) responsible for wrapping and unwrapping the data key.
*/
private final List<IKeyring> childKeyrings;
protected CreateMultiKeyringInput(BuilderImpl builder) {
this.generator = builder.generator();
this.childKeyrings = builder.childKeyrings();
}
/**
* @return A keyring responsible for wrapping and unwrapping the data key. This is the first keyring that will be used to wrap the data key, and may be responsible for additionally generating the data key.
*/
public IKeyring generator() {
return this.generator;
}
/**
* @return A list of keyrings (other than the generator) responsible for wrapping and unwrapping the data key.
*/
public List<IKeyring> childKeyrings() {
return this.childKeyrings;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param generator A keyring responsible for wrapping and unwrapping the data key. This is the first keyring that will be used to wrap the data key, and may be responsible for additionally generating the data key.
*/
Builder generator(IKeyring generator);
/**
* @return A keyring responsible for wrapping and unwrapping the data key. This is the first keyring that will be used to wrap the data key, and may be responsible for additionally generating the data key.
*/
IKeyring generator();
/**
* @param childKeyrings A list of keyrings (other than the generator) responsible for wrapping and unwrapping the data key.
*/
Builder childKeyrings(List<IKeyring> childKeyrings);
/**
* @return A list of keyrings (other than the generator) responsible for wrapping and unwrapping the data key.
*/
List<IKeyring> childKeyrings();
CreateMultiKeyringInput build();
}
static class BuilderImpl implements Builder {
protected IKeyring generator;
protected List<IKeyring> childKeyrings;
protected BuilderImpl() {
}
protected BuilderImpl(CreateMultiKeyringInput model) {
this.generator = model.generator();
this.childKeyrings = model.childKeyrings();
}
public Builder generator(IKeyring generator) {
this.generator = Keyring.wrap(generator);
return this;
}
public IKeyring generator() {
return this.generator;
}
public Builder childKeyrings(List<IKeyring> childKeyrings) {
this.childKeyrings = childKeyrings;
return this;
}
public List<IKeyring> childKeyrings() {
return this.childKeyrings;
}
public CreateMultiKeyringInput build() {
if (Objects.isNull(this.childKeyrings())) {
throw new IllegalArgumentException("Missing value for required field `childKeyrings`");
}
return new CreateMultiKeyringInput(this);
}
}
}
| 360 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CreateDefaultCryptographicMaterialsManagerInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
import software.amazon.cryptography.materialproviders.IKeyring;
import software.amazon.cryptography.materialproviders.Keyring;
/**
* Inputs for creating a Default Cryptographic Materials Manager.
*/
public class CreateDefaultCryptographicMaterialsManagerInput {
/**
* The Keyring that the created Default Cryprographic Materials Manager will use to wrap data keys.
*/
private final IKeyring keyring;
protected CreateDefaultCryptographicMaterialsManagerInput(BuilderImpl builder) {
this.keyring = builder.keyring();
}
/**
* @return The Keyring that the created Default Cryprographic Materials Manager will use to wrap data keys.
*/
public IKeyring keyring() {
return this.keyring;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param keyring The Keyring that the created Default Cryprographic Materials Manager will use to wrap data keys.
*/
Builder keyring(IKeyring keyring);
/**
* @return The Keyring that the created Default Cryprographic Materials Manager will use to wrap data keys.
*/
IKeyring keyring();
CreateDefaultCryptographicMaterialsManagerInput build();
}
static class BuilderImpl implements Builder {
protected IKeyring keyring;
protected BuilderImpl() {
}
protected BuilderImpl(CreateDefaultCryptographicMaterialsManagerInput model) {
this.keyring = model.keyring();
}
public Builder keyring(IKeyring keyring) {
this.keyring = Keyring.wrap(keyring);
return this;
}
public IKeyring keyring() {
return this.keyring;
}
public CreateDefaultCryptographicMaterialsManagerInput build() {
if (Objects.isNull(this.keyring())) {
throw new IllegalArgumentException("Missing value for required field `keyring`");
}
return new CreateDefaultCryptographicMaterialsManagerInput(this);
}
}
}
| 361 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/ESDKCommitmentPolicy.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
public enum ESDKCommitmentPolicy {
FORBID_ENCRYPT_ALLOW_DECRYPT("FORBID_ENCRYPT_ALLOW_DECRYPT"),
REQUIRE_ENCRYPT_ALLOW_DECRYPT("REQUIRE_ENCRYPT_ALLOW_DECRYPT"),
REQUIRE_ENCRYPT_REQUIRE_DECRYPT("REQUIRE_ENCRYPT_REQUIRE_DECRYPT");
private final String value;
private ESDKCommitmentPolicy(String value) {
this.value = value;
}
public String toString() {
return String.valueOf(value);
}
}
| 362 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/AlgorithmSuiteId.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class AlgorithmSuiteId {
private final ESDKAlgorithmSuiteId ESDK;
private final DBEAlgorithmSuiteId DBE;
protected AlgorithmSuiteId(BuilderImpl builder) {
this.ESDK = builder.ESDK();
this.DBE = builder.DBE();
}
public ESDKAlgorithmSuiteId ESDK() {
return this.ESDK;
}
public DBEAlgorithmSuiteId DBE() {
return this.DBE;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder ESDK(ESDKAlgorithmSuiteId ESDK);
ESDKAlgorithmSuiteId ESDK();
Builder DBE(DBEAlgorithmSuiteId DBE);
DBEAlgorithmSuiteId DBE();
AlgorithmSuiteId build();
}
static class BuilderImpl implements Builder {
protected ESDKAlgorithmSuiteId ESDK;
protected DBEAlgorithmSuiteId DBE;
protected BuilderImpl() {
}
protected BuilderImpl(AlgorithmSuiteId model) {
this.ESDK = model.ESDK();
this.DBE = model.DBE();
}
public Builder ESDK(ESDKAlgorithmSuiteId ESDK) {
this.ESDK = ESDK;
return this;
}
public ESDKAlgorithmSuiteId ESDK() {
return this.ESDK;
}
public Builder DBE(DBEAlgorithmSuiteId DBE) {
this.DBE = DBE;
return this;
}
public DBEAlgorithmSuiteId DBE() {
return this.DBE;
}
public AlgorithmSuiteId build() {
if (!onlyOneNonNull()) {
throw new IllegalArgumentException("`AlgorithmSuiteId` is a Union. A Union MUST have one and only one value set.");
}
return new AlgorithmSuiteId(this);
}
private boolean onlyOneNonNull() {
Object[] allValues = {this.ESDK, this.DBE};
boolean haveOneNonNull = false;
for (Object o : allValues) {
if (Objects.nonNull(o)) {
if (haveOneNonNull) {
return false;
}
haveOneNonNull = true;
}
}
return haveOneNonNull;
}
}
}
| 363 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/EntryAlreadyExists.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class EntryAlreadyExists extends RuntimeException {
protected EntryAlreadyExists(BuilderImpl builder) {
super(messageFromBuilder(builder), builder.cause());
}
private static String messageFromBuilder(Builder builder) {
if (builder.message() != null) {
return builder.message();
}
if (builder.cause() != null) {
return builder.cause().getMessage();
}
return null;
}
/**
* See {@link Throwable#getMessage()}.
*/
public String message() {
return this.getMessage();
}
/**
* See {@link Throwable#getCause()}.
*/
public Throwable cause() {
return this.getCause();
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param message The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
Builder message(String message);
/**
* @return The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
String message();
/**
* @param cause The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Builder cause(Throwable cause);
/**
* @return The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Throwable cause();
EntryAlreadyExists build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected BuilderImpl() {
}
protected BuilderImpl(EntryAlreadyExists model) {
this.message = model.message();
this.cause = model.cause();
}
public Builder message(String message) {
this.message = message;
return this;
}
public String message() {
return this.message;
}
public Builder cause(Throwable cause) {
this.cause = cause;
return this;
}
public Throwable cause() {
return this.cause;
}
public EntryAlreadyExists build() {
if (Objects.isNull(this.message())) {
throw new IllegalArgumentException("Missing value for required field `message`");
}
return new EntryAlreadyExists(this);
}
}
}
| 364 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/OnDecryptOutput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class OnDecryptOutput {
private final DecryptionMaterials materials;
protected OnDecryptOutput(BuilderImpl builder) {
this.materials = builder.materials();
}
public DecryptionMaterials materials() {
return this.materials;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder materials(DecryptionMaterials materials);
DecryptionMaterials materials();
OnDecryptOutput build();
}
static class BuilderImpl implements Builder {
protected DecryptionMaterials materials;
protected BuilderImpl() {
}
protected BuilderImpl(OnDecryptOutput model) {
this.materials = model.materials();
}
public Builder materials(DecryptionMaterials materials) {
this.materials = materials;
return this;
}
public DecryptionMaterials materials() {
return this.materials;
}
public OnDecryptOutput build() {
if (Objects.isNull(this.materials())) {
throw new IllegalArgumentException("Missing value for required field `materials`");
}
return new OnDecryptOutput(this);
}
}
}
| 365 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CreateAwsKmsMrkMultiKeyringInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.List;
import software.amazon.cryptography.materialproviders.ClientSupplier;
import software.amazon.cryptography.materialproviders.IClientSupplier;
/**
* Inputs for for creating a AWS KMS MRK Multi-Keyring.
*/
public class CreateAwsKmsMrkMultiKeyringInput {
/**
* A symmetric AWS KMS Key or AWS KMS Multi-Region Key responsible for wrapping and unwrapping data keys. KMS.GenerateDataKey may be called with this key if the data key has not already been generated by another Keyring.
*/
private final String generator;
/**
* A list of identifiers for the symmetric AWS KMS Keys and/or AWS KMS Multi-Region Keys (other than the generator) responsible for wrapping and unwrapping data keys.
*/
private final List<String> kmsKeyIds;
/**
* The Client Supplier which will be used to get KMS Clients for use with this Keyring. The Client Supplier will create a client for each region specified in the generator and kmsKeyIds ARNs. If not specified on input, the Default Client Supplier is used.
*/
private final IClientSupplier clientSupplier;
/**
* A list of grant tokens to be used when calling KMS.
*/
private final List<String> grantTokens;
protected CreateAwsKmsMrkMultiKeyringInput(BuilderImpl builder) {
this.generator = builder.generator();
this.kmsKeyIds = builder.kmsKeyIds();
this.clientSupplier = builder.clientSupplier();
this.grantTokens = builder.grantTokens();
}
/**
* @return A symmetric AWS KMS Key or AWS KMS Multi-Region Key responsible for wrapping and unwrapping data keys. KMS.GenerateDataKey may be called with this key if the data key has not already been generated by another Keyring.
*/
public String generator() {
return this.generator;
}
/**
* @return A list of identifiers for the symmetric AWS KMS Keys and/or AWS KMS Multi-Region Keys (other than the generator) responsible for wrapping and unwrapping data keys.
*/
public List<String> kmsKeyIds() {
return this.kmsKeyIds;
}
/**
* @return The Client Supplier which will be used to get KMS Clients for use with this Keyring. The Client Supplier will create a client for each region specified in the generator and kmsKeyIds ARNs. If not specified on input, the Default Client Supplier is used.
*/
public IClientSupplier clientSupplier() {
return this.clientSupplier;
}
/**
* @return A list of grant tokens to be used when calling KMS.
*/
public List<String> grantTokens() {
return this.grantTokens;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param generator A symmetric AWS KMS Key or AWS KMS Multi-Region Key responsible for wrapping and unwrapping data keys. KMS.GenerateDataKey may be called with this key if the data key has not already been generated by another Keyring.
*/
Builder generator(String generator);
/**
* @return A symmetric AWS KMS Key or AWS KMS Multi-Region Key responsible for wrapping and unwrapping data keys. KMS.GenerateDataKey may be called with this key if the data key has not already been generated by another Keyring.
*/
String generator();
/**
* @param kmsKeyIds A list of identifiers for the symmetric AWS KMS Keys and/or AWS KMS Multi-Region Keys (other than the generator) responsible for wrapping and unwrapping data keys.
*/
Builder kmsKeyIds(List<String> kmsKeyIds);
/**
* @return A list of identifiers for the symmetric AWS KMS Keys and/or AWS KMS Multi-Region Keys (other than the generator) responsible for wrapping and unwrapping data keys.
*/
List<String> kmsKeyIds();
/**
* @param clientSupplier The Client Supplier which will be used to get KMS Clients for use with this Keyring. The Client Supplier will create a client for each region specified in the generator and kmsKeyIds ARNs. If not specified on input, the Default Client Supplier is used.
*/
Builder clientSupplier(IClientSupplier clientSupplier);
/**
* @return The Client Supplier which will be used to get KMS Clients for use with this Keyring. The Client Supplier will create a client for each region specified in the generator and kmsKeyIds ARNs. If not specified on input, the Default Client Supplier is used.
*/
IClientSupplier clientSupplier();
/**
* @param grantTokens A list of grant tokens to be used when calling KMS.
*/
Builder grantTokens(List<String> grantTokens);
/**
* @return A list of grant tokens to be used when calling KMS.
*/
List<String> grantTokens();
CreateAwsKmsMrkMultiKeyringInput build();
}
static class BuilderImpl implements Builder {
protected String generator;
protected List<String> kmsKeyIds;
protected IClientSupplier clientSupplier;
protected List<String> grantTokens;
protected BuilderImpl() {
}
protected BuilderImpl(CreateAwsKmsMrkMultiKeyringInput model) {
this.generator = model.generator();
this.kmsKeyIds = model.kmsKeyIds();
this.clientSupplier = model.clientSupplier();
this.grantTokens = model.grantTokens();
}
public Builder generator(String generator) {
this.generator = generator;
return this;
}
public String generator() {
return this.generator;
}
public Builder kmsKeyIds(List<String> kmsKeyIds) {
this.kmsKeyIds = kmsKeyIds;
return this;
}
public List<String> kmsKeyIds() {
return this.kmsKeyIds;
}
public Builder clientSupplier(IClientSupplier clientSupplier) {
this.clientSupplier = ClientSupplier.wrap(clientSupplier);
return this;
}
public IClientSupplier clientSupplier() {
return this.clientSupplier;
}
public Builder grantTokens(List<String> grantTokens) {
this.grantTokens = grantTokens;
return this;
}
public List<String> grantTokens() {
return this.grantTokens;
}
public CreateAwsKmsMrkMultiKeyringInput build() {
return new CreateAwsKmsMrkMultiKeyringInput(this);
}
}
}
| 366 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CreateDefaultClientSupplierInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
public class CreateDefaultClientSupplierInput {
protected CreateDefaultClientSupplierInput(BuilderImpl builder) {
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
CreateDefaultClientSupplierInput build();
}
static class BuilderImpl implements Builder {
protected BuilderImpl() {
}
protected BuilderImpl(CreateDefaultClientSupplierInput model) {
}
public CreateDefaultClientSupplierInput build() {
return new CreateDefaultClientSupplierInput(this);
}
}
}
| 367 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/GetEncryptionMaterialsOutput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class GetEncryptionMaterialsOutput {
private final EncryptionMaterials encryptionMaterials;
protected GetEncryptionMaterialsOutput(BuilderImpl builder) {
this.encryptionMaterials = builder.encryptionMaterials();
}
public EncryptionMaterials encryptionMaterials() {
return this.encryptionMaterials;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder encryptionMaterials(EncryptionMaterials encryptionMaterials);
EncryptionMaterials encryptionMaterials();
GetEncryptionMaterialsOutput build();
}
static class BuilderImpl implements Builder {
protected EncryptionMaterials encryptionMaterials;
protected BuilderImpl() {
}
protected BuilderImpl(GetEncryptionMaterialsOutput model) {
this.encryptionMaterials = model.encryptionMaterials();
}
public Builder encryptionMaterials(EncryptionMaterials encryptionMaterials) {
this.encryptionMaterials = encryptionMaterials;
return this;
}
public EncryptionMaterials encryptionMaterials() {
return this.encryptionMaterials;
}
public GetEncryptionMaterialsOutput build() {
if (Objects.isNull(this.encryptionMaterials())) {
throw new IllegalArgumentException("Missing value for required field `encryptionMaterials`");
}
return new GetEncryptionMaterialsOutput(this);
}
}
}
| 368 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/DecryptionMaterials.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.Map;
import java.util.Objects;
public class DecryptionMaterials {
private final AlgorithmSuiteInfo algorithmSuite;
private final Map<String, String> encryptionContext;
private final List<String> requiredEncryptionContextKeys;
private final ByteBuffer plaintextDataKey;
private final ByteBuffer verificationKey;
private final ByteBuffer symmetricSigningKey;
protected DecryptionMaterials(BuilderImpl builder) {
this.algorithmSuite = builder.algorithmSuite();
this.encryptionContext = builder.encryptionContext();
this.requiredEncryptionContextKeys = builder.requiredEncryptionContextKeys();
this.plaintextDataKey = builder.plaintextDataKey();
this.verificationKey = builder.verificationKey();
this.symmetricSigningKey = builder.symmetricSigningKey();
}
public AlgorithmSuiteInfo algorithmSuite() {
return this.algorithmSuite;
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public List<String> requiredEncryptionContextKeys() {
return this.requiredEncryptionContextKeys;
}
public ByteBuffer plaintextDataKey() {
return this.plaintextDataKey;
}
public ByteBuffer verificationKey() {
return this.verificationKey;
}
public ByteBuffer symmetricSigningKey() {
return this.symmetricSigningKey;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder algorithmSuite(AlgorithmSuiteInfo algorithmSuite);
AlgorithmSuiteInfo algorithmSuite();
Builder encryptionContext(Map<String, String> encryptionContext);
Map<String, String> encryptionContext();
Builder requiredEncryptionContextKeys(List<String> requiredEncryptionContextKeys);
List<String> requiredEncryptionContextKeys();
Builder plaintextDataKey(ByteBuffer plaintextDataKey);
ByteBuffer plaintextDataKey();
Builder verificationKey(ByteBuffer verificationKey);
ByteBuffer verificationKey();
Builder symmetricSigningKey(ByteBuffer symmetricSigningKey);
ByteBuffer symmetricSigningKey();
DecryptionMaterials build();
}
static class BuilderImpl implements Builder {
protected AlgorithmSuiteInfo algorithmSuite;
protected Map<String, String> encryptionContext;
protected List<String> requiredEncryptionContextKeys;
protected ByteBuffer plaintextDataKey;
protected ByteBuffer verificationKey;
protected ByteBuffer symmetricSigningKey;
protected BuilderImpl() {
}
protected BuilderImpl(DecryptionMaterials model) {
this.algorithmSuite = model.algorithmSuite();
this.encryptionContext = model.encryptionContext();
this.requiredEncryptionContextKeys = model.requiredEncryptionContextKeys();
this.plaintextDataKey = model.plaintextDataKey();
this.verificationKey = model.verificationKey();
this.symmetricSigningKey = model.symmetricSigningKey();
}
public Builder algorithmSuite(AlgorithmSuiteInfo algorithmSuite) {
this.algorithmSuite = algorithmSuite;
return this;
}
public AlgorithmSuiteInfo algorithmSuite() {
return this.algorithmSuite;
}
public Builder encryptionContext(Map<String, String> encryptionContext) {
this.encryptionContext = encryptionContext;
return this;
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public Builder requiredEncryptionContextKeys(List<String> requiredEncryptionContextKeys) {
this.requiredEncryptionContextKeys = requiredEncryptionContextKeys;
return this;
}
public List<String> requiredEncryptionContextKeys() {
return this.requiredEncryptionContextKeys;
}
public Builder plaintextDataKey(ByteBuffer plaintextDataKey) {
this.plaintextDataKey = plaintextDataKey;
return this;
}
public ByteBuffer plaintextDataKey() {
return this.plaintextDataKey;
}
public Builder verificationKey(ByteBuffer verificationKey) {
this.verificationKey = verificationKey;
return this;
}
public ByteBuffer verificationKey() {
return this.verificationKey;
}
public Builder symmetricSigningKey(ByteBuffer symmetricSigningKey) {
this.symmetricSigningKey = symmetricSigningKey;
return this;
}
public ByteBuffer symmetricSigningKey() {
return this.symmetricSigningKey;
}
public DecryptionMaterials build() {
if (Objects.isNull(this.algorithmSuite())) {
throw new IllegalArgumentException("Missing value for required field `algorithmSuite`");
}
if (Objects.isNull(this.encryptionContext())) {
throw new IllegalArgumentException("Missing value for required field `encryptionContext`");
}
if (Objects.isNull(this.requiredEncryptionContextKeys())) {
throw new IllegalArgumentException("Missing value for required field `requiredEncryptionContextKeys`");
}
return new DecryptionMaterials(this);
}
}
}
| 369 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/AlgorithmSuiteInfo.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class AlgorithmSuiteInfo {
private final AlgorithmSuiteId id;
private final ByteBuffer binaryId;
private final Integer messageVersion;
private final Encrypt encrypt;
private final DerivationAlgorithm kdf;
private final DerivationAlgorithm commitment;
private final SignatureAlgorithm signature;
private final SymmetricSignatureAlgorithm symmetricSignature;
private final EdkWrappingAlgorithm edkWrapping;
protected AlgorithmSuiteInfo(BuilderImpl builder) {
this.id = builder.id();
this.binaryId = builder.binaryId();
this.messageVersion = builder.messageVersion();
this.encrypt = builder.encrypt();
this.kdf = builder.kdf();
this.commitment = builder.commitment();
this.signature = builder.signature();
this.symmetricSignature = builder.symmetricSignature();
this.edkWrapping = builder.edkWrapping();
}
public AlgorithmSuiteId id() {
return this.id;
}
public ByteBuffer binaryId() {
return this.binaryId;
}
public Integer messageVersion() {
return this.messageVersion;
}
public Encrypt encrypt() {
return this.encrypt;
}
public DerivationAlgorithm kdf() {
return this.kdf;
}
public DerivationAlgorithm commitment() {
return this.commitment;
}
public SignatureAlgorithm signature() {
return this.signature;
}
public SymmetricSignatureAlgorithm symmetricSignature() {
return this.symmetricSignature;
}
public EdkWrappingAlgorithm edkWrapping() {
return this.edkWrapping;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder id(AlgorithmSuiteId id);
AlgorithmSuiteId id();
Builder binaryId(ByteBuffer binaryId);
ByteBuffer binaryId();
Builder messageVersion(Integer messageVersion);
Integer messageVersion();
Builder encrypt(Encrypt encrypt);
Encrypt encrypt();
Builder kdf(DerivationAlgorithm kdf);
DerivationAlgorithm kdf();
Builder commitment(DerivationAlgorithm commitment);
DerivationAlgorithm commitment();
Builder signature(SignatureAlgorithm signature);
SignatureAlgorithm signature();
Builder symmetricSignature(SymmetricSignatureAlgorithm symmetricSignature);
SymmetricSignatureAlgorithm symmetricSignature();
Builder edkWrapping(EdkWrappingAlgorithm edkWrapping);
EdkWrappingAlgorithm edkWrapping();
AlgorithmSuiteInfo build();
}
static class BuilderImpl implements Builder {
protected AlgorithmSuiteId id;
protected ByteBuffer binaryId;
protected Integer messageVersion;
protected Encrypt encrypt;
protected DerivationAlgorithm kdf;
protected DerivationAlgorithm commitment;
protected SignatureAlgorithm signature;
protected SymmetricSignatureAlgorithm symmetricSignature;
protected EdkWrappingAlgorithm edkWrapping;
protected BuilderImpl() {
}
protected BuilderImpl(AlgorithmSuiteInfo model) {
this.id = model.id();
this.binaryId = model.binaryId();
this.messageVersion = model.messageVersion();
this.encrypt = model.encrypt();
this.kdf = model.kdf();
this.commitment = model.commitment();
this.signature = model.signature();
this.symmetricSignature = model.symmetricSignature();
this.edkWrapping = model.edkWrapping();
}
public Builder id(AlgorithmSuiteId id) {
this.id = id;
return this;
}
public AlgorithmSuiteId id() {
return this.id;
}
public Builder binaryId(ByteBuffer binaryId) {
this.binaryId = binaryId;
return this;
}
public ByteBuffer binaryId() {
return this.binaryId;
}
public Builder messageVersion(Integer messageVersion) {
this.messageVersion = messageVersion;
return this;
}
public Integer messageVersion() {
return this.messageVersion;
}
public Builder encrypt(Encrypt encrypt) {
this.encrypt = encrypt;
return this;
}
public Encrypt encrypt() {
return this.encrypt;
}
public Builder kdf(DerivationAlgorithm kdf) {
this.kdf = kdf;
return this;
}
public DerivationAlgorithm kdf() {
return this.kdf;
}
public Builder commitment(DerivationAlgorithm commitment) {
this.commitment = commitment;
return this;
}
public DerivationAlgorithm commitment() {
return this.commitment;
}
public Builder signature(SignatureAlgorithm signature) {
this.signature = signature;
return this;
}
public SignatureAlgorithm signature() {
return this.signature;
}
public Builder symmetricSignature(SymmetricSignatureAlgorithm symmetricSignature) {
this.symmetricSignature = symmetricSignature;
return this;
}
public SymmetricSignatureAlgorithm symmetricSignature() {
return this.symmetricSignature;
}
public Builder edkWrapping(EdkWrappingAlgorithm edkWrapping) {
this.edkWrapping = edkWrapping;
return this;
}
public EdkWrappingAlgorithm edkWrapping() {
return this.edkWrapping;
}
public AlgorithmSuiteInfo build() {
if (Objects.isNull(this.id())) {
throw new IllegalArgumentException("Missing value for required field `id`");
}
if (Objects.isNull(this.binaryId())) {
throw new IllegalArgumentException("Missing value for required field `binaryId`");
}
if (Objects.isNull(this.messageVersion())) {
throw new IllegalArgumentException("Missing value for required field `messageVersion`");
}
if (Objects.isNull(this.encrypt())) {
throw new IllegalArgumentException("Missing value for required field `encrypt`");
}
if (Objects.isNull(this.kdf())) {
throw new IllegalArgumentException("Missing value for required field `kdf`");
}
if (Objects.isNull(this.commitment())) {
throw new IllegalArgumentException("Missing value for required field `commitment`");
}
if (Objects.isNull(this.signature())) {
throw new IllegalArgumentException("Missing value for required field `signature`");
}
if (Objects.isNull(this.symmetricSignature())) {
throw new IllegalArgumentException("Missing value for required field `symmetricSignature`");
}
if (Objects.isNull(this.edkWrapping())) {
throw new IllegalArgumentException("Missing value for required field `edkWrapping`");
}
return new AlgorithmSuiteInfo(this);
}
}
}
| 370 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/GetAlgorithmSuiteInfoInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class GetAlgorithmSuiteInfoInput {
private final ByteBuffer binaryId;
protected GetAlgorithmSuiteInfoInput(BuilderImpl builder) {
this.binaryId = builder.binaryId();
}
public ByteBuffer binaryId() {
return this.binaryId;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder binaryId(ByteBuffer binaryId);
ByteBuffer binaryId();
GetAlgorithmSuiteInfoInput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer binaryId;
protected BuilderImpl() {
}
protected BuilderImpl(GetAlgorithmSuiteInfoInput model) {
this.binaryId = model.binaryId();
}
public Builder binaryId(ByteBuffer binaryId) {
this.binaryId = binaryId;
return this;
}
public ByteBuffer binaryId() {
return this.binaryId;
}
public GetAlgorithmSuiteInfoInput build() {
if (Objects.isNull(this.binaryId())) {
throw new IllegalArgumentException("Missing value for required field `binaryId`");
}
return new GetAlgorithmSuiteInfoInput(this);
}
}
}
| 371 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/Encrypt.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
import software.amazon.cryptography.primitives.model.AES_GCM;
public class Encrypt {
private final AES_GCM AES_GCM;
protected Encrypt(BuilderImpl builder) {
this.AES_GCM = builder.AES_GCM();
}
public AES_GCM AES_GCM() {
return this.AES_GCM;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder AES_GCM(AES_GCM AES_GCM);
AES_GCM AES_GCM();
Encrypt build();
}
static class BuilderImpl implements Builder {
protected AES_GCM AES_GCM;
protected BuilderImpl() {
}
protected BuilderImpl(Encrypt model) {
this.AES_GCM = model.AES_GCM();
}
public Builder AES_GCM(AES_GCM AES_GCM) {
this.AES_GCM = AES_GCM;
return this;
}
public AES_GCM AES_GCM() {
return this.AES_GCM;
}
public Encrypt build() {
if (!onlyOneNonNull()) {
throw new IllegalArgumentException("`Encrypt` is a Union. A Union MUST have one and only one value set.");
}
return new Encrypt(this);
}
private boolean onlyOneNonNull() {
Object[] allValues = {this.AES_GCM};
boolean haveOneNonNull = false;
for (Object o : allValues) {
if (Objects.nonNull(o)) {
if (haveOneNonNull) {
return false;
}
haveOneNonNull = true;
}
}
return haveOneNonNull;
}
}
}
| 372 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/EncryptedDataKey.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class EncryptedDataKey {
private final String keyProviderId;
private final ByteBuffer keyProviderInfo;
private final ByteBuffer ciphertext;
protected EncryptedDataKey(BuilderImpl builder) {
this.keyProviderId = builder.keyProviderId();
this.keyProviderInfo = builder.keyProviderInfo();
this.ciphertext = builder.ciphertext();
}
public String keyProviderId() {
return this.keyProviderId;
}
public ByteBuffer keyProviderInfo() {
return this.keyProviderInfo;
}
public ByteBuffer ciphertext() {
return this.ciphertext;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder keyProviderId(String keyProviderId);
String keyProviderId();
Builder keyProviderInfo(ByteBuffer keyProviderInfo);
ByteBuffer keyProviderInfo();
Builder ciphertext(ByteBuffer ciphertext);
ByteBuffer ciphertext();
EncryptedDataKey build();
}
static class BuilderImpl implements Builder {
protected String keyProviderId;
protected ByteBuffer keyProviderInfo;
protected ByteBuffer ciphertext;
protected BuilderImpl() {
}
protected BuilderImpl(EncryptedDataKey model) {
this.keyProviderId = model.keyProviderId();
this.keyProviderInfo = model.keyProviderInfo();
this.ciphertext = model.ciphertext();
}
public Builder keyProviderId(String keyProviderId) {
this.keyProviderId = keyProviderId;
return this;
}
public String keyProviderId() {
return this.keyProviderId;
}
public Builder keyProviderInfo(ByteBuffer keyProviderInfo) {
this.keyProviderInfo = keyProviderInfo;
return this;
}
public ByteBuffer keyProviderInfo() {
return this.keyProviderInfo;
}
public Builder ciphertext(ByteBuffer ciphertext) {
this.ciphertext = ciphertext;
return this;
}
public ByteBuffer ciphertext() {
return this.ciphertext;
}
public EncryptedDataKey build() {
if (Objects.isNull(this.keyProviderId())) {
throw new IllegalArgumentException("Missing value for required field `keyProviderId`");
}
if (Objects.isNull(this.keyProviderInfo())) {
throw new IllegalArgumentException("Missing value for required field `keyProviderInfo`");
}
if (Objects.isNull(this.ciphertext())) {
throw new IllegalArgumentException("Missing value for required field `ciphertext`");
}
return new EncryptedDataKey(this);
}
}
}
| 373 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CreateAwsKmsMultiKeyringInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.List;
import software.amazon.cryptography.materialproviders.ClientSupplier;
import software.amazon.cryptography.materialproviders.IClientSupplier;
/**
* Inputs for for creating a AWS KMS Multi-Keyring.
*/
public class CreateAwsKmsMultiKeyringInput {
/**
* A identifier for a symmetric AWS KMS Key responsible for wrapping and unwrapping data keys. KMS.GenerateDataKey may be called with this key if the data key has not already been generated by another Keyring. This should not be a AWS KMS Multi-Region Key.
*/
private final String generator;
/**
* A list of identifiers for the symmetric AWS KMS Keys (other than the generator) responsible for wrapping and unwrapping data keys. This list should not contain AWS KMS Multi-Region Keys.
*/
private final List<String> kmsKeyIds;
/**
* The Client Supplier which will be used to get KMS Clients for use with this Keyring. The Client Supplier will create a client for each region specified in the generator and kmsKeyIds ARNs. If not specified on input, the Default Client Supplier is used.
*/
private final IClientSupplier clientSupplier;
/**
* A list of grant tokens to be used when calling KMS.
*/
private final List<String> grantTokens;
protected CreateAwsKmsMultiKeyringInput(BuilderImpl builder) {
this.generator = builder.generator();
this.kmsKeyIds = builder.kmsKeyIds();
this.clientSupplier = builder.clientSupplier();
this.grantTokens = builder.grantTokens();
}
/**
* @return A identifier for a symmetric AWS KMS Key responsible for wrapping and unwrapping data keys. KMS.GenerateDataKey may be called with this key if the data key has not already been generated by another Keyring. This should not be a AWS KMS Multi-Region Key.
*/
public String generator() {
return this.generator;
}
/**
* @return A list of identifiers for the symmetric AWS KMS Keys (other than the generator) responsible for wrapping and unwrapping data keys. This list should not contain AWS KMS Multi-Region Keys.
*/
public List<String> kmsKeyIds() {
return this.kmsKeyIds;
}
/**
* @return The Client Supplier which will be used to get KMS Clients for use with this Keyring. The Client Supplier will create a client for each region specified in the generator and kmsKeyIds ARNs. If not specified on input, the Default Client Supplier is used.
*/
public IClientSupplier clientSupplier() {
return this.clientSupplier;
}
/**
* @return A list of grant tokens to be used when calling KMS.
*/
public List<String> grantTokens() {
return this.grantTokens;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param generator A identifier for a symmetric AWS KMS Key responsible for wrapping and unwrapping data keys. KMS.GenerateDataKey may be called with this key if the data key has not already been generated by another Keyring. This should not be a AWS KMS Multi-Region Key.
*/
Builder generator(String generator);
/**
* @return A identifier for a symmetric AWS KMS Key responsible for wrapping and unwrapping data keys. KMS.GenerateDataKey may be called with this key if the data key has not already been generated by another Keyring. This should not be a AWS KMS Multi-Region Key.
*/
String generator();
/**
* @param kmsKeyIds A list of identifiers for the symmetric AWS KMS Keys (other than the generator) responsible for wrapping and unwrapping data keys. This list should not contain AWS KMS Multi-Region Keys.
*/
Builder kmsKeyIds(List<String> kmsKeyIds);
/**
* @return A list of identifiers for the symmetric AWS KMS Keys (other than the generator) responsible for wrapping and unwrapping data keys. This list should not contain AWS KMS Multi-Region Keys.
*/
List<String> kmsKeyIds();
/**
* @param clientSupplier The Client Supplier which will be used to get KMS Clients for use with this Keyring. The Client Supplier will create a client for each region specified in the generator and kmsKeyIds ARNs. If not specified on input, the Default Client Supplier is used.
*/
Builder clientSupplier(IClientSupplier clientSupplier);
/**
* @return The Client Supplier which will be used to get KMS Clients for use with this Keyring. The Client Supplier will create a client for each region specified in the generator and kmsKeyIds ARNs. If not specified on input, the Default Client Supplier is used.
*/
IClientSupplier clientSupplier();
/**
* @param grantTokens A list of grant tokens to be used when calling KMS.
*/
Builder grantTokens(List<String> grantTokens);
/**
* @return A list of grant tokens to be used when calling KMS.
*/
List<String> grantTokens();
CreateAwsKmsMultiKeyringInput build();
}
static class BuilderImpl implements Builder {
protected String generator;
protected List<String> kmsKeyIds;
protected IClientSupplier clientSupplier;
protected List<String> grantTokens;
protected BuilderImpl() {
}
protected BuilderImpl(CreateAwsKmsMultiKeyringInput model) {
this.generator = model.generator();
this.kmsKeyIds = model.kmsKeyIds();
this.clientSupplier = model.clientSupplier();
this.grantTokens = model.grantTokens();
}
public Builder generator(String generator) {
this.generator = generator;
return this;
}
public String generator() {
return this.generator;
}
public Builder kmsKeyIds(List<String> kmsKeyIds) {
this.kmsKeyIds = kmsKeyIds;
return this;
}
public List<String> kmsKeyIds() {
return this.kmsKeyIds;
}
public Builder clientSupplier(IClientSupplier clientSupplier) {
this.clientSupplier = ClientSupplier.wrap(clientSupplier);
return this;
}
public IClientSupplier clientSupplier() {
return this.clientSupplier;
}
public Builder grantTokens(List<String> grantTokens) {
this.grantTokens = grantTokens;
return this;
}
public List<String> grantTokens() {
return this.grantTokens;
}
public CreateAwsKmsMultiKeyringInput build() {
return new CreateAwsKmsMultiKeyringInput(this);
}
}
}
| 374 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CreateRawAesKeyringInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.nio.ByteBuffer;
import java.util.Objects;
/**
* Inputs for creating a Raw AES Keyring.
*/
public class CreateRawAesKeyringInput {
/**
* A namespace associated with this wrapping key.
*/
private final String keyNamespace;
/**
* A name associated with this wrapping key.
*/
private final String keyName;
/**
* The AES key used with AES_GCM encryption and decryption.
*/
private final ByteBuffer wrappingKey;
/**
* The AES_GCM algorithm this Keyring uses to wrap and unwrap data keys.
*/
private final AesWrappingAlg wrappingAlg;
protected CreateRawAesKeyringInput(BuilderImpl builder) {
this.keyNamespace = builder.keyNamespace();
this.keyName = builder.keyName();
this.wrappingKey = builder.wrappingKey();
this.wrappingAlg = builder.wrappingAlg();
}
/**
* @return A namespace associated with this wrapping key.
*/
public String keyNamespace() {
return this.keyNamespace;
}
/**
* @return A name associated with this wrapping key.
*/
public String keyName() {
return this.keyName;
}
/**
* @return The AES key used with AES_GCM encryption and decryption.
*/
public ByteBuffer wrappingKey() {
return this.wrappingKey;
}
/**
* @return The AES_GCM algorithm this Keyring uses to wrap and unwrap data keys.
*/
public AesWrappingAlg wrappingAlg() {
return this.wrappingAlg;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param keyNamespace A namespace associated with this wrapping key.
*/
Builder keyNamespace(String keyNamespace);
/**
* @return A namespace associated with this wrapping key.
*/
String keyNamespace();
/**
* @param keyName A name associated with this wrapping key.
*/
Builder keyName(String keyName);
/**
* @return A name associated with this wrapping key.
*/
String keyName();
/**
* @param wrappingKey The AES key used with AES_GCM encryption and decryption.
*/
Builder wrappingKey(ByteBuffer wrappingKey);
/**
* @return The AES key used with AES_GCM encryption and decryption.
*/
ByteBuffer wrappingKey();
/**
* @param wrappingAlg The AES_GCM algorithm this Keyring uses to wrap and unwrap data keys.
*/
Builder wrappingAlg(AesWrappingAlg wrappingAlg);
/**
* @return The AES_GCM algorithm this Keyring uses to wrap and unwrap data keys.
*/
AesWrappingAlg wrappingAlg();
CreateRawAesKeyringInput build();
}
static class BuilderImpl implements Builder {
protected String keyNamespace;
protected String keyName;
protected ByteBuffer wrappingKey;
protected AesWrappingAlg wrappingAlg;
protected BuilderImpl() {
}
protected BuilderImpl(CreateRawAesKeyringInput model) {
this.keyNamespace = model.keyNamespace();
this.keyName = model.keyName();
this.wrappingKey = model.wrappingKey();
this.wrappingAlg = model.wrappingAlg();
}
public Builder keyNamespace(String keyNamespace) {
this.keyNamespace = keyNamespace;
return this;
}
public String keyNamespace() {
return this.keyNamespace;
}
public Builder keyName(String keyName) {
this.keyName = keyName;
return this;
}
public String keyName() {
return this.keyName;
}
public Builder wrappingKey(ByteBuffer wrappingKey) {
this.wrappingKey = wrappingKey;
return this;
}
public ByteBuffer wrappingKey() {
return this.wrappingKey;
}
public Builder wrappingAlg(AesWrappingAlg wrappingAlg) {
this.wrappingAlg = wrappingAlg;
return this;
}
public AesWrappingAlg wrappingAlg() {
return this.wrappingAlg;
}
public CreateRawAesKeyringInput build() {
if (Objects.isNull(this.keyNamespace())) {
throw new IllegalArgumentException("Missing value for required field `keyNamespace`");
}
if (Objects.isNull(this.keyName())) {
throw new IllegalArgumentException("Missing value for required field `keyName`");
}
if (Objects.isNull(this.wrappingKey())) {
throw new IllegalArgumentException("Missing value for required field `wrappingKey`");
}
if (Objects.isNull(this.wrappingAlg())) {
throw new IllegalArgumentException("Missing value for required field `wrappingAlg`");
}
return new CreateRawAesKeyringInput(this);
}
}
}
| 375 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/DecryptMaterialsOutput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class DecryptMaterialsOutput {
private final DecryptionMaterials decryptionMaterials;
protected DecryptMaterialsOutput(BuilderImpl builder) {
this.decryptionMaterials = builder.decryptionMaterials();
}
public DecryptionMaterials decryptionMaterials() {
return this.decryptionMaterials;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder decryptionMaterials(DecryptionMaterials decryptionMaterials);
DecryptionMaterials decryptionMaterials();
DecryptMaterialsOutput build();
}
static class BuilderImpl implements Builder {
protected DecryptionMaterials decryptionMaterials;
protected BuilderImpl() {
}
protected BuilderImpl(DecryptMaterialsOutput model) {
this.decryptionMaterials = model.decryptionMaterials();
}
public Builder decryptionMaterials(DecryptionMaterials decryptionMaterials) {
this.decryptionMaterials = decryptionMaterials;
return this;
}
public DecryptionMaterials decryptionMaterials() {
return this.decryptionMaterials;
}
public DecryptMaterialsOutput build() {
if (Objects.isNull(this.decryptionMaterials())) {
throw new IllegalArgumentException("Missing value for required field `decryptionMaterials`");
}
return new DecryptMaterialsOutput(this);
}
}
}
| 376 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/ValidEncryptionMaterialsTransitionInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class ValidEncryptionMaterialsTransitionInput {
private final EncryptionMaterials start;
private final EncryptionMaterials stop;
protected ValidEncryptionMaterialsTransitionInput(BuilderImpl builder) {
this.start = builder.start();
this.stop = builder.stop();
}
public EncryptionMaterials start() {
return this.start;
}
public EncryptionMaterials stop() {
return this.stop;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder start(EncryptionMaterials start);
EncryptionMaterials start();
Builder stop(EncryptionMaterials stop);
EncryptionMaterials stop();
ValidEncryptionMaterialsTransitionInput build();
}
static class BuilderImpl implements Builder {
protected EncryptionMaterials start;
protected EncryptionMaterials stop;
protected BuilderImpl() {
}
protected BuilderImpl(ValidEncryptionMaterialsTransitionInput model) {
this.start = model.start();
this.stop = model.stop();
}
public Builder start(EncryptionMaterials start) {
this.start = start;
return this;
}
public EncryptionMaterials start() {
return this.start;
}
public Builder stop(EncryptionMaterials stop) {
this.stop = stop;
return this;
}
public EncryptionMaterials stop() {
return this.stop;
}
public ValidEncryptionMaterialsTransitionInput build() {
if (Objects.isNull(this.start())) {
throw new IllegalArgumentException("Missing value for required field `start`");
}
if (Objects.isNull(this.stop())) {
throw new IllegalArgumentException("Missing value for required field `stop`");
}
return new ValidEncryptionMaterialsTransitionInput(this);
}
}
}
| 377 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/None.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
public class None {
protected None(BuilderImpl builder) {
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
None build();
}
static class BuilderImpl implements Builder {
protected BuilderImpl() {
}
protected BuilderImpl(None model) {
}
public None build() {
return new None(this);
}
}
}
| 378 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/InvalidEncryptionMaterials.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class InvalidEncryptionMaterials extends RuntimeException {
protected InvalidEncryptionMaterials(BuilderImpl builder) {
super(messageFromBuilder(builder), builder.cause());
}
private static String messageFromBuilder(Builder builder) {
if (builder.message() != null) {
return builder.message();
}
if (builder.cause() != null) {
return builder.cause().getMessage();
}
return null;
}
/**
* See {@link Throwable#getMessage()}.
*/
public String message() {
return this.getMessage();
}
/**
* See {@link Throwable#getCause()}.
*/
public Throwable cause() {
return this.getCause();
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param message The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
Builder message(String message);
/**
* @return The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
String message();
/**
* @param cause The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Builder cause(Throwable cause);
/**
* @return The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Throwable cause();
InvalidEncryptionMaterials build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected BuilderImpl() {
}
protected BuilderImpl(InvalidEncryptionMaterials model) {
this.message = model.message();
this.cause = model.cause();
}
public Builder message(String message) {
this.message = message;
return this;
}
public String message() {
return this.message;
}
public Builder cause(Throwable cause) {
this.cause = cause;
return this;
}
public Throwable cause() {
return this.cause;
}
public InvalidEncryptionMaterials build() {
if (Objects.isNull(this.message())) {
throw new IllegalArgumentException("Missing value for required field `message`");
}
return new InvalidEncryptionMaterials(this);
}
}
}
| 379 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CreateAwsKmsDiscoveryKeyringInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.List;
import java.util.Objects;
import software.amazon.awssdk.services.kms.KmsClient;
/**
* Inputs for for creating a AWS KMS Discovery Keyring.
*/
public class CreateAwsKmsDiscoveryKeyringInput {
/**
* The KMS Client this Keyring will use to call KMS.
*/
private final KmsClient kmsClient;
/**
* A filter which restricts which KMS Keys this Keyring may attempt to decrypt with by AWS partition and account.
*/
private final DiscoveryFilter discoveryFilter;
/**
* A list of grant tokens to be used when calling KMS.
*/
private final List<String> grantTokens;
protected CreateAwsKmsDiscoveryKeyringInput(BuilderImpl builder) {
this.kmsClient = builder.kmsClient();
this.discoveryFilter = builder.discoveryFilter();
this.grantTokens = builder.grantTokens();
}
/**
* @return The KMS Client this Keyring will use to call KMS.
*/
public KmsClient kmsClient() {
return this.kmsClient;
}
/**
* @return A filter which restricts which KMS Keys this Keyring may attempt to decrypt with by AWS partition and account.
*/
public DiscoveryFilter discoveryFilter() {
return this.discoveryFilter;
}
/**
* @return A list of grant tokens to be used when calling KMS.
*/
public List<String> grantTokens() {
return this.grantTokens;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param kmsClient The KMS Client this Keyring will use to call KMS.
*/
Builder kmsClient(KmsClient kmsClient);
/**
* @return The KMS Client this Keyring will use to call KMS.
*/
KmsClient kmsClient();
/**
* @param discoveryFilter A filter which restricts which KMS Keys this Keyring may attempt to decrypt with by AWS partition and account.
*/
Builder discoveryFilter(DiscoveryFilter discoveryFilter);
/**
* @return A filter which restricts which KMS Keys this Keyring may attempt to decrypt with by AWS partition and account.
*/
DiscoveryFilter discoveryFilter();
/**
* @param grantTokens A list of grant tokens to be used when calling KMS.
*/
Builder grantTokens(List<String> grantTokens);
/**
* @return A list of grant tokens to be used when calling KMS.
*/
List<String> grantTokens();
CreateAwsKmsDiscoveryKeyringInput build();
}
static class BuilderImpl implements Builder {
protected KmsClient kmsClient;
protected DiscoveryFilter discoveryFilter;
protected List<String> grantTokens;
protected BuilderImpl() {
}
protected BuilderImpl(CreateAwsKmsDiscoveryKeyringInput model) {
this.kmsClient = model.kmsClient();
this.discoveryFilter = model.discoveryFilter();
this.grantTokens = model.grantTokens();
}
public Builder kmsClient(KmsClient kmsClient) {
this.kmsClient = kmsClient;
return this;
}
public KmsClient kmsClient() {
return this.kmsClient;
}
public Builder discoveryFilter(DiscoveryFilter discoveryFilter) {
this.discoveryFilter = discoveryFilter;
return this;
}
public DiscoveryFilter discoveryFilter() {
return this.discoveryFilter;
}
public Builder grantTokens(List<String> grantTokens) {
this.grantTokens = grantTokens;
return this;
}
public List<String> grantTokens() {
return this.grantTokens;
}
public CreateAwsKmsDiscoveryKeyringInput build() {
if (Objects.isNull(this.kmsClient())) {
throw new IllegalArgumentException("Missing value for required field `kmsClient`");
}
return new CreateAwsKmsDiscoveryKeyringInput(this);
}
}
}
| 380 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/OnDecryptInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.List;
import java.util.Objects;
public class OnDecryptInput {
private final DecryptionMaterials materials;
private final List<EncryptedDataKey> encryptedDataKeys;
protected OnDecryptInput(BuilderImpl builder) {
this.materials = builder.materials();
this.encryptedDataKeys = builder.encryptedDataKeys();
}
public DecryptionMaterials materials() {
return this.materials;
}
public List<EncryptedDataKey> encryptedDataKeys() {
return this.encryptedDataKeys;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder materials(DecryptionMaterials materials);
DecryptionMaterials materials();
Builder encryptedDataKeys(List<EncryptedDataKey> encryptedDataKeys);
List<EncryptedDataKey> encryptedDataKeys();
OnDecryptInput build();
}
static class BuilderImpl implements Builder {
protected DecryptionMaterials materials;
protected List<EncryptedDataKey> encryptedDataKeys;
protected BuilderImpl() {
}
protected BuilderImpl(OnDecryptInput model) {
this.materials = model.materials();
this.encryptedDataKeys = model.encryptedDataKeys();
}
public Builder materials(DecryptionMaterials materials) {
this.materials = materials;
return this;
}
public DecryptionMaterials materials() {
return this.materials;
}
public Builder encryptedDataKeys(List<EncryptedDataKey> encryptedDataKeys) {
this.encryptedDataKeys = encryptedDataKeys;
return this;
}
public List<EncryptedDataKey> encryptedDataKeys() {
return this.encryptedDataKeys;
}
public OnDecryptInput build() {
if (Objects.isNull(this.materials())) {
throw new IllegalArgumentException("Missing value for required field `materials`");
}
if (Objects.isNull(this.encryptedDataKeys())) {
throw new IllegalArgumentException("Missing value for required field `encryptedDataKeys`");
}
return new OnDecryptInput(this);
}
}
}
| 381 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/ESDKAlgorithmSuiteId.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
public enum ESDKAlgorithmSuiteId {
ALG_AES_128_GCM_IV12_TAG16_NO_KDF("0x0014"),
ALG_AES_192_GCM_IV12_TAG16_NO_KDF("0x0046"),
ALG_AES_256_GCM_IV12_TAG16_NO_KDF("0x0078"),
ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256("0x0114"),
ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA256("0x0146"),
ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA256("0x0178"),
ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256("0x0214"),
ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384("0x0346"),
ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384("0x0378"),
ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY("0x0478"),
ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384("0x0578");
private final String value;
private ESDKAlgorithmSuiteId(String value) {
this.value = value;
}
public String toString() {
return String.valueOf(value);
}
}
| 382 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/DIRECT_KEY_WRAPPING.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
public class DIRECT_KEY_WRAPPING {
protected DIRECT_KEY_WRAPPING(BuilderImpl builder) {
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
DIRECT_KEY_WRAPPING build();
}
static class BuilderImpl implements Builder {
protected BuilderImpl() {
}
protected BuilderImpl(DIRECT_KEY_WRAPPING model) {
}
public DIRECT_KEY_WRAPPING build() {
return new DIRECT_KEY_WRAPPING(this);
}
}
}
| 383 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/MultiThreadedCache.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
/**
* A cache that is safe for use in a multi threaded environment, but no extra functionality.
*/
public class MultiThreadedCache {
/**
* Maximum number of entries cached.
*/
private final int entryCapacity;
/**
* Number of entries to prune at a time.
*/
private final int entryPruningTailSize;
protected MultiThreadedCache(BuilderImpl builder) {
this.entryCapacity = builder.entryCapacity();
this.entryPruningTailSize = builder.entryPruningTailSize();
}
/**
* @return Maximum number of entries cached.
*/
public int entryCapacity() {
return this.entryCapacity;
}
/**
* @return Number of entries to prune at a time.
*/
public int entryPruningTailSize() {
return this.entryPruningTailSize;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param entryCapacity Maximum number of entries cached.
*/
Builder entryCapacity(int entryCapacity);
/**
* @return Maximum number of entries cached.
*/
int entryCapacity();
/**
* @param entryPruningTailSize Number of entries to prune at a time.
*/
Builder entryPruningTailSize(int entryPruningTailSize);
/**
* @return Number of entries to prune at a time.
*/
int entryPruningTailSize();
MultiThreadedCache build();
}
static class BuilderImpl implements Builder {
protected int entryCapacity;
private boolean _entryCapacitySet = false;
protected int entryPruningTailSize;
private boolean _entryPruningTailSizeSet = false;
protected BuilderImpl() {
}
protected BuilderImpl(MultiThreadedCache model) {
this.entryCapacity = model.entryCapacity();
this._entryCapacitySet = true;
this.entryPruningTailSize = model.entryPruningTailSize();
this._entryPruningTailSizeSet = true;
}
public Builder entryCapacity(int entryCapacity) {
this.entryCapacity = entryCapacity;
this._entryCapacitySet = true;
return this;
}
public int entryCapacity() {
return this.entryCapacity;
}
public Builder entryPruningTailSize(int entryPruningTailSize) {
this.entryPruningTailSize = entryPruningTailSize;
this._entryPruningTailSizeSet = true;
return this;
}
public int entryPruningTailSize() {
return this.entryPruningTailSize;
}
public MultiThreadedCache build() {
if (!this._entryCapacitySet) {
throw new IllegalArgumentException("Missing value for required field `entryCapacity`");
}
if (this._entryCapacitySet && this.entryCapacity() < 1) {
throw new IllegalArgumentException("`entryCapacity` must be greater than or equal to 1");
}
if (this._entryPruningTailSizeSet && this.entryPruningTailSize() < 1) {
throw new IllegalArgumentException("`entryPruningTailSize` must be greater than or equal to 1");
}
return new MultiThreadedCache(this);
}
}
}
| 384 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CommitmentPolicy.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class CommitmentPolicy {
private final ESDKCommitmentPolicy ESDK;
private final DBECommitmentPolicy DBE;
protected CommitmentPolicy(BuilderImpl builder) {
this.ESDK = builder.ESDK();
this.DBE = builder.DBE();
}
public ESDKCommitmentPolicy ESDK() {
return this.ESDK;
}
public DBECommitmentPolicy DBE() {
return this.DBE;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder ESDK(ESDKCommitmentPolicy ESDK);
ESDKCommitmentPolicy ESDK();
Builder DBE(DBECommitmentPolicy DBE);
DBECommitmentPolicy DBE();
CommitmentPolicy build();
}
static class BuilderImpl implements Builder {
protected ESDKCommitmentPolicy ESDK;
protected DBECommitmentPolicy DBE;
protected BuilderImpl() {
}
protected BuilderImpl(CommitmentPolicy model) {
this.ESDK = model.ESDK();
this.DBE = model.DBE();
}
public Builder ESDK(ESDKCommitmentPolicy ESDK) {
this.ESDK = ESDK;
return this;
}
public ESDKCommitmentPolicy ESDK() {
return this.ESDK;
}
public Builder DBE(DBECommitmentPolicy DBE) {
this.DBE = DBE;
return this;
}
public DBECommitmentPolicy DBE() {
return this.DBE;
}
public CommitmentPolicy build() {
if (!onlyOneNonNull()) {
throw new IllegalArgumentException("`CommitmentPolicy` is a Union. A Union MUST have one and only one value set.");
}
return new CommitmentPolicy(this);
}
private boolean onlyOneNonNull() {
Object[] allValues = {this.ESDK, this.DBE};
boolean haveOneNonNull = false;
for (Object o : allValues) {
if (Objects.nonNull(o)) {
if (haveOneNonNull) {
return false;
}
haveOneNonNull = true;
}
}
return haveOneNonNull;
}
}
}
| 385 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/InvalidAlgorithmSuiteInfoOnDecrypt.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class InvalidAlgorithmSuiteInfoOnDecrypt extends RuntimeException {
protected InvalidAlgorithmSuiteInfoOnDecrypt(BuilderImpl builder) {
super(messageFromBuilder(builder), builder.cause());
}
private static String messageFromBuilder(Builder builder) {
if (builder.message() != null) {
return builder.message();
}
if (builder.cause() != null) {
return builder.cause().getMessage();
}
return null;
}
/**
* See {@link Throwable#getMessage()}.
*/
public String message() {
return this.getMessage();
}
/**
* See {@link Throwable#getCause()}.
*/
public Throwable cause() {
return this.getCause();
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param message The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
Builder message(String message);
/**
* @return The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
String message();
/**
* @param cause The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Builder cause(Throwable cause);
/**
* @return The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Throwable cause();
InvalidAlgorithmSuiteInfoOnDecrypt build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected BuilderImpl() {
}
protected BuilderImpl(InvalidAlgorithmSuiteInfoOnDecrypt model) {
this.message = model.message();
this.cause = model.cause();
}
public Builder message(String message) {
this.message = message;
return this;
}
public String message() {
return this.message;
}
public Builder cause(Throwable cause) {
this.cause = cause;
return this;
}
public Throwable cause() {
return this.cause;
}
public InvalidAlgorithmSuiteInfoOnDecrypt build() {
if (Objects.isNull(this.message())) {
throw new IllegalArgumentException("Missing value for required field `message`");
}
return new InvalidAlgorithmSuiteInfoOnDecrypt(this);
}
}
}
| 386 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CreateAwsKmsMrkKeyringInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.List;
import java.util.Objects;
import software.amazon.awssdk.services.kms.KmsClient;
/**
* Inputs for for creating an AWS KMS MRK Keyring.
*/
public class CreateAwsKmsMrkKeyringInput {
/**
* The identifier for the symmetric AWS KMS Key or AWS KMS Multi-Region Key responsible for wrapping and unwrapping data keys.
*/
private final String kmsKeyId;
/**
* The KMS Client this Keyring will use to call KMS.
*/
private final KmsClient kmsClient;
/**
* A list of grant tokens to be used when calling KMS.
*/
private final List<String> grantTokens;
protected CreateAwsKmsMrkKeyringInput(BuilderImpl builder) {
this.kmsKeyId = builder.kmsKeyId();
this.kmsClient = builder.kmsClient();
this.grantTokens = builder.grantTokens();
}
/**
* @return The identifier for the symmetric AWS KMS Key or AWS KMS Multi-Region Key responsible for wrapping and unwrapping data keys.
*/
public String kmsKeyId() {
return this.kmsKeyId;
}
/**
* @return The KMS Client this Keyring will use to call KMS.
*/
public KmsClient kmsClient() {
return this.kmsClient;
}
/**
* @return A list of grant tokens to be used when calling KMS.
*/
public List<String> grantTokens() {
return this.grantTokens;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param kmsKeyId The identifier for the symmetric AWS KMS Key or AWS KMS Multi-Region Key responsible for wrapping and unwrapping data keys.
*/
Builder kmsKeyId(String kmsKeyId);
/**
* @return The identifier for the symmetric AWS KMS Key or AWS KMS Multi-Region Key responsible for wrapping and unwrapping data keys.
*/
String kmsKeyId();
/**
* @param kmsClient The KMS Client this Keyring will use to call KMS.
*/
Builder kmsClient(KmsClient kmsClient);
/**
* @return The KMS Client this Keyring will use to call KMS.
*/
KmsClient kmsClient();
/**
* @param grantTokens A list of grant tokens to be used when calling KMS.
*/
Builder grantTokens(List<String> grantTokens);
/**
* @return A list of grant tokens to be used when calling KMS.
*/
List<String> grantTokens();
CreateAwsKmsMrkKeyringInput build();
}
static class BuilderImpl implements Builder {
protected String kmsKeyId;
protected KmsClient kmsClient;
protected List<String> grantTokens;
protected BuilderImpl() {
}
protected BuilderImpl(CreateAwsKmsMrkKeyringInput model) {
this.kmsKeyId = model.kmsKeyId();
this.kmsClient = model.kmsClient();
this.grantTokens = model.grantTokens();
}
public Builder kmsKeyId(String kmsKeyId) {
this.kmsKeyId = kmsKeyId;
return this;
}
public String kmsKeyId() {
return this.kmsKeyId;
}
public Builder kmsClient(KmsClient kmsClient) {
this.kmsClient = kmsClient;
return this;
}
public KmsClient kmsClient() {
return this.kmsClient;
}
public Builder grantTokens(List<String> grantTokens) {
this.grantTokens = grantTokens;
return this;
}
public List<String> grantTokens() {
return this.grantTokens;
}
public CreateAwsKmsMrkKeyringInput build() {
if (Objects.isNull(this.kmsKeyId())) {
throw new IllegalArgumentException("Missing value for required field `kmsKeyId`");
}
if (Objects.isNull(this.kmsClient())) {
throw new IllegalArgumentException("Missing value for required field `kmsClient`");
}
return new CreateAwsKmsMrkKeyringInput(this);
}
}
}
| 387 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CreateAwsKmsHierarchicalKeyringInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
import software.amazon.cryptography.keystore.KeyStore;
import software.amazon.cryptography.materialproviders.BranchKeyIdSupplier;
import software.amazon.cryptography.materialproviders.IBranchKeyIdSupplier;
/**
* Inputs for creating a Hierarchical Keyring.
*/
public class CreateAwsKmsHierarchicalKeyringInput {
/**
* The identifier for the single Branch Key responsible for wrapping and unwrapping the data key. Either a Branch Key ID or Branch Key Supplier must be specified.
*/
private final String branchKeyId;
/**
* A Branch Key Supplier which determines what Branch Key to use to wrap and unwrap the data key. Either a Branch Key ID or Branch Key Supplier must be specified.
*/
private final IBranchKeyIdSupplier branchKeyIdSupplier;
/**
* The Key Store which contains the Branch Key(s) responsible for wrapping and unwrapping data keys.
*/
private final KeyStore keyStore;
/**
* How many seconds the Branch Key material is allowed to be reused within the local cache before it is re-retrieved from Amazon DynamoDB and re-authenticated with AWS KMS.
*/
private final long ttlSeconds;
/**
* Which type of local cache to use.
*/
private final CacheType cache;
protected CreateAwsKmsHierarchicalKeyringInput(BuilderImpl builder) {
this.branchKeyId = builder.branchKeyId();
this.branchKeyIdSupplier = builder.branchKeyIdSupplier();
this.keyStore = builder.keyStore();
this.ttlSeconds = builder.ttlSeconds();
this.cache = builder.cache();
}
/**
* @return The identifier for the single Branch Key responsible for wrapping and unwrapping the data key. Either a Branch Key ID or Branch Key Supplier must be specified.
*/
public String branchKeyId() {
return this.branchKeyId;
}
/**
* @return A Branch Key Supplier which determines what Branch Key to use to wrap and unwrap the data key. Either a Branch Key ID or Branch Key Supplier must be specified.
*/
public IBranchKeyIdSupplier branchKeyIdSupplier() {
return this.branchKeyIdSupplier;
}
/**
* @return The Key Store which contains the Branch Key(s) responsible for wrapping and unwrapping data keys.
*/
public KeyStore keyStore() {
return this.keyStore;
}
/**
* @return How many seconds the Branch Key material is allowed to be reused within the local cache before it is re-retrieved from Amazon DynamoDB and re-authenticated with AWS KMS.
*/
public long ttlSeconds() {
return this.ttlSeconds;
}
/**
* @return Which type of local cache to use.
*/
public CacheType cache() {
return this.cache;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param branchKeyId The identifier for the single Branch Key responsible for wrapping and unwrapping the data key. Either a Branch Key ID or Branch Key Supplier must be specified.
*/
Builder branchKeyId(String branchKeyId);
/**
* @return The identifier for the single Branch Key responsible for wrapping and unwrapping the data key. Either a Branch Key ID or Branch Key Supplier must be specified.
*/
String branchKeyId();
/**
* @param branchKeyIdSupplier A Branch Key Supplier which determines what Branch Key to use to wrap and unwrap the data key. Either a Branch Key ID or Branch Key Supplier must be specified.
*/
Builder branchKeyIdSupplier(IBranchKeyIdSupplier branchKeyIdSupplier);
/**
* @return A Branch Key Supplier which determines what Branch Key to use to wrap and unwrap the data key. Either a Branch Key ID or Branch Key Supplier must be specified.
*/
IBranchKeyIdSupplier branchKeyIdSupplier();
/**
* @param keyStore The Key Store which contains the Branch Key(s) responsible for wrapping and unwrapping data keys.
*/
Builder keyStore(KeyStore keyStore);
/**
* @return The Key Store which contains the Branch Key(s) responsible for wrapping and unwrapping data keys.
*/
KeyStore keyStore();
/**
* @param ttlSeconds How many seconds the Branch Key material is allowed to be reused within the local cache before it is re-retrieved from Amazon DynamoDB and re-authenticated with AWS KMS.
*/
Builder ttlSeconds(long ttlSeconds);
/**
* @return How many seconds the Branch Key material is allowed to be reused within the local cache before it is re-retrieved from Amazon DynamoDB and re-authenticated with AWS KMS.
*/
long ttlSeconds();
/**
* @param cache Which type of local cache to use.
*/
Builder cache(CacheType cache);
/**
* @return Which type of local cache to use.
*/
CacheType cache();
CreateAwsKmsHierarchicalKeyringInput build();
}
static class BuilderImpl implements Builder {
protected String branchKeyId;
protected IBranchKeyIdSupplier branchKeyIdSupplier;
protected KeyStore keyStore;
protected long ttlSeconds;
private boolean _ttlSecondsSet = false;
protected CacheType cache;
protected BuilderImpl() {
}
protected BuilderImpl(CreateAwsKmsHierarchicalKeyringInput model) {
this.branchKeyId = model.branchKeyId();
this.branchKeyIdSupplier = model.branchKeyIdSupplier();
this.keyStore = model.keyStore();
this.ttlSeconds = model.ttlSeconds();
this._ttlSecondsSet = true;
this.cache = model.cache();
}
public Builder branchKeyId(String branchKeyId) {
this.branchKeyId = branchKeyId;
return this;
}
public String branchKeyId() {
return this.branchKeyId;
}
public Builder branchKeyIdSupplier(IBranchKeyIdSupplier branchKeyIdSupplier) {
this.branchKeyIdSupplier = BranchKeyIdSupplier.wrap(branchKeyIdSupplier);
return this;
}
public IBranchKeyIdSupplier branchKeyIdSupplier() {
return this.branchKeyIdSupplier;
}
public Builder keyStore(KeyStore keyStore) {
this.keyStore = keyStore;
return this;
}
public KeyStore keyStore() {
return this.keyStore;
}
public Builder ttlSeconds(long ttlSeconds) {
this.ttlSeconds = ttlSeconds;
this._ttlSecondsSet = true;
return this;
}
public long ttlSeconds() {
return this.ttlSeconds;
}
public Builder cache(CacheType cache) {
this.cache = cache;
return this;
}
public CacheType cache() {
return this.cache;
}
public CreateAwsKmsHierarchicalKeyringInput build() {
if (Objects.isNull(this.keyStore())) {
throw new IllegalArgumentException("Missing value for required field `keyStore`");
}
if (!this._ttlSecondsSet) {
throw new IllegalArgumentException("Missing value for required field `ttlSeconds`");
}
if (this._ttlSecondsSet && this.ttlSeconds() < 0) {
throw new IllegalArgumentException("`ttlSeconds` must be greater than or equal to 0");
}
return new CreateAwsKmsHierarchicalKeyringInput(this);
}
}
}
| 388 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/GetCacheEntryOutput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class GetCacheEntryOutput {
private final Materials materials;
private final long creationTime;
private final long expiryTime;
private final int messagesUsed;
private final int bytesUsed;
protected GetCacheEntryOutput(BuilderImpl builder) {
this.materials = builder.materials();
this.creationTime = builder.creationTime();
this.expiryTime = builder.expiryTime();
this.messagesUsed = builder.messagesUsed();
this.bytesUsed = builder.bytesUsed();
}
public Materials materials() {
return this.materials;
}
public long creationTime() {
return this.creationTime;
}
public long expiryTime() {
return this.expiryTime;
}
public int messagesUsed() {
return this.messagesUsed;
}
public int bytesUsed() {
return this.bytesUsed;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder materials(Materials materials);
Materials materials();
Builder creationTime(long creationTime);
long creationTime();
Builder expiryTime(long expiryTime);
long expiryTime();
Builder messagesUsed(int messagesUsed);
int messagesUsed();
Builder bytesUsed(int bytesUsed);
int bytesUsed();
GetCacheEntryOutput build();
}
static class BuilderImpl implements Builder {
protected Materials materials;
protected long creationTime;
private boolean _creationTimeSet = false;
protected long expiryTime;
private boolean _expiryTimeSet = false;
protected int messagesUsed;
private boolean _messagesUsedSet = false;
protected int bytesUsed;
private boolean _bytesUsedSet = false;
protected BuilderImpl() {
}
protected BuilderImpl(GetCacheEntryOutput model) {
this.materials = model.materials();
this.creationTime = model.creationTime();
this._creationTimeSet = true;
this.expiryTime = model.expiryTime();
this._expiryTimeSet = true;
this.messagesUsed = model.messagesUsed();
this._messagesUsedSet = true;
this.bytesUsed = model.bytesUsed();
this._bytesUsedSet = true;
}
public Builder materials(Materials materials) {
this.materials = materials;
return this;
}
public Materials materials() {
return this.materials;
}
public Builder creationTime(long creationTime) {
this.creationTime = creationTime;
this._creationTimeSet = true;
return this;
}
public long creationTime() {
return this.creationTime;
}
public Builder expiryTime(long expiryTime) {
this.expiryTime = expiryTime;
this._expiryTimeSet = true;
return this;
}
public long expiryTime() {
return this.expiryTime;
}
public Builder messagesUsed(int messagesUsed) {
this.messagesUsed = messagesUsed;
this._messagesUsedSet = true;
return this;
}
public int messagesUsed() {
return this.messagesUsed;
}
public Builder bytesUsed(int bytesUsed) {
this.bytesUsed = bytesUsed;
this._bytesUsedSet = true;
return this;
}
public int bytesUsed() {
return this.bytesUsed;
}
public GetCacheEntryOutput build() {
if (Objects.isNull(this.materials())) {
throw new IllegalArgumentException("Missing value for required field `materials`");
}
if (!this._creationTimeSet) {
throw new IllegalArgumentException("Missing value for required field `creationTime`");
}
if (this._creationTimeSet && this.creationTime() < 0) {
throw new IllegalArgumentException("`creationTime` must be greater than or equal to 0");
}
if (!this._expiryTimeSet) {
throw new IllegalArgumentException("Missing value for required field `expiryTime`");
}
if (this._expiryTimeSet && this.expiryTime() < 0) {
throw new IllegalArgumentException("`expiryTime` must be greater than or equal to 0");
}
if (!this._messagesUsedSet) {
throw new IllegalArgumentException("Missing value for required field `messagesUsed`");
}
if (this._messagesUsedSet && this.messagesUsed() < 0) {
throw new IllegalArgumentException("`messagesUsed` must be greater than or equal to 0");
}
if (!this._bytesUsedSet) {
throw new IllegalArgumentException("Missing value for required field `bytesUsed`");
}
if (this._bytesUsedSet && this.bytesUsed() < 0) {
throw new IllegalArgumentException("`bytesUsed` must be greater than or equal to 0");
}
return new GetCacheEntryOutput(this);
}
}
}
| 389 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/ValidDecryptionMaterialsTransitionInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class ValidDecryptionMaterialsTransitionInput {
private final DecryptionMaterials start;
private final DecryptionMaterials stop;
protected ValidDecryptionMaterialsTransitionInput(BuilderImpl builder) {
this.start = builder.start();
this.stop = builder.stop();
}
public DecryptionMaterials start() {
return this.start;
}
public DecryptionMaterials stop() {
return this.stop;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder start(DecryptionMaterials start);
DecryptionMaterials start();
Builder stop(DecryptionMaterials stop);
DecryptionMaterials stop();
ValidDecryptionMaterialsTransitionInput build();
}
static class BuilderImpl implements Builder {
protected DecryptionMaterials start;
protected DecryptionMaterials stop;
protected BuilderImpl() {
}
protected BuilderImpl(ValidDecryptionMaterialsTransitionInput model) {
this.start = model.start();
this.stop = model.stop();
}
public Builder start(DecryptionMaterials start) {
this.start = start;
return this;
}
public DecryptionMaterials start() {
return this.start;
}
public Builder stop(DecryptionMaterials stop) {
this.stop = stop;
return this;
}
public DecryptionMaterials stop() {
return this.stop;
}
public ValidDecryptionMaterialsTransitionInput build() {
if (Objects.isNull(this.start())) {
throw new IllegalArgumentException("Missing value for required field `start`");
}
if (Objects.isNull(this.stop())) {
throw new IllegalArgumentException("Missing value for required field `stop`");
}
return new ValidDecryptionMaterialsTransitionInput(this);
}
}
}
| 390 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/GetClientInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
/**
* Inputs for getting a AWS KMS Client.
*/
public class GetClientInput {
/**
* The region the client should be created in.
*/
private final String region;
protected GetClientInput(BuilderImpl builder) {
this.region = builder.region();
}
/**
* @return The region the client should be created in.
*/
public String region() {
return this.region;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param region The region the client should be created in.
*/
Builder region(String region);
/**
* @return The region the client should be created in.
*/
String region();
GetClientInput build();
}
static class BuilderImpl implements Builder {
protected String region;
protected BuilderImpl() {
}
protected BuilderImpl(GetClientInput model) {
this.region = model.region();
}
public Builder region(String region) {
this.region = region;
return this;
}
public String region() {
return this.region;
}
public GetClientInput build() {
if (Objects.isNull(this.region())) {
throw new IllegalArgumentException("Missing value for required field `region`");
}
return new GetClientInput(this);
}
}
}
| 391 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/DerivationAlgorithm.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class DerivationAlgorithm {
private final HKDF HKDF;
private final IDENTITY IDENTITY;
private final None None;
protected DerivationAlgorithm(BuilderImpl builder) {
this.HKDF = builder.HKDF();
this.IDENTITY = builder.IDENTITY();
this.None = builder.None();
}
public HKDF HKDF() {
return this.HKDF;
}
public IDENTITY IDENTITY() {
return this.IDENTITY;
}
public None None() {
return this.None;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder HKDF(HKDF HKDF);
HKDF HKDF();
Builder IDENTITY(IDENTITY IDENTITY);
IDENTITY IDENTITY();
Builder None(None None);
None None();
DerivationAlgorithm build();
}
static class BuilderImpl implements Builder {
protected HKDF HKDF;
protected IDENTITY IDENTITY;
protected None None;
protected BuilderImpl() {
}
protected BuilderImpl(DerivationAlgorithm model) {
this.HKDF = model.HKDF();
this.IDENTITY = model.IDENTITY();
this.None = model.None();
}
public Builder HKDF(HKDF HKDF) {
this.HKDF = HKDF;
return this;
}
public HKDF HKDF() {
return this.HKDF;
}
public Builder IDENTITY(IDENTITY IDENTITY) {
this.IDENTITY = IDENTITY;
return this;
}
public IDENTITY IDENTITY() {
return this.IDENTITY;
}
public Builder None(None None) {
this.None = None;
return this;
}
public None None() {
return this.None;
}
public DerivationAlgorithm build() {
if (!onlyOneNonNull()) {
throw new IllegalArgumentException("`DerivationAlgorithm` is a Union. A Union MUST have one and only one value set.");
}
return new DerivationAlgorithm(this);
}
private boolean onlyOneNonNull() {
Object[] allValues = {this.HKDF, this.IDENTITY, this.None};
boolean haveOneNonNull = false;
for (Object o : allValues) {
if (Objects.nonNull(o)) {
if (haveOneNonNull) {
return false;
}
haveOneNonNull = true;
}
}
return haveOneNonNull;
}
}
}
| 392 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/SymmetricSignatureAlgorithm.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
import software.amazon.cryptography.primitives.model.DigestAlgorithm;
public class SymmetricSignatureAlgorithm {
private final DigestAlgorithm HMAC;
private final None None;
protected SymmetricSignatureAlgorithm(BuilderImpl builder) {
this.HMAC = builder.HMAC();
this.None = builder.None();
}
public DigestAlgorithm HMAC() {
return this.HMAC;
}
public None None() {
return this.None;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder HMAC(DigestAlgorithm HMAC);
DigestAlgorithm HMAC();
Builder None(None None);
None None();
SymmetricSignatureAlgorithm build();
}
static class BuilderImpl implements Builder {
protected DigestAlgorithm HMAC;
protected None None;
protected BuilderImpl() {
}
protected BuilderImpl(SymmetricSignatureAlgorithm model) {
this.HMAC = model.HMAC();
this.None = model.None();
}
public Builder HMAC(DigestAlgorithm HMAC) {
this.HMAC = HMAC;
return this;
}
public DigestAlgorithm HMAC() {
return this.HMAC;
}
public Builder None(None None) {
this.None = None;
return this;
}
public None None() {
return this.None;
}
public SymmetricSignatureAlgorithm build() {
if (!onlyOneNonNull()) {
throw new IllegalArgumentException("`SymmetricSignatureAlgorithm` is a Union. A Union MUST have one and only one value set.");
}
return new SymmetricSignatureAlgorithm(this);
}
private boolean onlyOneNonNull() {
Object[] allValues = {this.HMAC, this.None};
boolean haveOneNonNull = false;
for (Object o : allValues) {
if (Objects.nonNull(o)) {
if (haveOneNonNull) {
return false;
}
haveOneNonNull = true;
}
}
return haveOneNonNull;
}
}
}
| 393 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/InvalidDecryptionMaterialsTransition.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class InvalidDecryptionMaterialsTransition extends RuntimeException {
protected InvalidDecryptionMaterialsTransition(BuilderImpl builder) {
super(messageFromBuilder(builder), builder.cause());
}
private static String messageFromBuilder(Builder builder) {
if (builder.message() != null) {
return builder.message();
}
if (builder.cause() != null) {
return builder.cause().getMessage();
}
return null;
}
/**
* See {@link Throwable#getMessage()}.
*/
public String message() {
return this.getMessage();
}
/**
* See {@link Throwable#getCause()}.
*/
public Throwable cause() {
return this.getCause();
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param message The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
Builder message(String message);
/**
* @return The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
String message();
/**
* @param cause The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Builder cause(Throwable cause);
/**
* @return The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Throwable cause();
InvalidDecryptionMaterialsTransition build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected BuilderImpl() {
}
protected BuilderImpl(InvalidDecryptionMaterialsTransition model) {
this.message = model.message();
this.cause = model.cause();
}
public Builder message(String message) {
this.message = message;
return this;
}
public String message() {
return this.message;
}
public Builder cause(Throwable cause) {
this.cause = cause;
return this;
}
public Throwable cause() {
return this.cause;
}
public InvalidDecryptionMaterialsTransition build() {
if (Objects.isNull(this.message())) {
throw new IllegalArgumentException("Missing value for required field `message`");
}
return new InvalidDecryptionMaterialsTransition(this);
}
}
}
| 394 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/OnEncryptInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class OnEncryptInput {
private final EncryptionMaterials materials;
protected OnEncryptInput(BuilderImpl builder) {
this.materials = builder.materials();
}
public EncryptionMaterials materials() {
return this.materials;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder materials(EncryptionMaterials materials);
EncryptionMaterials materials();
OnEncryptInput build();
}
static class BuilderImpl implements Builder {
protected EncryptionMaterials materials;
protected BuilderImpl() {
}
protected BuilderImpl(OnEncryptInput model) {
this.materials = model.materials();
}
public Builder materials(EncryptionMaterials materials) {
this.materials = materials;
return this;
}
public EncryptionMaterials materials() {
return this.materials;
}
public OnEncryptInput build() {
if (Objects.isNull(this.materials())) {
throw new IllegalArgumentException("Missing value for required field `materials`");
}
return new OnEncryptInput(this);
}
}
}
| 395 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CreateAwsKmsRsaKeyringInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.Objects;
import software.amazon.awssdk.services.kms.KmsClient;
import software.amazon.awssdk.services.kms.model.EncryptionAlgorithmSpec;
/**
* Inputs for creating a AWS KMS RSA Keyring.
*/
public class CreateAwsKmsRsaKeyringInput {
/**
* The public RSA Key responsible for wrapping data keys, as a UTF8 encoded, PEM encoded X.509 SubjectPublicKeyInfo structure. This should be the public key as exported from KMS. If not specified, this Keyring cannot be used on encrypt.
*/
private final ByteBuffer publicKey;
/**
* The ARN for the asymmetric AWS KMS Key for RSA responsible for wrapping and unwrapping data keys.
*/
private final String kmsKeyId;
/**
* The RSA algorithm used to wrap and unwrap data keys.
*/
private final EncryptionAlgorithmSpec encryptionAlgorithm;
/**
* The KMS Client this Keyring will use to call KMS.
*/
private final KmsClient kmsClient;
/**
* A list of grant tokens to be used when calling KMS.
*/
private final List<String> grantTokens;
protected CreateAwsKmsRsaKeyringInput(BuilderImpl builder) {
this.publicKey = builder.publicKey();
this.kmsKeyId = builder.kmsKeyId();
this.encryptionAlgorithm = builder.encryptionAlgorithm();
this.kmsClient = builder.kmsClient();
this.grantTokens = builder.grantTokens();
}
/**
* @return The public RSA Key responsible for wrapping data keys, as a UTF8 encoded, PEM encoded X.509 SubjectPublicKeyInfo structure. This should be the public key as exported from KMS. If not specified, this Keyring cannot be used on encrypt.
*/
public ByteBuffer publicKey() {
return this.publicKey;
}
/**
* @return The ARN for the asymmetric AWS KMS Key for RSA responsible for wrapping and unwrapping data keys.
*/
public String kmsKeyId() {
return this.kmsKeyId;
}
/**
* @return The RSA algorithm used to wrap and unwrap data keys.
*/
public EncryptionAlgorithmSpec encryptionAlgorithm() {
return this.encryptionAlgorithm;
}
/**
* @return The KMS Client this Keyring will use to call KMS.
*/
public KmsClient kmsClient() {
return this.kmsClient;
}
/**
* @return A list of grant tokens to be used when calling KMS.
*/
public List<String> grantTokens() {
return this.grantTokens;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param publicKey The public RSA Key responsible for wrapping data keys, as a UTF8 encoded, PEM encoded X.509 SubjectPublicKeyInfo structure. This should be the public key as exported from KMS. If not specified, this Keyring cannot be used on encrypt.
*/
Builder publicKey(ByteBuffer publicKey);
/**
* @return The public RSA Key responsible for wrapping data keys, as a UTF8 encoded, PEM encoded X.509 SubjectPublicKeyInfo structure. This should be the public key as exported from KMS. If not specified, this Keyring cannot be used on encrypt.
*/
ByteBuffer publicKey();
/**
* @param kmsKeyId The ARN for the asymmetric AWS KMS Key for RSA responsible for wrapping and unwrapping data keys.
*/
Builder kmsKeyId(String kmsKeyId);
/**
* @return The ARN for the asymmetric AWS KMS Key for RSA responsible for wrapping and unwrapping data keys.
*/
String kmsKeyId();
/**
* @param encryptionAlgorithm The RSA algorithm used to wrap and unwrap data keys.
*/
Builder encryptionAlgorithm(EncryptionAlgorithmSpec encryptionAlgorithm);
/**
* @return The RSA algorithm used to wrap and unwrap data keys.
*/
EncryptionAlgorithmSpec encryptionAlgorithm();
/**
* @param kmsClient The KMS Client this Keyring will use to call KMS.
*/
Builder kmsClient(KmsClient kmsClient);
/**
* @return The KMS Client this Keyring will use to call KMS.
*/
KmsClient kmsClient();
/**
* @param grantTokens A list of grant tokens to be used when calling KMS.
*/
Builder grantTokens(List<String> grantTokens);
/**
* @return A list of grant tokens to be used when calling KMS.
*/
List<String> grantTokens();
CreateAwsKmsRsaKeyringInput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer publicKey;
protected String kmsKeyId;
protected EncryptionAlgorithmSpec encryptionAlgorithm;
protected KmsClient kmsClient;
protected List<String> grantTokens;
protected BuilderImpl() {
}
protected BuilderImpl(CreateAwsKmsRsaKeyringInput model) {
this.publicKey = model.publicKey();
this.kmsKeyId = model.kmsKeyId();
this.encryptionAlgorithm = model.encryptionAlgorithm();
this.kmsClient = model.kmsClient();
this.grantTokens = model.grantTokens();
}
public Builder publicKey(ByteBuffer publicKey) {
this.publicKey = publicKey;
return this;
}
public ByteBuffer publicKey() {
return this.publicKey;
}
public Builder kmsKeyId(String kmsKeyId) {
this.kmsKeyId = kmsKeyId;
return this;
}
public String kmsKeyId() {
return this.kmsKeyId;
}
public Builder encryptionAlgorithm(EncryptionAlgorithmSpec encryptionAlgorithm) {
this.encryptionAlgorithm = encryptionAlgorithm;
return this;
}
public EncryptionAlgorithmSpec encryptionAlgorithm() {
return this.encryptionAlgorithm;
}
public Builder kmsClient(KmsClient kmsClient) {
this.kmsClient = kmsClient;
return this;
}
public KmsClient kmsClient() {
return this.kmsClient;
}
public Builder grantTokens(List<String> grantTokens) {
this.grantTokens = grantTokens;
return this;
}
public List<String> grantTokens() {
return this.grantTokens;
}
public CreateAwsKmsRsaKeyringInput build() {
if (Objects.isNull(this.kmsKeyId())) {
throw new IllegalArgumentException("Missing value for required field `kmsKeyId`");
}
if (Objects.isNull(this.encryptionAlgorithm())) {
throw new IllegalArgumentException("Missing value for required field `encryptionAlgorithm`");
}
return new CreateAwsKmsRsaKeyringInput(this);
}
}
}
| 396 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/UpdateUsageMetadataInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class UpdateUsageMetadataInput {
private final ByteBuffer identifier;
private final int bytesUsed;
protected UpdateUsageMetadataInput(BuilderImpl builder) {
this.identifier = builder.identifier();
this.bytesUsed = builder.bytesUsed();
}
public ByteBuffer identifier() {
return this.identifier;
}
public int bytesUsed() {
return this.bytesUsed;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder identifier(ByteBuffer identifier);
ByteBuffer identifier();
Builder bytesUsed(int bytesUsed);
int bytesUsed();
UpdateUsageMetadataInput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer identifier;
protected int bytesUsed;
private boolean _bytesUsedSet = false;
protected BuilderImpl() {
}
protected BuilderImpl(UpdateUsageMetadataInput model) {
this.identifier = model.identifier();
this.bytesUsed = model.bytesUsed();
this._bytesUsedSet = true;
}
public Builder identifier(ByteBuffer identifier) {
this.identifier = identifier;
return this;
}
public ByteBuffer identifier() {
return this.identifier;
}
public Builder bytesUsed(int bytesUsed) {
this.bytesUsed = bytesUsed;
this._bytesUsedSet = true;
return this;
}
public int bytesUsed() {
return this.bytesUsed;
}
public UpdateUsageMetadataInput build() {
if (Objects.isNull(this.identifier())) {
throw new IllegalArgumentException("Missing value for required field `identifier`");
}
if (!this._bytesUsedSet) {
throw new IllegalArgumentException("Missing value for required field `bytesUsed`");
}
if (this._bytesUsedSet && this.bytesUsed() < 0) {
throw new IllegalArgumentException("`bytesUsed` must be greater than or equal to 0");
}
return new UpdateUsageMetadataInput(this);
}
}
}
| 397 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/StormTrackingCache.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
/**
* A cache that is safe for use in a multi threaded environment,
* and tries to prevent redundant or overly parallel backend calls.
*/
public class StormTrackingCache {
/**
* Maximum number of entries cached.
*/
private final int entryCapacity;
/**
* Number of entries to prune at a time.
*/
private final int entryPruningTailSize;
/**
* How many seconds before expiration should an attempt be made to refresh the materials.
* If zero, use a simple cache with no storm tracking.
*/
private final int gracePeriod;
/**
* How many seconds between attempts to refresh the materials.
*/
private final int graceInterval;
/**
* How many simultaneous attempts to refresh the materials.
*/
private final int fanOut;
/**
* How many seconds until an attempt to refresh the materials should be forgotten.
*/
private final int inFlightTTL;
/**
* How many milliseconds should a thread sleep if fanOut is exceeded.
*/
private final int sleepMilli;
protected StormTrackingCache(BuilderImpl builder) {
this.entryCapacity = builder.entryCapacity();
this.entryPruningTailSize = builder.entryPruningTailSize();
this.gracePeriod = builder.gracePeriod();
this.graceInterval = builder.graceInterval();
this.fanOut = builder.fanOut();
this.inFlightTTL = builder.inFlightTTL();
this.sleepMilli = builder.sleepMilli();
}
/**
* @return Maximum number of entries cached.
*/
public int entryCapacity() {
return this.entryCapacity;
}
/**
* @return Number of entries to prune at a time.
*/
public int entryPruningTailSize() {
return this.entryPruningTailSize;
}
/**
* @return How many seconds before expiration should an attempt be made to refresh the materials.
* If zero, use a simple cache with no storm tracking.
*/
public int gracePeriod() {
return this.gracePeriod;
}
/**
* @return How many seconds between attempts to refresh the materials.
*/
public int graceInterval() {
return this.graceInterval;
}
/**
* @return How many simultaneous attempts to refresh the materials.
*/
public int fanOut() {
return this.fanOut;
}
/**
* @return How many seconds until an attempt to refresh the materials should be forgotten.
*/
public int inFlightTTL() {
return this.inFlightTTL;
}
/**
* @return How many milliseconds should a thread sleep if fanOut is exceeded.
*/
public int sleepMilli() {
return this.sleepMilli;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param entryCapacity Maximum number of entries cached.
*/
Builder entryCapacity(int entryCapacity);
/**
* @return Maximum number of entries cached.
*/
int entryCapacity();
/**
* @param entryPruningTailSize Number of entries to prune at a time.
*/
Builder entryPruningTailSize(int entryPruningTailSize);
/**
* @return Number of entries to prune at a time.
*/
int entryPruningTailSize();
/**
* @param gracePeriod How many seconds before expiration should an attempt be made to refresh the materials.
* If zero, use a simple cache with no storm tracking.
*/
Builder gracePeriod(int gracePeriod);
/**
* @return How many seconds before expiration should an attempt be made to refresh the materials.
* If zero, use a simple cache with no storm tracking.
*/
int gracePeriod();
/**
* @param graceInterval How many seconds between attempts to refresh the materials.
*/
Builder graceInterval(int graceInterval);
/**
* @return How many seconds between attempts to refresh the materials.
*/
int graceInterval();
/**
* @param fanOut How many simultaneous attempts to refresh the materials.
*/
Builder fanOut(int fanOut);
/**
* @return How many simultaneous attempts to refresh the materials.
*/
int fanOut();
/**
* @param inFlightTTL How many seconds until an attempt to refresh the materials should be forgotten.
*/
Builder inFlightTTL(int inFlightTTL);
/**
* @return How many seconds until an attempt to refresh the materials should be forgotten.
*/
int inFlightTTL();
/**
* @param sleepMilli How many milliseconds should a thread sleep if fanOut is exceeded.
*/
Builder sleepMilli(int sleepMilli);
/**
* @return How many milliseconds should a thread sleep if fanOut is exceeded.
*/
int sleepMilli();
StormTrackingCache build();
}
static class BuilderImpl implements Builder {
protected int entryCapacity;
private boolean _entryCapacitySet = false;
protected int entryPruningTailSize;
private boolean _entryPruningTailSizeSet = false;
protected int gracePeriod;
private boolean _gracePeriodSet = false;
protected int graceInterval;
private boolean _graceIntervalSet = false;
protected int fanOut;
private boolean _fanOutSet = false;
protected int inFlightTTL;
private boolean _inFlightTTLSet = false;
protected int sleepMilli;
private boolean _sleepMilliSet = false;
protected BuilderImpl() {
}
protected BuilderImpl(StormTrackingCache model) {
this.entryCapacity = model.entryCapacity();
this._entryCapacitySet = true;
this.entryPruningTailSize = model.entryPruningTailSize();
this._entryPruningTailSizeSet = true;
this.gracePeriod = model.gracePeriod();
this._gracePeriodSet = true;
this.graceInterval = model.graceInterval();
this._graceIntervalSet = true;
this.fanOut = model.fanOut();
this._fanOutSet = true;
this.inFlightTTL = model.inFlightTTL();
this._inFlightTTLSet = true;
this.sleepMilli = model.sleepMilli();
this._sleepMilliSet = true;
}
public Builder entryCapacity(int entryCapacity) {
this.entryCapacity = entryCapacity;
this._entryCapacitySet = true;
return this;
}
public int entryCapacity() {
return this.entryCapacity;
}
public Builder entryPruningTailSize(int entryPruningTailSize) {
this.entryPruningTailSize = entryPruningTailSize;
this._entryPruningTailSizeSet = true;
return this;
}
public int entryPruningTailSize() {
return this.entryPruningTailSize;
}
public Builder gracePeriod(int gracePeriod) {
this.gracePeriod = gracePeriod;
this._gracePeriodSet = true;
return this;
}
public int gracePeriod() {
return this.gracePeriod;
}
public Builder graceInterval(int graceInterval) {
this.graceInterval = graceInterval;
this._graceIntervalSet = true;
return this;
}
public int graceInterval() {
return this.graceInterval;
}
public Builder fanOut(int fanOut) {
this.fanOut = fanOut;
this._fanOutSet = true;
return this;
}
public int fanOut() {
return this.fanOut;
}
public Builder inFlightTTL(int inFlightTTL) {
this.inFlightTTL = inFlightTTL;
this._inFlightTTLSet = true;
return this;
}
public int inFlightTTL() {
return this.inFlightTTL;
}
public Builder sleepMilli(int sleepMilli) {
this.sleepMilli = sleepMilli;
this._sleepMilliSet = true;
return this;
}
public int sleepMilli() {
return this.sleepMilli;
}
public StormTrackingCache build() {
if (!this._entryCapacitySet) {
throw new IllegalArgumentException("Missing value for required field `entryCapacity`");
}
if (this._entryCapacitySet && this.entryCapacity() < 1) {
throw new IllegalArgumentException("`entryCapacity` must be greater than or equal to 1");
}
if (this._entryPruningTailSizeSet && this.entryPruningTailSize() < 1) {
throw new IllegalArgumentException("`entryPruningTailSize` must be greater than or equal to 1");
}
if (!this._gracePeriodSet) {
throw new IllegalArgumentException("Missing value for required field `gracePeriod`");
}
if (this._gracePeriodSet && this.gracePeriod() < 1) {
throw new IllegalArgumentException("`gracePeriod` must be greater than or equal to 1");
}
if (!this._graceIntervalSet) {
throw new IllegalArgumentException("Missing value for required field `graceInterval`");
}
if (this._graceIntervalSet && this.graceInterval() < 1) {
throw new IllegalArgumentException("`graceInterval` must be greater than or equal to 1");
}
if (!this._fanOutSet) {
throw new IllegalArgumentException("Missing value for required field `fanOut`");
}
if (this._fanOutSet && this.fanOut() < 1) {
throw new IllegalArgumentException("`fanOut` must be greater than or equal to 1");
}
if (!this._inFlightTTLSet) {
throw new IllegalArgumentException("Missing value for required field `inFlightTTL`");
}
if (this._inFlightTTLSet && this.inFlightTTL() < 1) {
throw new IllegalArgumentException("`inFlightTTL` must be greater than or equal to 1");
}
if (!this._sleepMilliSet) {
throw new IllegalArgumentException("Missing value for required field `sleepMilli`");
}
if (this._sleepMilliSet && this.sleepMilli() < 1) {
throw new IllegalArgumentException("`sleepMilli` must be greater than or equal to 1");
}
return new StormTrackingCache(this);
}
}
}
| 398 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/MaterialProvidersConfig.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
public class MaterialProvidersConfig {
protected MaterialProvidersConfig(BuilderImpl builder) {
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
MaterialProvidersConfig build();
}
static class BuilderImpl implements Builder {
protected BuilderImpl() {
}
protected BuilderImpl(MaterialProvidersConfig model) {
}
public MaterialProvidersConfig build() {
return new MaterialProvidersConfig(this);
}
}
}
| 399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.