index
int64 0
0
| repo_id
stringlengths 9
205
| file_path
stringlengths 31
246
| content
stringlengths 1
12.2M
| __index_level_0__
int64 0
10k
|
---|---|---|---|---|
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/RSAEncryptInput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class RSAEncryptInput {
private final RSAPaddingMode padding;
private final ByteBuffer publicKey;
private final ByteBuffer plaintext;
protected RSAEncryptInput(BuilderImpl builder) {
this.padding = builder.padding();
this.publicKey = builder.publicKey();
this.plaintext = builder.plaintext();
}
public RSAPaddingMode padding() {
return this.padding;
}
public ByteBuffer publicKey() {
return this.publicKey;
}
public ByteBuffer plaintext() {
return this.plaintext;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder padding(RSAPaddingMode padding);
RSAPaddingMode padding();
Builder publicKey(ByteBuffer publicKey);
ByteBuffer publicKey();
Builder plaintext(ByteBuffer plaintext);
ByteBuffer plaintext();
RSAEncryptInput build();
}
static class BuilderImpl implements Builder {
protected RSAPaddingMode padding;
protected ByteBuffer publicKey;
protected ByteBuffer plaintext;
protected BuilderImpl() {
}
protected BuilderImpl(RSAEncryptInput model) {
this.padding = model.padding();
this.publicKey = model.publicKey();
this.plaintext = model.plaintext();
}
public Builder padding(RSAPaddingMode padding) {
this.padding = padding;
return this;
}
public RSAPaddingMode padding() {
return this.padding;
}
public Builder publicKey(ByteBuffer publicKey) {
this.publicKey = publicKey;
return this;
}
public ByteBuffer publicKey() {
return this.publicKey;
}
public Builder plaintext(ByteBuffer plaintext) {
this.plaintext = plaintext;
return this;
}
public ByteBuffer plaintext() {
return this.plaintext;
}
public RSAEncryptInput build() {
if (Objects.isNull(this.padding())) {
throw new IllegalArgumentException("Missing value for required field `padding`");
}
if (Objects.isNull(this.publicKey())) {
throw new IllegalArgumentException("Missing value for required field `publicKey`");
}
if (Objects.isNull(this.plaintext())) {
throw new IllegalArgumentException("Missing value for required field `plaintext`");
}
return new RSAEncryptInput(this);
}
}
}
| 3,000 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/AESEncryptOutput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class AESEncryptOutput {
private final ByteBuffer cipherText;
private final ByteBuffer authTag;
protected AESEncryptOutput(BuilderImpl builder) {
this.cipherText = builder.cipherText();
this.authTag = builder.authTag();
}
public ByteBuffer cipherText() {
return this.cipherText;
}
public ByteBuffer authTag() {
return this.authTag;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder cipherText(ByteBuffer cipherText);
ByteBuffer cipherText();
Builder authTag(ByteBuffer authTag);
ByteBuffer authTag();
AESEncryptOutput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer cipherText;
protected ByteBuffer authTag;
protected BuilderImpl() {
}
protected BuilderImpl(AESEncryptOutput model) {
this.cipherText = model.cipherText();
this.authTag = model.authTag();
}
public Builder cipherText(ByteBuffer cipherText) {
this.cipherText = cipherText;
return this;
}
public ByteBuffer cipherText() {
return this.cipherText;
}
public Builder authTag(ByteBuffer authTag) {
this.authTag = authTag;
return this;
}
public ByteBuffer authTag() {
return this.authTag;
}
public AESEncryptOutput build() {
if (Objects.isNull(this.cipherText())) {
throw new IllegalArgumentException("Missing value for required field `cipherText`");
}
if (Objects.isNull(this.authTag())) {
throw new IllegalArgumentException("Missing value for required field `authTag`");
}
return new AESEncryptOutput(this);
}
}
}
| 3,001 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/RSAPublicKey.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class RSAPublicKey {
private final int lengthBits;
private final ByteBuffer pem;
protected RSAPublicKey(BuilderImpl builder) {
this.lengthBits = builder.lengthBits();
this.pem = builder.pem();
}
public int lengthBits() {
return this.lengthBits;
}
public ByteBuffer pem() {
return this.pem;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder lengthBits(int lengthBits);
int lengthBits();
Builder pem(ByteBuffer pem);
ByteBuffer pem();
RSAPublicKey build();
}
static class BuilderImpl implements Builder {
protected int lengthBits;
private boolean _lengthBitsSet = false;
protected ByteBuffer pem;
protected BuilderImpl() {
}
protected BuilderImpl(RSAPublicKey model) {
this.lengthBits = model.lengthBits();
this._lengthBitsSet = true;
this.pem = model.pem();
}
public Builder lengthBits(int lengthBits) {
this.lengthBits = lengthBits;
this._lengthBitsSet = true;
return this;
}
public int lengthBits() {
return this.lengthBits;
}
public Builder pem(ByteBuffer pem) {
this.pem = pem;
return this;
}
public ByteBuffer pem() {
return this.pem;
}
public RSAPublicKey build() {
if (!this._lengthBitsSet) {
throw new IllegalArgumentException("Missing value for required field `lengthBits`");
}
if (this._lengthBitsSet && this.lengthBits() < 81) {
throw new IllegalArgumentException("`lengthBits` must be greater than or equal to 81");
}
if (Objects.isNull(this.pem())) {
throw new IllegalArgumentException("Missing value for required field `pem`");
}
return new RSAPublicKey(this);
}
}
}
| 3,002 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/DigestInput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class DigestInput {
private final DigestAlgorithm digestAlgorithm;
private final ByteBuffer message;
protected DigestInput(BuilderImpl builder) {
this.digestAlgorithm = builder.digestAlgorithm();
this.message = builder.message();
}
public DigestAlgorithm digestAlgorithm() {
return this.digestAlgorithm;
}
public ByteBuffer message() {
return this.message;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder digestAlgorithm(DigestAlgorithm digestAlgorithm);
DigestAlgorithm digestAlgorithm();
Builder message(ByteBuffer message);
ByteBuffer message();
DigestInput build();
}
static class BuilderImpl implements Builder {
protected DigestAlgorithm digestAlgorithm;
protected ByteBuffer message;
protected BuilderImpl() {
}
protected BuilderImpl(DigestInput model) {
this.digestAlgorithm = model.digestAlgorithm();
this.message = model.message();
}
public Builder digestAlgorithm(DigestAlgorithm digestAlgorithm) {
this.digestAlgorithm = digestAlgorithm;
return this;
}
public DigestAlgorithm digestAlgorithm() {
return this.digestAlgorithm;
}
public Builder message(ByteBuffer message) {
this.message = message;
return this;
}
public ByteBuffer message() {
return this.message;
}
public DigestInput build() {
if (Objects.isNull(this.digestAlgorithm())) {
throw new IllegalArgumentException("Missing value for required field `digestAlgorithm`");
}
if (Objects.isNull(this.message())) {
throw new IllegalArgumentException("Missing value for required field `message`");
}
return new DigestInput(this);
}
}
}
| 3,003 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/ECDSASignatureAlgorithm.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.primitives.model;
public enum ECDSASignatureAlgorithm {
ECDSA_P384("ECDSA_P384"),
ECDSA_P256("ECDSA_P256");
private final String value;
private ECDSASignatureAlgorithm(String value) {
this.value = value;
}
public String toString() {
return String.valueOf(value);
}
}
| 3,004 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/AES_GCM.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.primitives.model;
public class AES_GCM {
private final int keyLength;
private final int tagLength;
private final int ivLength;
protected AES_GCM(BuilderImpl builder) {
this.keyLength = builder.keyLength();
this.tagLength = builder.tagLength();
this.ivLength = builder.ivLength();
}
public int keyLength() {
return this.keyLength;
}
public int tagLength() {
return this.tagLength;
}
public int ivLength() {
return this.ivLength;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder keyLength(int keyLength);
int keyLength();
Builder tagLength(int tagLength);
int tagLength();
Builder ivLength(int ivLength);
int ivLength();
AES_GCM build();
}
static class BuilderImpl implements Builder {
protected int keyLength;
private boolean _keyLengthSet = false;
protected int tagLength;
private boolean _tagLengthSet = false;
protected int ivLength;
private boolean _ivLengthSet = false;
protected BuilderImpl() {
}
protected BuilderImpl(AES_GCM model) {
this.keyLength = model.keyLength();
this._keyLengthSet = true;
this.tagLength = model.tagLength();
this._tagLengthSet = true;
this.ivLength = model.ivLength();
this._ivLengthSet = true;
}
public Builder keyLength(int keyLength) {
this.keyLength = keyLength;
this._keyLengthSet = true;
return this;
}
public int keyLength() {
return this.keyLength;
}
public Builder tagLength(int tagLength) {
this.tagLength = tagLength;
this._tagLengthSet = true;
return this;
}
public int tagLength() {
return this.tagLength;
}
public Builder ivLength(int ivLength) {
this.ivLength = ivLength;
this._ivLengthSet = true;
return this;
}
public int ivLength() {
return this.ivLength;
}
public AES_GCM build() {
if (!this._keyLengthSet) {
throw new IllegalArgumentException("Missing value for required field `keyLength`");
}
if (this._keyLengthSet && this.keyLength() < 1) {
throw new IllegalArgumentException("`keyLength` must be greater than or equal to 1");
}
if (this._keyLengthSet && this.keyLength() > 32) {
throw new IllegalArgumentException("`keyLength` must be less than or equal to 32.");
}
if (!this._tagLengthSet) {
throw new IllegalArgumentException("Missing value for required field `tagLength`");
}
if (this._tagLengthSet && this.tagLength() < 0) {
throw new IllegalArgumentException("`tagLength` must be greater than or equal to 0");
}
if (this._tagLengthSet && this.tagLength() > 32) {
throw new IllegalArgumentException("`tagLength` must be less than or equal to 32.");
}
if (!this._ivLengthSet) {
throw new IllegalArgumentException("Missing value for required field `ivLength`");
}
if (this._ivLengthSet && this.ivLength() < 0) {
throw new IllegalArgumentException("`ivLength` must be greater than or equal to 0");
}
if (this._ivLengthSet && this.ivLength() > 255) {
throw new IllegalArgumentException("`ivLength` must be less than or equal to 255.");
}
return new AES_GCM(this);
}
}
}
| 3,005 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/RSAPaddingMode.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.primitives.model;
public enum RSAPaddingMode {
PKCS1("PKCS1"),
OAEP_SHA1("OAEP_SHA1"),
OAEP_SHA256("OAEP_SHA256"),
OAEP_SHA384("OAEP_SHA384"),
OAEP_SHA512("OAEP_SHA512");
private final String value;
private RSAPaddingMode(String value) {
this.value = value;
}
public String toString() {
return String.valueOf(value);
}
}
| 3,006 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/RSAEncryptOutput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class RSAEncryptOutput {
private final ByteBuffer cipherText;
protected RSAEncryptOutput(BuilderImpl builder) {
this.cipherText = builder.cipherText();
}
public ByteBuffer cipherText() {
return this.cipherText;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder cipherText(ByteBuffer cipherText);
ByteBuffer cipherText();
RSAEncryptOutput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer cipherText;
protected BuilderImpl() {
}
protected BuilderImpl(RSAEncryptOutput model) {
this.cipherText = model.cipherText();
}
public Builder cipherText(ByteBuffer cipherText) {
this.cipherText = cipherText;
return this;
}
public ByteBuffer cipherText() {
return this.cipherText;
}
public RSAEncryptOutput build() {
if (Objects.isNull(this.cipherText())) {
throw new IllegalArgumentException("Missing value for required field `cipherText`");
}
return new RSAEncryptOutput(this);
}
}
}
| 3,007 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/ECDSASignOutput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class ECDSASignOutput {
private final ByteBuffer signature;
protected ECDSASignOutput(BuilderImpl builder) {
this.signature = builder.signature();
}
public ByteBuffer signature() {
return this.signature;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder signature(ByteBuffer signature);
ByteBuffer signature();
ECDSASignOutput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer signature;
protected BuilderImpl() {
}
protected BuilderImpl(ECDSASignOutput model) {
this.signature = model.signature();
}
public Builder signature(ByteBuffer signature) {
this.signature = signature;
return this;
}
public ByteBuffer signature() {
return this.signature;
}
public ECDSASignOutput build() {
if (Objects.isNull(this.signature())) {
throw new IllegalArgumentException("Missing value for required field `signature`");
}
return new ECDSASignOutput(this);
}
}
}
| 3,008 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/KdfCtrOutput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class KdfCtrOutput {
private final ByteBuffer okm;
protected KdfCtrOutput(BuilderImpl builder) {
this.okm = builder.okm();
}
public ByteBuffer okm() {
return this.okm;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder okm(ByteBuffer okm);
ByteBuffer okm();
KdfCtrOutput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer okm;
protected BuilderImpl() {
}
protected BuilderImpl(KdfCtrOutput model) {
this.okm = model.okm();
}
public Builder okm(ByteBuffer okm) {
this.okm = okm;
return this;
}
public ByteBuffer okm() {
return this.okm;
}
public KdfCtrOutput build() {
if (Objects.isNull(this.okm())) {
throw new IllegalArgumentException("Missing value for required field `okm`");
}
return new KdfCtrOutput(this);
}
}
}
| 3,009 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/RSADecryptInput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class RSADecryptInput {
private final RSAPaddingMode padding;
private final ByteBuffer privateKey;
private final ByteBuffer cipherText;
protected RSADecryptInput(BuilderImpl builder) {
this.padding = builder.padding();
this.privateKey = builder.privateKey();
this.cipherText = builder.cipherText();
}
public RSAPaddingMode padding() {
return this.padding;
}
public ByteBuffer privateKey() {
return this.privateKey;
}
public ByteBuffer cipherText() {
return this.cipherText;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder padding(RSAPaddingMode padding);
RSAPaddingMode padding();
Builder privateKey(ByteBuffer privateKey);
ByteBuffer privateKey();
Builder cipherText(ByteBuffer cipherText);
ByteBuffer cipherText();
RSADecryptInput build();
}
static class BuilderImpl implements Builder {
protected RSAPaddingMode padding;
protected ByteBuffer privateKey;
protected ByteBuffer cipherText;
protected BuilderImpl() {
}
protected BuilderImpl(RSADecryptInput model) {
this.padding = model.padding();
this.privateKey = model.privateKey();
this.cipherText = model.cipherText();
}
public Builder padding(RSAPaddingMode padding) {
this.padding = padding;
return this;
}
public RSAPaddingMode padding() {
return this.padding;
}
public Builder privateKey(ByteBuffer privateKey) {
this.privateKey = privateKey;
return this;
}
public ByteBuffer privateKey() {
return this.privateKey;
}
public Builder cipherText(ByteBuffer cipherText) {
this.cipherText = cipherText;
return this;
}
public ByteBuffer cipherText() {
return this.cipherText;
}
public RSADecryptInput build() {
if (Objects.isNull(this.padding())) {
throw new IllegalArgumentException("Missing value for required field `padding`");
}
if (Objects.isNull(this.privateKey())) {
throw new IllegalArgumentException("Missing value for required field `privateKey`");
}
if (Objects.isNull(this.cipherText())) {
throw new IllegalArgumentException("Missing value for required field `cipherText`");
}
return new RSADecryptInput(this);
}
}
}
| 3,010 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/AesKdfCtrInput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class AesKdfCtrInput {
private final ByteBuffer ikm;
private final int expectedLength;
private final ByteBuffer nonce;
protected AesKdfCtrInput(BuilderImpl builder) {
this.ikm = builder.ikm();
this.expectedLength = builder.expectedLength();
this.nonce = builder.nonce();
}
public ByteBuffer ikm() {
return this.ikm;
}
public int expectedLength() {
return this.expectedLength;
}
public ByteBuffer nonce() {
return this.nonce;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder ikm(ByteBuffer ikm);
ByteBuffer ikm();
Builder expectedLength(int expectedLength);
int expectedLength();
Builder nonce(ByteBuffer nonce);
ByteBuffer nonce();
AesKdfCtrInput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer ikm;
protected int expectedLength;
private boolean _expectedLengthSet = false;
protected ByteBuffer nonce;
protected BuilderImpl() {
}
protected BuilderImpl(AesKdfCtrInput model) {
this.ikm = model.ikm();
this.expectedLength = model.expectedLength();
this._expectedLengthSet = true;
this.nonce = model.nonce();
}
public Builder ikm(ByteBuffer ikm) {
this.ikm = ikm;
return this;
}
public ByteBuffer ikm() {
return this.ikm;
}
public Builder expectedLength(int expectedLength) {
this.expectedLength = expectedLength;
this._expectedLengthSet = true;
return this;
}
public int expectedLength() {
return this.expectedLength;
}
public Builder nonce(ByteBuffer nonce) {
this.nonce = nonce;
return this;
}
public ByteBuffer nonce() {
return this.nonce;
}
public AesKdfCtrInput build() {
if (Objects.isNull(this.ikm())) {
throw new IllegalArgumentException("Missing value for required field `ikm`");
}
if (!this._expectedLengthSet) {
throw new IllegalArgumentException("Missing value for required field `expectedLength`");
}
if (this._expectedLengthSet && this.expectedLength() < 0) {
throw new IllegalArgumentException("`expectedLength` must be greater than or equal to 0");
}
return new AesKdfCtrInput(this);
}
}
}
| 3,011 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/HkdfOutput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class HkdfOutput {
private final ByteBuffer okm;
protected HkdfOutput(BuilderImpl builder) {
this.okm = builder.okm();
}
public ByteBuffer okm() {
return this.okm;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder okm(ByteBuffer okm);
ByteBuffer okm();
HkdfOutput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer okm;
protected BuilderImpl() {
}
protected BuilderImpl(HkdfOutput model) {
this.okm = model.okm();
}
public Builder okm(ByteBuffer okm) {
this.okm = okm;
return this;
}
public ByteBuffer okm() {
return this.okm;
}
public HkdfOutput build() {
if (Objects.isNull(this.okm())) {
throw new IllegalArgumentException("Missing value for required field `okm`");
}
return new HkdfOutput(this);
}
}
}
| 3,012 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/HkdfExtractInput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class HkdfExtractInput {
private final DigestAlgorithm digestAlgorithm;
private final ByteBuffer salt;
private final ByteBuffer ikm;
protected HkdfExtractInput(BuilderImpl builder) {
this.digestAlgorithm = builder.digestAlgorithm();
this.salt = builder.salt();
this.ikm = builder.ikm();
}
public DigestAlgorithm digestAlgorithm() {
return this.digestAlgorithm;
}
public ByteBuffer salt() {
return this.salt;
}
public ByteBuffer ikm() {
return this.ikm;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder digestAlgorithm(DigestAlgorithm digestAlgorithm);
DigestAlgorithm digestAlgorithm();
Builder salt(ByteBuffer salt);
ByteBuffer salt();
Builder ikm(ByteBuffer ikm);
ByteBuffer ikm();
HkdfExtractInput build();
}
static class BuilderImpl implements Builder {
protected DigestAlgorithm digestAlgorithm;
protected ByteBuffer salt;
protected ByteBuffer ikm;
protected BuilderImpl() {
}
protected BuilderImpl(HkdfExtractInput model) {
this.digestAlgorithm = model.digestAlgorithm();
this.salt = model.salt();
this.ikm = model.ikm();
}
public Builder digestAlgorithm(DigestAlgorithm digestAlgorithm) {
this.digestAlgorithm = digestAlgorithm;
return this;
}
public DigestAlgorithm digestAlgorithm() {
return this.digestAlgorithm;
}
public Builder salt(ByteBuffer salt) {
this.salt = salt;
return this;
}
public ByteBuffer salt() {
return this.salt;
}
public Builder ikm(ByteBuffer ikm) {
this.ikm = ikm;
return this;
}
public ByteBuffer ikm() {
return this.ikm;
}
public HkdfExtractInput build() {
if (Objects.isNull(this.digestAlgorithm())) {
throw new IllegalArgumentException("Missing value for required field `digestAlgorithm`");
}
if (Objects.isNull(this.ikm())) {
throw new IllegalArgumentException("Missing value for required field `ikm`");
}
return new HkdfExtractInput(this);
}
}
}
| 3,013 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/RSAPrivateKey.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class RSAPrivateKey {
private final int lengthBits;
private final ByteBuffer pem;
protected RSAPrivateKey(BuilderImpl builder) {
this.lengthBits = builder.lengthBits();
this.pem = builder.pem();
}
public int lengthBits() {
return this.lengthBits;
}
public ByteBuffer pem() {
return this.pem;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder lengthBits(int lengthBits);
int lengthBits();
Builder pem(ByteBuffer pem);
ByteBuffer pem();
RSAPrivateKey build();
}
static class BuilderImpl implements Builder {
protected int lengthBits;
private boolean _lengthBitsSet = false;
protected ByteBuffer pem;
protected BuilderImpl() {
}
protected BuilderImpl(RSAPrivateKey model) {
this.lengthBits = model.lengthBits();
this._lengthBitsSet = true;
this.pem = model.pem();
}
public Builder lengthBits(int lengthBits) {
this.lengthBits = lengthBits;
this._lengthBitsSet = true;
return this;
}
public int lengthBits() {
return this.lengthBits;
}
public Builder pem(ByteBuffer pem) {
this.pem = pem;
return this;
}
public ByteBuffer pem() {
return this.pem;
}
public RSAPrivateKey build() {
if (!this._lengthBitsSet) {
throw new IllegalArgumentException("Missing value for required field `lengthBits`");
}
if (this._lengthBitsSet && this.lengthBits() < 81) {
throw new IllegalArgumentException("`lengthBits` must be greater than or equal to 81");
}
if (Objects.isNull(this.pem())) {
throw new IllegalArgumentException("Missing value for required field `pem`");
}
return new RSAPrivateKey(this);
}
}
}
| 3,014 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/DigestAlgorithm.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.primitives.model;
public enum DigestAlgorithm {
SHA_512("SHA_512"),
SHA_384("SHA_384"),
SHA_256("SHA_256");
private final String value;
private DigestAlgorithm(String value) {
this.value = value;
}
public String toString() {
return String.valueOf(value);
}
}
| 3,015 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/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.primitives.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);
}
}
}
| 3,016 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/HMacInput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class HMacInput {
private final DigestAlgorithm digestAlgorithm;
private final ByteBuffer key;
private final ByteBuffer message;
protected HMacInput(BuilderImpl builder) {
this.digestAlgorithm = builder.digestAlgorithm();
this.key = builder.key();
this.message = builder.message();
}
public DigestAlgorithm digestAlgorithm() {
return this.digestAlgorithm;
}
public ByteBuffer key() {
return this.key;
}
public ByteBuffer message() {
return this.message;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder digestAlgorithm(DigestAlgorithm digestAlgorithm);
DigestAlgorithm digestAlgorithm();
Builder key(ByteBuffer key);
ByteBuffer key();
Builder message(ByteBuffer message);
ByteBuffer message();
HMacInput build();
}
static class BuilderImpl implements Builder {
protected DigestAlgorithm digestAlgorithm;
protected ByteBuffer key;
protected ByteBuffer message;
protected BuilderImpl() {
}
protected BuilderImpl(HMacInput model) {
this.digestAlgorithm = model.digestAlgorithm();
this.key = model.key();
this.message = model.message();
}
public Builder digestAlgorithm(DigestAlgorithm digestAlgorithm) {
this.digestAlgorithm = digestAlgorithm;
return this;
}
public DigestAlgorithm digestAlgorithm() {
return this.digestAlgorithm;
}
public Builder key(ByteBuffer key) {
this.key = key;
return this;
}
public ByteBuffer key() {
return this.key;
}
public Builder message(ByteBuffer message) {
this.message = message;
return this;
}
public ByteBuffer message() {
return this.message;
}
public HMacInput build() {
if (Objects.isNull(this.digestAlgorithm())) {
throw new IllegalArgumentException("Missing value for required field `digestAlgorithm`");
}
if (Objects.isNull(this.key())) {
throw new IllegalArgumentException("Missing value for required field `key`");
}
if (Objects.isNull(this.message())) {
throw new IllegalArgumentException("Missing value for required field `message`");
}
return new HMacInput(this);
}
}
}
| 3,017 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/AESDecryptOutput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class AESDecryptOutput {
private final ByteBuffer plaintext;
protected AESDecryptOutput(BuilderImpl builder) {
this.plaintext = builder.plaintext();
}
public ByteBuffer plaintext() {
return this.plaintext;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder plaintext(ByteBuffer plaintext);
ByteBuffer plaintext();
AESDecryptOutput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer plaintext;
protected BuilderImpl() {
}
protected BuilderImpl(AESDecryptOutput model) {
this.plaintext = model.plaintext();
}
public Builder plaintext(ByteBuffer plaintext) {
this.plaintext = plaintext;
return this;
}
public ByteBuffer plaintext() {
return this.plaintext;
}
public AESDecryptOutput build() {
if (Objects.isNull(this.plaintext())) {
throw new IllegalArgumentException("Missing value for required field `plaintext`");
}
return new AESDecryptOutput(this);
}
}
}
| 3,018 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/AES_CTR.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.primitives.model;
public class AES_CTR {
private final int keyLength;
private final int nonceLength;
protected AES_CTR(BuilderImpl builder) {
this.keyLength = builder.keyLength();
this.nonceLength = builder.nonceLength();
}
public int keyLength() {
return this.keyLength;
}
public int nonceLength() {
return this.nonceLength;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder keyLength(int keyLength);
int keyLength();
Builder nonceLength(int nonceLength);
int nonceLength();
AES_CTR build();
}
static class BuilderImpl implements Builder {
protected int keyLength;
private boolean _keyLengthSet = false;
protected int nonceLength;
private boolean _nonceLengthSet = false;
protected BuilderImpl() {
}
protected BuilderImpl(AES_CTR model) {
this.keyLength = model.keyLength();
this._keyLengthSet = true;
this.nonceLength = model.nonceLength();
this._nonceLengthSet = true;
}
public Builder keyLength(int keyLength) {
this.keyLength = keyLength;
this._keyLengthSet = true;
return this;
}
public int keyLength() {
return this.keyLength;
}
public Builder nonceLength(int nonceLength) {
this.nonceLength = nonceLength;
this._nonceLengthSet = true;
return this;
}
public int nonceLength() {
return this.nonceLength;
}
public AES_CTR build() {
if (!this._keyLengthSet) {
throw new IllegalArgumentException("Missing value for required field `keyLength`");
}
if (this._keyLengthSet && this.keyLength() < 1) {
throw new IllegalArgumentException("`keyLength` must be greater than or equal to 1");
}
if (this._keyLengthSet && this.keyLength() > 32) {
throw new IllegalArgumentException("`keyLength` must be less than or equal to 32.");
}
if (!this._nonceLengthSet) {
throw new IllegalArgumentException("Missing value for required field `nonceLength`");
}
if (this._nonceLengthSet && this.nonceLength() < 0) {
throw new IllegalArgumentException("`nonceLength` must be greater than or equal to 0");
}
if (this._nonceLengthSet && this.nonceLength() > 255) {
throw new IllegalArgumentException("`nonceLength` must be less than or equal to 255.");
}
return new AES_CTR(this);
}
}
}
| 3,019 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/RSADecryptOutput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class RSADecryptOutput {
private final ByteBuffer plaintext;
protected RSADecryptOutput(BuilderImpl builder) {
this.plaintext = builder.plaintext();
}
public ByteBuffer plaintext() {
return this.plaintext;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder plaintext(ByteBuffer plaintext);
ByteBuffer plaintext();
RSADecryptOutput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer plaintext;
protected BuilderImpl() {
}
protected BuilderImpl(RSADecryptOutput model) {
this.plaintext = model.plaintext();
}
public Builder plaintext(ByteBuffer plaintext) {
this.plaintext = plaintext;
return this;
}
public ByteBuffer plaintext() {
return this.plaintext;
}
public RSADecryptOutput build() {
if (Objects.isNull(this.plaintext())) {
throw new IllegalArgumentException("Missing value for required field `plaintext`");
}
return new RSADecryptOutput(this);
}
}
}
| 3,020 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/ECDSAVerifyOutput.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.primitives.model;
import java.util.Objects;
public class ECDSAVerifyOutput {
private final Boolean success;
protected ECDSAVerifyOutput(BuilderImpl builder) {
this.success = builder.success();
}
public Boolean success() {
return this.success;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder success(Boolean success);
Boolean success();
ECDSAVerifyOutput build();
}
static class BuilderImpl implements Builder {
protected Boolean success;
protected BuilderImpl() {
}
protected BuilderImpl(ECDSAVerifyOutput model) {
this.success = model.success();
}
public Builder success(Boolean success) {
this.success = success;
return this;
}
public Boolean success() {
return this.success;
}
public ECDSAVerifyOutput build() {
if (Objects.isNull(this.success())) {
throw new IllegalArgumentException("Missing value for required field `success`");
}
return new ECDSAVerifyOutput(this);
}
}
}
| 3,021 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/AwsCryptographicPrimitivesError.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.primitives.model;
import java.util.Objects;
public class AwsCryptographicPrimitivesError extends RuntimeException {
protected AwsCryptographicPrimitivesError(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();
AwsCryptographicPrimitivesError build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected BuilderImpl() {
}
protected BuilderImpl(AwsCryptographicPrimitivesError 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 AwsCryptographicPrimitivesError build() {
if (Objects.isNull(this.message())) {
throw new IllegalArgumentException("Missing value for required field `message`");
}
return new AwsCryptographicPrimitivesError(this);
}
}
}
| 3,022 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/AESEncryptInput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class AESEncryptInput {
private final AES_GCM encAlg;
private final ByteBuffer iv;
private final ByteBuffer key;
private final ByteBuffer msg;
private final ByteBuffer aad;
protected AESEncryptInput(BuilderImpl builder) {
this.encAlg = builder.encAlg();
this.iv = builder.iv();
this.key = builder.key();
this.msg = builder.msg();
this.aad = builder.aad();
}
public AES_GCM encAlg() {
return this.encAlg;
}
public ByteBuffer iv() {
return this.iv;
}
public ByteBuffer key() {
return this.key;
}
public ByteBuffer msg() {
return this.msg;
}
public ByteBuffer aad() {
return this.aad;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder encAlg(AES_GCM encAlg);
AES_GCM encAlg();
Builder iv(ByteBuffer iv);
ByteBuffer iv();
Builder key(ByteBuffer key);
ByteBuffer key();
Builder msg(ByteBuffer msg);
ByteBuffer msg();
Builder aad(ByteBuffer aad);
ByteBuffer aad();
AESEncryptInput build();
}
static class BuilderImpl implements Builder {
protected AES_GCM encAlg;
protected ByteBuffer iv;
protected ByteBuffer key;
protected ByteBuffer msg;
protected ByteBuffer aad;
protected BuilderImpl() {
}
protected BuilderImpl(AESEncryptInput model) {
this.encAlg = model.encAlg();
this.iv = model.iv();
this.key = model.key();
this.msg = model.msg();
this.aad = model.aad();
}
public Builder encAlg(AES_GCM encAlg) {
this.encAlg = encAlg;
return this;
}
public AES_GCM encAlg() {
return this.encAlg;
}
public Builder iv(ByteBuffer iv) {
this.iv = iv;
return this;
}
public ByteBuffer iv() {
return this.iv;
}
public Builder key(ByteBuffer key) {
this.key = key;
return this;
}
public ByteBuffer key() {
return this.key;
}
public Builder msg(ByteBuffer msg) {
this.msg = msg;
return this;
}
public ByteBuffer msg() {
return this.msg;
}
public Builder aad(ByteBuffer aad) {
this.aad = aad;
return this;
}
public ByteBuffer aad() {
return this.aad;
}
public AESEncryptInput build() {
if (Objects.isNull(this.encAlg())) {
throw new IllegalArgumentException("Missing value for required field `encAlg`");
}
if (Objects.isNull(this.iv())) {
throw new IllegalArgumentException("Missing value for required field `iv`");
}
if (Objects.isNull(this.key())) {
throw new IllegalArgumentException("Missing value for required field `key`");
}
if (Objects.isNull(this.msg())) {
throw new IllegalArgumentException("Missing value for required field `msg`");
}
if (Objects.isNull(this.aad())) {
throw new IllegalArgumentException("Missing value for required field `aad`");
}
return new AESEncryptInput(this);
}
}
}
| 3,023 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/GenerateRSAKeyPairInput.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.primitives.model;
public class GenerateRSAKeyPairInput {
private final int lengthBits;
protected GenerateRSAKeyPairInput(BuilderImpl builder) {
this.lengthBits = builder.lengthBits();
}
public int lengthBits() {
return this.lengthBits;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder lengthBits(int lengthBits);
int lengthBits();
GenerateRSAKeyPairInput build();
}
static class BuilderImpl implements Builder {
protected int lengthBits;
private boolean _lengthBitsSet = false;
protected BuilderImpl() {
}
protected BuilderImpl(GenerateRSAKeyPairInput model) {
this.lengthBits = model.lengthBits();
this._lengthBitsSet = true;
}
public Builder lengthBits(int lengthBits) {
this.lengthBits = lengthBits;
this._lengthBitsSet = true;
return this;
}
public int lengthBits() {
return this.lengthBits;
}
public GenerateRSAKeyPairInput build() {
if (!this._lengthBitsSet) {
throw new IllegalArgumentException("Missing value for required field `lengthBits`");
}
if (this._lengthBitsSet && this.lengthBits() < 81) {
throw new IllegalArgumentException("`lengthBits` must be greater than or equal to 81");
}
if (this._lengthBitsSet && this.lengthBits() > 4096) {
throw new IllegalArgumentException("`lengthBits` must be less than or equal to 4096.");
}
return new GenerateRSAKeyPairInput(this);
}
}
}
| 3,024 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/GenerateECDSASignatureKeyOutput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class GenerateECDSASignatureKeyOutput {
private final ECDSASignatureAlgorithm signatureAlgorithm;
private final ByteBuffer verificationKey;
private final ByteBuffer signingKey;
protected GenerateECDSASignatureKeyOutput(BuilderImpl builder) {
this.signatureAlgorithm = builder.signatureAlgorithm();
this.verificationKey = builder.verificationKey();
this.signingKey = builder.signingKey();
}
public ECDSASignatureAlgorithm signatureAlgorithm() {
return this.signatureAlgorithm;
}
public ByteBuffer verificationKey() {
return this.verificationKey;
}
public ByteBuffer signingKey() {
return this.signingKey;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder signatureAlgorithm(ECDSASignatureAlgorithm signatureAlgorithm);
ECDSASignatureAlgorithm signatureAlgorithm();
Builder verificationKey(ByteBuffer verificationKey);
ByteBuffer verificationKey();
Builder signingKey(ByteBuffer signingKey);
ByteBuffer signingKey();
GenerateECDSASignatureKeyOutput build();
}
static class BuilderImpl implements Builder {
protected ECDSASignatureAlgorithm signatureAlgorithm;
protected ByteBuffer verificationKey;
protected ByteBuffer signingKey;
protected BuilderImpl() {
}
protected BuilderImpl(GenerateECDSASignatureKeyOutput model) {
this.signatureAlgorithm = model.signatureAlgorithm();
this.verificationKey = model.verificationKey();
this.signingKey = model.signingKey();
}
public Builder signatureAlgorithm(ECDSASignatureAlgorithm signatureAlgorithm) {
this.signatureAlgorithm = signatureAlgorithm;
return this;
}
public ECDSASignatureAlgorithm signatureAlgorithm() {
return this.signatureAlgorithm;
}
public Builder verificationKey(ByteBuffer verificationKey) {
this.verificationKey = verificationKey;
return this;
}
public ByteBuffer verificationKey() {
return this.verificationKey;
}
public Builder signingKey(ByteBuffer signingKey) {
this.signingKey = signingKey;
return this;
}
public ByteBuffer signingKey() {
return this.signingKey;
}
public GenerateECDSASignatureKeyOutput build() {
if (Objects.isNull(this.signatureAlgorithm())) {
throw new IllegalArgumentException("Missing value for required field `signatureAlgorithm`");
}
if (Objects.isNull(this.verificationKey())) {
throw new IllegalArgumentException("Missing value for required field `verificationKey`");
}
if (Objects.isNull(this.signingKey())) {
throw new IllegalArgumentException("Missing value for required field `signingKey`");
}
return new GenerateECDSASignatureKeyOutput(this);
}
}
}
| 3,025 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/HkdfExtractOutput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class HkdfExtractOutput {
private final ByteBuffer prk;
protected HkdfExtractOutput(BuilderImpl builder) {
this.prk = builder.prk();
}
public ByteBuffer prk() {
return this.prk;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder prk(ByteBuffer prk);
ByteBuffer prk();
HkdfExtractOutput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer prk;
protected BuilderImpl() {
}
protected BuilderImpl(HkdfExtractOutput model) {
this.prk = model.prk();
}
public Builder prk(ByteBuffer prk) {
this.prk = prk;
return this;
}
public ByteBuffer prk() {
return this.prk;
}
public HkdfExtractOutput build() {
if (Objects.isNull(this.prk())) {
throw new IllegalArgumentException("Missing value for required field `prk`");
}
return new HkdfExtractOutput(this);
}
}
}
| 3,026 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/GenerateECDSASignatureKeyInput.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.primitives.model;
import java.util.Objects;
public class GenerateECDSASignatureKeyInput {
private final ECDSASignatureAlgorithm signatureAlgorithm;
protected GenerateECDSASignatureKeyInput(BuilderImpl builder) {
this.signatureAlgorithm = builder.signatureAlgorithm();
}
public ECDSASignatureAlgorithm signatureAlgorithm() {
return this.signatureAlgorithm;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder signatureAlgorithm(ECDSASignatureAlgorithm signatureAlgorithm);
ECDSASignatureAlgorithm signatureAlgorithm();
GenerateECDSASignatureKeyInput build();
}
static class BuilderImpl implements Builder {
protected ECDSASignatureAlgorithm signatureAlgorithm;
protected BuilderImpl() {
}
protected BuilderImpl(GenerateECDSASignatureKeyInput model) {
this.signatureAlgorithm = model.signatureAlgorithm();
}
public Builder signatureAlgorithm(ECDSASignatureAlgorithm signatureAlgorithm) {
this.signatureAlgorithm = signatureAlgorithm;
return this;
}
public ECDSASignatureAlgorithm signatureAlgorithm() {
return this.signatureAlgorithm;
}
public GenerateECDSASignatureKeyInput build() {
if (Objects.isNull(this.signatureAlgorithm())) {
throw new IllegalArgumentException("Missing value for required field `signatureAlgorithm`");
}
return new GenerateECDSASignatureKeyInput(this);
}
}
}
| 3,027 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/AESDecryptInput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class AESDecryptInput {
private final AES_GCM encAlg;
private final ByteBuffer key;
private final ByteBuffer cipherTxt;
private final ByteBuffer authTag;
private final ByteBuffer iv;
private final ByteBuffer aad;
protected AESDecryptInput(BuilderImpl builder) {
this.encAlg = builder.encAlg();
this.key = builder.key();
this.cipherTxt = builder.cipherTxt();
this.authTag = builder.authTag();
this.iv = builder.iv();
this.aad = builder.aad();
}
public AES_GCM encAlg() {
return this.encAlg;
}
public ByteBuffer key() {
return this.key;
}
public ByteBuffer cipherTxt() {
return this.cipherTxt;
}
public ByteBuffer authTag() {
return this.authTag;
}
public ByteBuffer iv() {
return this.iv;
}
public ByteBuffer aad() {
return this.aad;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder encAlg(AES_GCM encAlg);
AES_GCM encAlg();
Builder key(ByteBuffer key);
ByteBuffer key();
Builder cipherTxt(ByteBuffer cipherTxt);
ByteBuffer cipherTxt();
Builder authTag(ByteBuffer authTag);
ByteBuffer authTag();
Builder iv(ByteBuffer iv);
ByteBuffer iv();
Builder aad(ByteBuffer aad);
ByteBuffer aad();
AESDecryptInput build();
}
static class BuilderImpl implements Builder {
protected AES_GCM encAlg;
protected ByteBuffer key;
protected ByteBuffer cipherTxt;
protected ByteBuffer authTag;
protected ByteBuffer iv;
protected ByteBuffer aad;
protected BuilderImpl() {
}
protected BuilderImpl(AESDecryptInput model) {
this.encAlg = model.encAlg();
this.key = model.key();
this.cipherTxt = model.cipherTxt();
this.authTag = model.authTag();
this.iv = model.iv();
this.aad = model.aad();
}
public Builder encAlg(AES_GCM encAlg) {
this.encAlg = encAlg;
return this;
}
public AES_GCM encAlg() {
return this.encAlg;
}
public Builder key(ByteBuffer key) {
this.key = key;
return this;
}
public ByteBuffer key() {
return this.key;
}
public Builder cipherTxt(ByteBuffer cipherTxt) {
this.cipherTxt = cipherTxt;
return this;
}
public ByteBuffer cipherTxt() {
return this.cipherTxt;
}
public Builder authTag(ByteBuffer authTag) {
this.authTag = authTag;
return this;
}
public ByteBuffer authTag() {
return this.authTag;
}
public Builder iv(ByteBuffer iv) {
this.iv = iv;
return this;
}
public ByteBuffer iv() {
return this.iv;
}
public Builder aad(ByteBuffer aad) {
this.aad = aad;
return this;
}
public ByteBuffer aad() {
return this.aad;
}
public AESDecryptInput build() {
if (Objects.isNull(this.encAlg())) {
throw new IllegalArgumentException("Missing value for required field `encAlg`");
}
if (Objects.isNull(this.key())) {
throw new IllegalArgumentException("Missing value for required field `key`");
}
if (Objects.isNull(this.cipherTxt())) {
throw new IllegalArgumentException("Missing value for required field `cipherTxt`");
}
if (Objects.isNull(this.authTag())) {
throw new IllegalArgumentException("Missing value for required field `authTag`");
}
if (Objects.isNull(this.iv())) {
throw new IllegalArgumentException("Missing value for required field `iv`");
}
if (Objects.isNull(this.aad())) {
throw new IllegalArgumentException("Missing value for required field `aad`");
}
return new AESDecryptInput(this);
}
}
}
| 3,028 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/DigestOutput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class DigestOutput {
private final ByteBuffer digest;
protected DigestOutput(BuilderImpl builder) {
this.digest = builder.digest();
}
public ByteBuffer digest() {
return this.digest;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder digest(ByteBuffer digest);
ByteBuffer digest();
DigestOutput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer digest;
protected BuilderImpl() {
}
protected BuilderImpl(DigestOutput model) {
this.digest = model.digest();
}
public Builder digest(ByteBuffer digest) {
this.digest = digest;
return this;
}
public ByteBuffer digest() {
return this.digest;
}
public DigestOutput build() {
if (Objects.isNull(this.digest())) {
throw new IllegalArgumentException("Missing value for required field `digest`");
}
return new DigestOutput(this);
}
}
}
| 3,029 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/ECDSASignInput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class ECDSASignInput {
private final ECDSASignatureAlgorithm signatureAlgorithm;
private final ByteBuffer signingKey;
private final ByteBuffer message;
protected ECDSASignInput(BuilderImpl builder) {
this.signatureAlgorithm = builder.signatureAlgorithm();
this.signingKey = builder.signingKey();
this.message = builder.message();
}
public ECDSASignatureAlgorithm signatureAlgorithm() {
return this.signatureAlgorithm;
}
public ByteBuffer signingKey() {
return this.signingKey;
}
public ByteBuffer message() {
return this.message;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder signatureAlgorithm(ECDSASignatureAlgorithm signatureAlgorithm);
ECDSASignatureAlgorithm signatureAlgorithm();
Builder signingKey(ByteBuffer signingKey);
ByteBuffer signingKey();
Builder message(ByteBuffer message);
ByteBuffer message();
ECDSASignInput build();
}
static class BuilderImpl implements Builder {
protected ECDSASignatureAlgorithm signatureAlgorithm;
protected ByteBuffer signingKey;
protected ByteBuffer message;
protected BuilderImpl() {
}
protected BuilderImpl(ECDSASignInput model) {
this.signatureAlgorithm = model.signatureAlgorithm();
this.signingKey = model.signingKey();
this.message = model.message();
}
public Builder signatureAlgorithm(ECDSASignatureAlgorithm signatureAlgorithm) {
this.signatureAlgorithm = signatureAlgorithm;
return this;
}
public ECDSASignatureAlgorithm signatureAlgorithm() {
return this.signatureAlgorithm;
}
public Builder signingKey(ByteBuffer signingKey) {
this.signingKey = signingKey;
return this;
}
public ByteBuffer signingKey() {
return this.signingKey;
}
public Builder message(ByteBuffer message) {
this.message = message;
return this;
}
public ByteBuffer message() {
return this.message;
}
public ECDSASignInput build() {
if (Objects.isNull(this.signatureAlgorithm())) {
throw new IllegalArgumentException("Missing value for required field `signatureAlgorithm`");
}
if (Objects.isNull(this.signingKey())) {
throw new IllegalArgumentException("Missing value for required field `signingKey`");
}
if (Objects.isNull(this.message())) {
throw new IllegalArgumentException("Missing value for required field `message`");
}
return new ECDSASignInput(this);
}
}
}
| 3,030 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/GetRSAKeyModulusLengthOutput.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.primitives.model;
public class GetRSAKeyModulusLengthOutput {
private final int length;
protected GetRSAKeyModulusLengthOutput(BuilderImpl builder) {
this.length = builder.length();
}
public int length() {
return this.length;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder length(int length);
int length();
GetRSAKeyModulusLengthOutput build();
}
static class BuilderImpl implements Builder {
protected int length;
private boolean _lengthSet = false;
protected BuilderImpl() {
}
protected BuilderImpl(GetRSAKeyModulusLengthOutput model) {
this.length = model.length();
this._lengthSet = true;
}
public Builder length(int length) {
this.length = length;
this._lengthSet = true;
return this;
}
public int length() {
return this.length;
}
public GetRSAKeyModulusLengthOutput build() {
if (!this._lengthSet) {
throw new IllegalArgumentException("Missing value for required field `length`");
}
if (this._lengthSet && this.length() < 81) {
throw new IllegalArgumentException("`length` must be greater than or equal to 81");
}
return new GetRSAKeyModulusLengthOutput(this);
}
}
}
| 3,031 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/HkdfExpandOutput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class HkdfExpandOutput {
private final ByteBuffer okm;
protected HkdfExpandOutput(BuilderImpl builder) {
this.okm = builder.okm();
}
public ByteBuffer okm() {
return this.okm;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder okm(ByteBuffer okm);
ByteBuffer okm();
HkdfExpandOutput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer okm;
protected BuilderImpl() {
}
protected BuilderImpl(HkdfExpandOutput model) {
this.okm = model.okm();
}
public Builder okm(ByteBuffer okm) {
this.okm = okm;
return this;
}
public ByteBuffer okm() {
return this.okm;
}
public HkdfExpandOutput build() {
if (Objects.isNull(this.okm())) {
throw new IllegalArgumentException("Missing value for required field `okm`");
}
return new HkdfExpandOutput(this);
}
}
}
| 3,032 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/GenerateRandomBytesOutput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class GenerateRandomBytesOutput {
private final ByteBuffer data;
protected GenerateRandomBytesOutput(BuilderImpl builder) {
this.data = builder.data();
}
public ByteBuffer data() {
return this.data;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder data(ByteBuffer data);
ByteBuffer data();
GenerateRandomBytesOutput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer data;
protected BuilderImpl() {
}
protected BuilderImpl(GenerateRandomBytesOutput model) {
this.data = model.data();
}
public Builder data(ByteBuffer data) {
this.data = data;
return this;
}
public ByteBuffer data() {
return this.data;
}
public GenerateRandomBytesOutput build() {
if (Objects.isNull(this.data())) {
throw new IllegalArgumentException("Missing value for required field `data`");
}
return new GenerateRandomBytesOutput(this);
}
}
}
| 3,033 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/model/AesKdfCtrOutput.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.primitives.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class AesKdfCtrOutput {
private final ByteBuffer okm;
protected AesKdfCtrOutput(BuilderImpl builder) {
this.okm = builder.okm();
}
public ByteBuffer okm() {
return this.okm;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder okm(ByteBuffer okm);
ByteBuffer okm();
AesKdfCtrOutput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer okm;
protected BuilderImpl() {
}
protected BuilderImpl(AesKdfCtrOutput model) {
this.okm = model.okm();
}
public Builder okm(ByteBuffer okm) {
this.okm = okm;
return this;
}
public ByteBuffer okm() {
return this.okm;
}
public AesKdfCtrOutput build() {
if (Objects.isNull(this.okm())) {
throw new IllegalArgumentException("Missing value for required field `okm`");
}
return new AesKdfCtrOutput(this);
}
}
}
| 3,034 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographyPrimitives/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/primitives/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.primitives.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);
}
}
}
| 3,035 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/StandardLibrary/runtimes/java/src/main/java
|
Create_ds/aws-cryptographic-material-providers-library-java/StandardLibrary/runtimes/java/src/main/java/UTF8/__default.java
|
package UTF8;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.StandardCharsets;
import Wrappers_Compile.Result;
import dafny.DafnySequence;
import static software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence;
import static software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence;
import static software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer;
import static software.amazon.smithy.dafny.conversion.ToNative.Simple.String;
// The only way to keep this thread/concurrent safe/ is
// to create a new Coder everytime.
// If we wanted to increase performance,
// we could declare this NOT thread/concurrent safe,
// and reset the coder everytime.
public class __default extends UTF8._ExternBase___default {
// This is largely copied from Polymorph's dafny-java-conversion:
// software.amazon.smithy.dafny.conversion.ToDafny.Simple.DafnyUtf8Bytes
public static Result<
DafnySequence<? extends Byte>,
DafnySequence<? extends Character>> Encode(
final DafnySequence<? extends Character> s) {
Charset utf8 = StandardCharsets.UTF_8;
// See thread/concurrent safe comment above class
CharsetEncoder coder = utf8.newEncoder();
CharBuffer inBuffer = CharBuffer.wrap(String(s));
inBuffer.position(0);
try {
ByteBuffer outBuffer = coder.encode(inBuffer);
// outBuffer's capacity can be much higher than the limit.
// By taking just the limit, we ensure we do not include
// any allocated but un-filled space.
return Result.create_Success(
(DafnySequence<? extends Byte>) ByteSequence(outBuffer, 0, outBuffer.limit()));
} catch (CharacterCodingException ex) {
return Result.create_Failure(
(DafnySequence<? extends Character>) CharacterSequence("Could not encode input to Dafny Bytes."));
}
}
// This is largely copied from Polymorph's dafny-java-conversion:
// software.amazon.smithy.dafny.conversion.ToNative.Simple.DafnyUtf8Bytes
public static Result<
DafnySequence<? extends Character>,
DafnySequence<? extends Character>> Decode(
final DafnySequence<? extends Byte> s) {
Charset utf8 = StandardCharsets.UTF_8;
// See thread/concurrent safe comment above class
CharsetDecoder coder = utf8.newDecoder();
ByteBuffer inBuffer = ByteBuffer(s);
inBuffer.position(0);
try {
CharBuffer outBuffer = coder.decode(inBuffer);
outBuffer.position(0);
return Result.create_Success(
(DafnySequence<? extends Character>) CharacterSequence(outBuffer.toString()));
} catch (CharacterCodingException ex) {
return Result.create_Failure(
(DafnySequence<? extends Character>) CharacterSequence("Could not encode input to Dafny Bytes."));
}
}
}
| 3,036 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/StandardLibrary/runtimes/java/src/main/java
|
Create_ds/aws-cryptographic-material-providers-library-java/StandardLibrary/runtimes/java/src/main/java/Time/__default.java
|
package Time;
import Wrappers_Compile.Result;
import dafny.DafnySequence;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
public class __default {
public static Long CurrentRelativeTime() {
return System.currentTimeMillis() / 1000;
}
public static Result<DafnySequence<? extends Character>, DafnySequence<? extends Character>> GetCurrentTimeStamp() {
try {
TimeZone tz = TimeZone.getTimeZone("UTC");
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss:SSSSSS'Z'"); // Quoted "Z" to indicate UTC, no timezone offset
df.setTimeZone(tz);
return Result.create_Success(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(df.format(new Date())));
} catch (Exception var1) {
return Result.create_Failure(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence("Could not generate a timestamp in ISO8601."));
}
}
}
| 3,037 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/StandardLibrary/runtimes/java/src/main/java
|
Create_ds/aws-cryptographic-material-providers-library-java/StandardLibrary/runtimes/java/src/main/java/ConcurrentCall/__default.java
|
package ConcurrentCall;
import Wrappers_Compile.Result;
import dafny.DafnySequence;
import ConcurrentCall.Callee;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
public class __default {
public __default() {
}
public static void ConcurrentCall(Callee callee, int serialIters, int concurrentIters)
{
ExecutorService pool = Executors.newFixedThreadPool(concurrentIters);
for(int i = 0; i < concurrentIters; i++) {
final int ii = i;
pool.execute(() -> {
for(int j = 0; j < serialIters; ++j) {
callee.call(j, ii);
}
}
);
}
pool.shutdown();
try {pool.awaitTermination(120, TimeUnit.SECONDS);} catch (Exception e) {}
}
private static final dafny.TypeDescriptor<__default> _TYPE = dafny.TypeDescriptor.<__default>referenceWithInitializer(__default.class, () -> (__default) null);
public static dafny.TypeDescriptor<__default> _typeDescriptor() {
return (dafny.TypeDescriptor<__default>) (dafny.TypeDescriptor<?>) _TYPE;
}
@Override
public java.lang.String toString() {
return "ConcurrentCall._default";
}
}
| 3,038 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/StandardLibrary/runtimes/java/src/main/java
|
Create_ds/aws-cryptographic-material-providers-library-java/StandardLibrary/runtimes/java/src/main/java/SortedSets/__default.java
|
package SortedSets;
import dafny.DafnySequence;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.ArrayList;
public class __default {
public static <T> dafny.DafnySequence<? extends dafny.DafnySequence<? extends T>>
SetToOrderedSequence(
dafny.TypeDescriptor<T> td_T,
dafny.DafnySet<? extends dafny.DafnySequence<? extends T>> inputSet,
dafny.Function2<T, T, Boolean> less)
{
dafny.DafnySequence<? extends T>[] outputArray = new DafnySequence[inputSet.size()];
outputArray = inputSet.Elements().toArray(outputArray);
LexicographicComparer<T> cmp = new LexicographicComparer<T>(less);
Arrays.sort(outputArray, cmp);
return DafnySequence.fromRawArray(DafnySequence._typeDescriptor(td_T), outputArray);
}
public static <T> dafny.DafnySequence<? extends dafny.DafnySequence<? extends T>>
SetToOrderedSequence2(
dafny.TypeDescriptor<T> _td_T,
dafny.DafnySet<? extends dafny.DafnySequence<? extends T>> s,
dafny.Function2<T, T, Boolean> less)
{
return SetToOrderedSequence(_td_T, s, less);
}
public static <T> dafny.DafnySequence<? extends T>
SetToSequence(
dafny.TypeDescriptor<T> td_T,
dafny.DafnySet<? extends T> inputSet)
{
return DafnySequence.fromList(td_T, new ArrayList<T>(inputSet.Elements()));
}
}
class LexicographicComparer <T> implements Comparator<dafny.DafnySequence<? extends T>> {
private dafny.Function2<T, T, Boolean> less;
public LexicographicComparer(dafny.Function2<T, T, Boolean> less) {
this.less = less;
}
public int compare(dafny.DafnySequence<? extends T> x, dafny.DafnySequence<? extends T> y) {
for (int i = 0; i < x.length() && i < y.length(); i++) {
if (less.apply(x.select(i), y.select(i))) {
return -1;
}
if (this.less.apply(y.select(i), x.select(i))) {
return 1;
}
}
// Reached the end of one array. Either they are equal, or the
// one which is shorter should be considered "less than"
return Integer.compare(x.length(), y.length());
}
}
| 3,039 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/StandardLibrary/runtimes/java/src/main/java
|
Create_ds/aws-cryptographic-material-providers-library-java/StandardLibrary/runtimes/java/src/main/java/DafnyLibraries/FileIO.java
|
/*******************************************************************************
* Copyright by the contributors to the Dafny Project
* SPDX-License-Identifier: MIT
*******************************************************************************/
package DafnyLibraries;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import dafny.DafnySequence;
import dafny.Tuple2;
import dafny.Tuple3;
import dafny.TypeDescriptor;
public class FileIO {
/**
* Attempts to read all bytes from the file at {@code path}, and returns a tuple of the following values:
* <dl>
* <dt>{@code isError}</dt>
* <dd>true iff an exception was thrown during path string conversion or when reading the file</dd>
* <dt>{@code bytesRead}</dt>
* <dd>the sequence of bytes read from the file, or an empty sequence if {@code isError} is true</dd>
* <dt>{@code errorMsg}</dt>
* <dd>the error message of the thrown exception if {@code isError} is true, or an empty sequence otherwise</dd>
* </dl>
* <p>
* We return these values individually because {@code Result} is not defined in the runtime but instead in library code.
* It is the responsibility of library code to construct an equivalent {@code Result} value.
*/
public static Tuple3<Boolean, DafnySequence<? extends Byte>, DafnySequence<? extends Character>>
INTERNAL_ReadBytesFromFile(DafnySequence<? extends Character> path) {
try {
final Path pathObj = dafnyStringToPath(path);
final DafnySequence<Byte> readBytes = DafnySequence.fromBytes(Files.readAllBytes(pathObj));
return Tuple3.create(false, readBytes, DafnySequence.empty(TypeDescriptor.CHAR));
} catch (Exception ex) {
return Tuple3.create(true, DafnySequence.empty(TypeDescriptor.BYTE), stackTraceToDafnyString(ex));
}
}
/**
* Attempts to write {@code bytes} to the file at {@code path}, creating nonexistent parent directories as necessary,
* and returns a tuple of the following values:
* <dl>
* <dt>{@code isError}</dt>
* <dd>true iff an exception was thrown during path string conversion or when writing to the file</dd>
* <dt>{@code errorMsg}</dt>
* <dd>the error message of the thrown exception if {@code isError} is true, or an empty sequence otherwise</dd>
* </dl>
* <p>
* We return these values individually because {@code Result} is not defined in the runtime but instead in library code.
* It is the responsibility of library code to construct an equivalent {@code Result} value.
*/
public static Tuple2<Boolean, DafnySequence<? extends Character>>
INTERNAL_WriteBytesToFile(DafnySequence<? extends Character> path, DafnySequence<? extends Byte> bytes) {
try {
final Path pathObj = dafnyStringToPath(path);
createParentDirs(pathObj);
// It's safe to cast `bytes` to `DafnySequence<Byte>` since the cast value is immediately consumed
@SuppressWarnings("unchecked")
final byte[] byteArr = DafnySequence.toByteArray((DafnySequence<Byte>) bytes);
Files.write(pathObj, byteArr);
return Tuple2.create(false, DafnySequence.empty(TypeDescriptor.CHAR));
} catch (Exception ex) {
return Tuple2.create(true, stackTraceToDafnyString(ex));
}
}
/**
* Returns a Path constructed from the given Dafny string.
*/
private static final Path dafnyStringToPath(final DafnySequence<? extends Character> path) {
return Paths.get(new String((char[]) path.toArray().unwrap()));
}
/**
* Creates the nonexistent parent directory(-ies) of the given path.
*/
private static final void createParentDirs(final Path path) throws IOException {
final Path parentDir = path.toAbsolutePath().getParent();
if (parentDir == null) {
return;
}
Files.createDirectories(parentDir);
}
private static final DafnySequence<Character> stackTraceToDafnyString(final Throwable t) {
final StringWriter stringWriter = new StringWriter();
final PrintWriter printWriter = new PrintWriter(stringWriter);
t.printStackTrace(printWriter);
final String str = stringWriter.toString();
return DafnySequence.of(str.toCharArray());
}
}
| 3,040 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/StandardLibrary/runtimes/java/src/main/java
|
Create_ds/aws-cryptographic-material-providers-library-java/StandardLibrary/runtimes/java/src/main/java/DafnyLibraries/MutableMap.java
|
package DafnyLibraries;
import dafny.DafnySet;
import dafny.DafnyMap;
import dafny.Tuple2;
import java.util.concurrent.*;
import java.util.ArrayList;
import java.util.Map;
import java.math.BigInteger;
public class MutableMap<K,V> extends DafnyLibraries._ExternBase_MutableMap<K,V> {
private ConcurrentHashMap<K,V> m;
public MutableMap(dafny.TypeDescriptor<K> _td_K, dafny.TypeDescriptor<V> _td_V) {
super(_td_K, _td_V);
m = new ConcurrentHashMap<K,V>();
}
@Override
public DafnyMap<K,V> content() {
return new DafnyMap<K,V>(m);
}
@Override
public void Put(K k, V v) {
m.put(k, v);
}
@Override
public DafnySet<? extends K> Keys() {
return new DafnySet(m.keySet());
}
@Override
public boolean HasKey(K k) {
return m.containsKey(k);
}
@Override
public DafnySet<? extends V> Values() {
return new DafnySet(m.values());
}
@Override
public DafnySet<? extends Tuple2<K,V>> Items() {
ArrayList<Tuple2<K, V>> list = new ArrayList<Tuple2<K, V>>();
for (Map.Entry<K, V> entry : m.entrySet()) {
list.add(new Tuple2<K, V>(entry.getKey(), entry.getValue()));
}
return new DafnySet<Tuple2<K, V>>(list);
}
@Override
public V Select(K k) {
return m.get(k);
}
@Override
public void Remove(K k) {
m.remove(k);
}
@Override
public BigInteger Size() {
return BigInteger.valueOf(m.size());
}
}
| 3,041 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/StandardLibrary/runtimes/java/src/main/java
|
Create_ds/aws-cryptographic-material-providers-library-java/StandardLibrary/runtimes/java/src/main/java/UUID/__default.java
|
package UUID;
import Wrappers_Compile.Result;
import dafny.Array;
import dafny.DafnySequence;
import java.nio.ByteBuffer;
import java.util.UUID;
import static software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence;
import static software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence;
import static software.amazon.smithy.dafny.conversion.ToNative.Simple.String;
public class __default {
public static Result<
DafnySequence<? extends Byte>,
DafnySequence<? extends Character>> ToByteArray(
final DafnySequence<? extends Character> s)
{
try {
UUID fromString = UUID.fromString(String(s));
ByteBuffer byteBuffer = ByteBuffer.wrap(new byte[16]);
// In Java the UUID construction stores the 8 most significant bytes
// and the 8 least significant bytes that add up to 16 byte UUID.
byteBuffer.putLong(fromString.getMostSignificantBits());
byteBuffer.putLong(fromString.getLeastSignificantBits());
return Result.create_Success(
(DafnySequence<? extends Byte>) ByteSequence(byteBuffer)
);
} catch (Exception e) {
return Result.create_Failure(
(DafnySequence<? extends Character>) CharacterSequence("Could not convert UUID to byte array.")
);
}
}
public static Result<
DafnySequence<? extends Character>,
DafnySequence<? extends Character>> FromByteArray(
final DafnySequence<? extends Byte> b)
{
try {
ByteBuffer byteBuffer = ByteBuffer.wrap((byte[]) Array.unwrap(b.toArray()));
// In order to create a UUID in Java we need to supply
// the most significant bytes and the least significant bytes
// the construction calls for longs since it represents 8 bytes
// 8 + 8 = 16 that make up the 16 bytes of the UUID construction.
long high = byteBuffer.getLong();
long low = byteBuffer.getLong();
UUID fromByte = new UUID(high, low);
return Result.create_Success(
(DafnySequence<? extends Character>) CharacterSequence(fromByte.toString())
);
} catch (Exception e) {
return Result.create_Failure(
(DafnySequence<? extends Character>) CharacterSequence("Could not convert byte array to UUID.")
);
}
}
public static Result<
DafnySequence<? extends Character>,
DafnySequence<? extends Character>> GenerateUUID()
{
try {
UUID uuid = UUID.randomUUID();
return Result.create_Success(
(DafnySequence<? extends Character>) CharacterSequence(uuid.toString())
);
} catch (Exception e) {
return Result.create_Failure(
(DafnySequence<? extends Character>) CharacterSequence("Could not generate a UUID.")
);
}
}
}
| 3,042 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/test/LocalCMCTests.java
|
import org.testng.annotations.Test;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.HashMap;
import Random_Compile.ExternRandom;
import software.amazon.cryptography.keystore.model.BeaconKeyMaterials;
import software.amazon.cryptography.materialproviders.ICryptographicMaterialsCache;
import software.amazon.cryptography.materialproviders.MaterialProviders;
import software.amazon.cryptography.materialproviders.model.CacheType;
import software.amazon.cryptography.materialproviders.model.CreateCryptographicMaterialsCacheInput;
import software.amazon.cryptography.materialproviders.model.DefaultCache;
import software.amazon.cryptography.materialproviders.model.EntryDoesNotExist;
import software.amazon.cryptography.materialproviders.model.GetCacheEntryInput;
import software.amazon.cryptography.materialproviders.model.GetCacheEntryOutput;
import software.amazon.cryptography.materialproviders.model.MaterialProvidersConfig;
import software.amazon.cryptography.materialproviders.model.Materials;
import software.amazon.cryptography.materialproviders.model.PutCacheEntryInput;
public class LocalCMCTests {
static private final ICryptographicMaterialsCache test = MaterialProviders
.builder()
.MaterialProvidersConfig(MaterialProvidersConfig.builder().build())
.build()
.CreateCryptographicMaterialsCache(CreateCryptographicMaterialsCacheInput
.builder()
.cache(CacheType.builder().Default(DefaultCache.builder().entryCapacity(10).build()).build())
.build()
);
static private final List<String> identifies = Collections.unmodifiableList(Arrays.asList(
"one",
"two",
"three",
"four",
"five",
"six",
"seven",
"eight",
"nine",
"ten",
"eleven",
"twelve",
"thirteen",
"fourteen",
"fifteen",
"sixteen",
"seventeen",
"eighteen",
"nineteen",
"twenty",
"twenty one"
));
private static final int IDS_SIZE = identifies.size();
@Test(threadPoolSize = 10, invocationCount = 300000, timeOut = 10000)
public void TestALotOfAdding() {
Random rand = ExternRandom.getSecureRandom();
String beaconKeyIdentifier = identifies.get(rand.nextInt(IDS_SIZE));
ByteBuffer cacheIdentifier = ByteBuffer.wrap(beaconKeyIdentifier.getBytes(StandardCharsets.UTF_8));
GetCacheEntryInput getCacheEntryInput = GetCacheEntryInput
.builder()
.identifier(cacheIdentifier)
.build();
try {
GetCacheEntryOutput getCacheEntryOutput = test.GetCacheEntry(getCacheEntryInput);
// assertEquals(getCacheEntryOutput.materials().BeaconKey().beaconKey(), binaryData);
// assertEquals(getCacheEntryOutput.materials().BeaconKey().beaconKeyIdentifier(), stringData);
// System.out.println("are equal");
} catch (EntryDoesNotExist ex) {
Materials materials = Materials
.builder()
.BeaconKey(BeaconKeyMaterials
.builder()
.beaconKeyIdentifier(beaconKeyIdentifier)
// The cacheIdentifier is used as the material
// because we are not testing the cryptography here.
.beaconKey(cacheIdentifier)
.encryptionContext(new HashMap<String, String>())
.build())
.build();
PutCacheEntryInput putCacheEntryInput = PutCacheEntryInput
.builder()
.identifier(cacheIdentifier)
.creationTime(Instant.now().getEpochSecond())
.expiryTime(Instant.now().getEpochSecond() + 1)
.materials(materials)
.build();
test.PutCacheEntry(putCacheEntryInput);
}
}
}
| 3,043 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/java/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/java/software/amazon/cryptography/keystore/__default.java
|
package software.amazon.cryptography.keystore.internaldafny;
public class __default extends software.amazon.cryptography.keystore.internaldafny._ExternBase___default {
}
| 3,044 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/java/software/amazon/cryptography/keystore
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/java/software/amazon/cryptography/keystore/types/__default.java
|
package software.amazon.cryptography.keystore.internaldafny.types;
public class __default extends software.amazon.cryptography.keystore.internaldafny._ExternBase___default {
}
| 3,045 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/java/software/amazon/cryptography/internaldafny
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/java/software/amazon/cryptography/internaldafny/SynchronizedLocalCMC/SynchronizedLocalCMC.java
|
package software.amazon.cryptography.internaldafny.SynchronizedLocalCMC;
import LocalCMC_Compile.LocalCMC;
@SuppressWarnings({"unchecked", "deprecation"})
public class SynchronizedLocalCMC implements software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsCache {
private LocalCMC wrapped;
public SynchronizedLocalCMC(LocalCMC wrapped)
{
(this).wrapped = wrapped;
}
public synchronized Wrappers_Compile.Result<dafny.Tuple0, software.amazon.cryptography.materialproviders.internaldafny.types.Error> PutCacheEntry(software.amazon.cryptography.materialproviders.internaldafny.types.PutCacheEntryInput input)
{
return wrapped.PutCacheEntry(input);
}
public synchronized Wrappers_Compile.Result<dafny.Tuple0, software.amazon.cryptography.materialproviders.internaldafny.types.Error> UpdateUsageMetadata(software.amazon.cryptography.materialproviders.internaldafny.types.UpdateUsageMetadataInput input)
{
return wrapped.UpdateUsageMetadata(input);
}
public synchronized Wrappers_Compile.Result<software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryOutput, software.amazon.cryptography.materialproviders.internaldafny.types.Error> GetCacheEntry(software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryInput input)
{
return wrapped.GetCacheEntry(input);
}
public synchronized Wrappers_Compile.Result<dafny.Tuple0, software.amazon.cryptography.materialproviders.internaldafny.types.Error> DeleteCacheEntry(software.amazon.cryptography.materialproviders.internaldafny.types.DeleteCacheEntryInput input)
{
return wrapped.DeleteCacheEntry(input);
}
public synchronized Wrappers_Compile.Result<dafny.Tuple0, software.amazon.cryptography.materialproviders.internaldafny.types.Error> PutCacheEntry_k(software.amazon.cryptography.materialproviders.internaldafny.types.PutCacheEntryInput input)
{
return wrapped.PutCacheEntry(input);
}
public synchronized Wrappers_Compile.Result<dafny.Tuple0, software.amazon.cryptography.materialproviders.internaldafny.types.Error> UpdateUsageMetadata_k(software.amazon.cryptography.materialproviders.internaldafny.types.UpdateUsageMetadataInput input)
{
return wrapped.UpdateUsageMetadata(input);
}
public synchronized Wrappers_Compile.Result<software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryOutput, software.amazon.cryptography.materialproviders.internaldafny.types.Error> GetCacheEntry_k(software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryInput input)
{
return wrapped.GetCacheEntry(input);
}
public synchronized Wrappers_Compile.Result<dafny.Tuple0, software.amazon.cryptography.materialproviders.internaldafny.types.Error> DeleteCacheEntry_k(software.amazon.cryptography.materialproviders.internaldafny.types.DeleteCacheEntryInput input)
{
return wrapped.DeleteCacheEntry(input);
}
@Override
public java.lang.String toString() {
return "LocalCMC_Compile.SynchronizedLocalCMC";
}
}
| 3,046 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/java/software/amazon/cryptography/internaldafny
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/java/software/amazon/cryptography/internaldafny/StormTrackingCMC/StormTrackingCMC.java
|
package software.amazon.cryptography.internaldafny.StormTrackingCMC;
import StormTracker_Compile.StormTracker;
import StormTracker_Compile.CacheState;
import software.amazon.cryptography.materialproviders.internaldafny.types.*;
import software.amazon.cryptography.materialproviders.internaldafny.*;
@SuppressWarnings({ "unchecked", "deprecation" })
public class StormTrackingCMC
implements software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsCache {
private StormTracker wrapped;
public StormTrackingCMC(StormTracker wrapped) {
(this).wrapped = wrapped;
}
public synchronized Wrappers_Compile.Result<dafny.Tuple0, software.amazon.cryptography.materialproviders.internaldafny.types.Error> PutCacheEntry(
software.amazon.cryptography.materialproviders.internaldafny.types.PutCacheEntryInput input) {
return wrapped.PutCacheEntry(input);
}
public synchronized Wrappers_Compile.Result<dafny.Tuple0, software.amazon.cryptography.materialproviders.internaldafny.types.Error> UpdateUsageMetadata(
software.amazon.cryptography.materialproviders.internaldafny.types.UpdateUsageMetadataInput input) {
return wrapped.UpdateUsageMetadata(input);
}
// NOT synchronized, as some sleeping might be involved
public Wrappers_Compile.Result<software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryOutput, software.amazon.cryptography.materialproviders.internaldafny.types.Error> GetCacheEntry(
software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryInput input) {
return GetCacheEntry_k(input);
}
public synchronized Wrappers_Compile.Result<dafny.Tuple0, software.amazon.cryptography.materialproviders.internaldafny.types.Error> DeleteCacheEntry(
software.amazon.cryptography.materialproviders.internaldafny.types.DeleteCacheEntryInput input) {
return wrapped.DeleteCacheEntry(input);
}
public synchronized Wrappers_Compile.Result<dafny.Tuple0, software.amazon.cryptography.materialproviders.internaldafny.types.Error> PutCacheEntry_k(
software.amazon.cryptography.materialproviders.internaldafny.types.PutCacheEntryInput input) {
return wrapped.PutCacheEntry(input);
}
public synchronized Wrappers_Compile.Result<dafny.Tuple0, software.amazon.cryptography.materialproviders.internaldafny.types.Error> UpdateUsageMetadata_k(
software.amazon.cryptography.materialproviders.internaldafny.types.UpdateUsageMetadataInput input) {
return wrapped.UpdateUsageMetadata(input);
}
// This is the synchronization for GetCacheEntry and GetCacheEntry_k
public synchronized Wrappers_Compile.Result<CacheState, software.amazon.cryptography.materialproviders.internaldafny.types.Error> GetFromCacheInner(
software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryInput input) {
return wrapped.GetFromCache(input);
}
// NOT synchronized, because we sleep. Calls GetFromCache which IS synchronized.
public Wrappers_Compile.Result<software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryOutput, software.amazon.cryptography.materialproviders.internaldafny.types.Error>
GetCacheEntry_k(software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryInput input)
{
while (true) {
Wrappers_Compile.Result<CacheState, software.amazon.cryptography.materialproviders.internaldafny.types.Error>
result = GetFromCacheInner(input);
if (result.is_Failure()) {
return Wrappers_Compile.Result.create_Failure((result).dtor_error());
} else if (result.dtor_value().is_Full()) {
return Wrappers_Compile.Result.create_Success(result.dtor_value().dtor_data());
} else if (result.dtor_value().is_EmptyFetch()) {
return Wrappers_Compile.Result
.create_Failure(software.amazon.cryptography.materialproviders.internaldafny.types.Error
.create_EntryDoesNotExist(dafny.DafnySequence.asString("Entry does not exist")));
} else {
try {Thread.sleep(wrapped.sleepMilli);} catch (Exception e) {}
}
}
}
public synchronized Wrappers_Compile.Result<dafny.Tuple0, software.amazon.cryptography.materialproviders.internaldafny.types.Error> DeleteCacheEntry_k(
software.amazon.cryptography.materialproviders.internaldafny.types.DeleteCacheEntryInput input) {
return wrapped.DeleteCacheEntry(input);
}
@Override
public java.lang.String toString() {
return "StormTracker_Compile.StormTrackerCMC";
}
}
| 3,047 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/java/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/java/software/amazon/cryptography/materialproviders/__default.java
|
package software.amazon.cryptography.materialproviders.internaldafny;
public class __default extends software.amazon.cryptography.materialproviders.internaldafny._ExternBase___default {
}
| 3,048 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/java/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/java/software/amazon/cryptography/materialproviders/types/__default.java
|
package software.amazon.cryptography.materialproviders.internaldafny.types;
public class __default extends software.amazon.cryptography.materialproviders.internaldafny._ExternBase___default {
}
| 3,049 |
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/keystore/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.keystore;
import dafny.DafnyMap;
import dafny.DafnySequence;
import java.lang.Byte;
import java.lang.Character;
import java.lang.RuntimeException;
import java.lang.String;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.Map;
import software.amazon.cryptography.keystore.internaldafny.types.Error;
import software.amazon.cryptography.keystore.internaldafny.types.Error_CollectionOfErrors;
import software.amazon.cryptography.keystore.internaldafny.types.Error_KeyStoreException;
import software.amazon.cryptography.keystore.internaldafny.types.Error_Opaque;
import software.amazon.cryptography.keystore.internaldafny.types.IKeyStoreClient;
import software.amazon.cryptography.keystore.model.BeaconKeyMaterials;
import software.amazon.cryptography.keystore.model.BranchKeyMaterials;
import software.amazon.cryptography.keystore.model.CollectionOfErrors;
import software.amazon.cryptography.keystore.model.CreateKeyInput;
import software.amazon.cryptography.keystore.model.CreateKeyOutput;
import software.amazon.cryptography.keystore.model.CreateKeyStoreInput;
import software.amazon.cryptography.keystore.model.CreateKeyStoreOutput;
import software.amazon.cryptography.keystore.model.GetActiveBranchKeyInput;
import software.amazon.cryptography.keystore.model.GetActiveBranchKeyOutput;
import software.amazon.cryptography.keystore.model.GetBeaconKeyInput;
import software.amazon.cryptography.keystore.model.GetBeaconKeyOutput;
import software.amazon.cryptography.keystore.model.GetBranchKeyVersionInput;
import software.amazon.cryptography.keystore.model.GetBranchKeyVersionOutput;
import software.amazon.cryptography.keystore.model.GetKeyStoreInfoOutput;
import software.amazon.cryptography.keystore.model.KMSConfiguration;
import software.amazon.cryptography.keystore.model.KeyStoreConfig;
import software.amazon.cryptography.keystore.model.KeyStoreException;
import software.amazon.cryptography.keystore.model.OpaqueError;
import software.amazon.cryptography.keystore.model.VersionKeyInput;
import software.amazon.cryptography.keystore.model.VersionKeyOutput;
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 KeyStoreException Error(Error_KeyStoreException dafnyValue) {
KeyStoreException.Builder nativeBuilder = KeyStoreException.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_KeyStoreException()) {
return ToNative.Error((Error_KeyStoreException) dafnyValue);
}
if (dafnyValue.is_Opaque()) {
return ToNative.Error((Error_Opaque) dafnyValue);
}
if (dafnyValue.is_CollectionOfErrors()) {
return ToNative.Error((Error_CollectionOfErrors) dafnyValue);
}
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());
}
OpaqueError.Builder nativeBuilder = OpaqueError.builder();
nativeBuilder.obj(dafnyValue);
return nativeBuilder.build();
}
public static BeaconKeyMaterials BeaconKeyMaterials(
software.amazon.cryptography.keystore.internaldafny.types.BeaconKeyMaterials dafnyValue) {
BeaconKeyMaterials.Builder nativeBuilder = BeaconKeyMaterials.builder();
nativeBuilder.beaconKeyIdentifier(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_beaconKeyIdentifier()));
nativeBuilder.encryptionContext(ToNative.EncryptionContext(dafnyValue.dtor_encryptionContext()));
if (dafnyValue.dtor_beaconKey().is_Some()) {
nativeBuilder.beaconKey(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_beaconKey().dtor_value()));
}
if (dafnyValue.dtor_hmacKeys().is_Some()) {
nativeBuilder.hmacKeys(ToNative.HmacKeyMap(dafnyValue.dtor_hmacKeys().dtor_value()));
}
return nativeBuilder.build();
}
public static BranchKeyMaterials BranchKeyMaterials(
software.amazon.cryptography.keystore.internaldafny.types.BranchKeyMaterials dafnyValue) {
BranchKeyMaterials.Builder nativeBuilder = BranchKeyMaterials.builder();
nativeBuilder.branchKeyIdentifier(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_branchKeyIdentifier()));
nativeBuilder.branchKeyVersion(software.amazon.smithy.dafny.conversion.ToNative.Simple.DafnyUtf8Bytes(dafnyValue.dtor_branchKeyVersion()));
nativeBuilder.encryptionContext(ToNative.EncryptionContext(dafnyValue.dtor_encryptionContext()));
nativeBuilder.branchKey(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_branchKey()));
return nativeBuilder.build();
}
public static CreateKeyInput CreateKeyInput(
software.amazon.cryptography.keystore.internaldafny.types.CreateKeyInput dafnyValue) {
CreateKeyInput.Builder nativeBuilder = CreateKeyInput.builder();
if (dafnyValue.dtor_branchKeyIdentifier().is_Some()) {
nativeBuilder.branchKeyIdentifier(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_branchKeyIdentifier().dtor_value()));
}
if (dafnyValue.dtor_encryptionContext().is_Some()) {
nativeBuilder.encryptionContext(ToNative.EncryptionContext(dafnyValue.dtor_encryptionContext().dtor_value()));
}
return nativeBuilder.build();
}
public static CreateKeyOutput CreateKeyOutput(
software.amazon.cryptography.keystore.internaldafny.types.CreateKeyOutput dafnyValue) {
CreateKeyOutput.Builder nativeBuilder = CreateKeyOutput.builder();
nativeBuilder.branchKeyIdentifier(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_branchKeyIdentifier()));
return nativeBuilder.build();
}
public static CreateKeyStoreInput CreateKeyStoreInput(
software.amazon.cryptography.keystore.internaldafny.types.CreateKeyStoreInput dafnyValue) {
CreateKeyStoreInput.Builder nativeBuilder = CreateKeyStoreInput.builder();
return nativeBuilder.build();
}
public static CreateKeyStoreOutput CreateKeyStoreOutput(
software.amazon.cryptography.keystore.internaldafny.types.CreateKeyStoreOutput dafnyValue) {
CreateKeyStoreOutput.Builder nativeBuilder = CreateKeyStoreOutput.builder();
nativeBuilder.tableArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_tableArn()));
return nativeBuilder.build();
}
public static GetActiveBranchKeyInput GetActiveBranchKeyInput(
software.amazon.cryptography.keystore.internaldafny.types.GetActiveBranchKeyInput dafnyValue) {
GetActiveBranchKeyInput.Builder nativeBuilder = GetActiveBranchKeyInput.builder();
nativeBuilder.branchKeyIdentifier(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_branchKeyIdentifier()));
return nativeBuilder.build();
}
public static GetActiveBranchKeyOutput GetActiveBranchKeyOutput(
software.amazon.cryptography.keystore.internaldafny.types.GetActiveBranchKeyOutput dafnyValue) {
GetActiveBranchKeyOutput.Builder nativeBuilder = GetActiveBranchKeyOutput.builder();
nativeBuilder.branchKeyMaterials(ToNative.BranchKeyMaterials(dafnyValue.dtor_branchKeyMaterials()));
return nativeBuilder.build();
}
public static GetBeaconKeyInput GetBeaconKeyInput(
software.amazon.cryptography.keystore.internaldafny.types.GetBeaconKeyInput dafnyValue) {
GetBeaconKeyInput.Builder nativeBuilder = GetBeaconKeyInput.builder();
nativeBuilder.branchKeyIdentifier(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_branchKeyIdentifier()));
return nativeBuilder.build();
}
public static GetBeaconKeyOutput GetBeaconKeyOutput(
software.amazon.cryptography.keystore.internaldafny.types.GetBeaconKeyOutput dafnyValue) {
GetBeaconKeyOutput.Builder nativeBuilder = GetBeaconKeyOutput.builder();
nativeBuilder.beaconKeyMaterials(ToNative.BeaconKeyMaterials(dafnyValue.dtor_beaconKeyMaterials()));
return nativeBuilder.build();
}
public static GetBranchKeyVersionInput GetBranchKeyVersionInput(
software.amazon.cryptography.keystore.internaldafny.types.GetBranchKeyVersionInput dafnyValue) {
GetBranchKeyVersionInput.Builder nativeBuilder = GetBranchKeyVersionInput.builder();
nativeBuilder.branchKeyIdentifier(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_branchKeyIdentifier()));
nativeBuilder.branchKeyVersion(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_branchKeyVersion()));
return nativeBuilder.build();
}
public static GetBranchKeyVersionOutput GetBranchKeyVersionOutput(
software.amazon.cryptography.keystore.internaldafny.types.GetBranchKeyVersionOutput dafnyValue) {
GetBranchKeyVersionOutput.Builder nativeBuilder = GetBranchKeyVersionOutput.builder();
nativeBuilder.branchKeyMaterials(ToNative.BranchKeyMaterials(dafnyValue.dtor_branchKeyMaterials()));
return nativeBuilder.build();
}
public static GetKeyStoreInfoOutput GetKeyStoreInfoOutput(
software.amazon.cryptography.keystore.internaldafny.types.GetKeyStoreInfoOutput dafnyValue) {
GetKeyStoreInfoOutput.Builder nativeBuilder = GetKeyStoreInfoOutput.builder();
nativeBuilder.keyStoreId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyStoreId()));
nativeBuilder.keyStoreName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyStoreName()));
nativeBuilder.logicalKeyStoreName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_logicalKeyStoreName()));
nativeBuilder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_grantTokens()));
nativeBuilder.kmsConfiguration(ToNative.KMSConfiguration(dafnyValue.dtor_kmsConfiguration()));
return nativeBuilder.build();
}
public static KeyStoreConfig KeyStoreConfig(
software.amazon.cryptography.keystore.internaldafny.types.KeyStoreConfig dafnyValue) {
KeyStoreConfig.Builder nativeBuilder = KeyStoreConfig.builder();
nativeBuilder.ddbTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ddbTableName()));
nativeBuilder.kmsConfiguration(ToNative.KMSConfiguration(dafnyValue.dtor_kmsConfiguration()));
nativeBuilder.logicalKeyStoreName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_logicalKeyStoreName()));
if (dafnyValue.dtor_id().is_Some()) {
nativeBuilder.id(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_id().dtor_value()));
}
if (dafnyValue.dtor_grantTokens().is_Some()) {
nativeBuilder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_grantTokens().dtor_value()));
}
if (dafnyValue.dtor_ddbClient().is_Some()) {
nativeBuilder.ddbClient(software.amazon.cryptography.services.dynamodb.internaldafny.ToNative.DynamoDB_20120810(dafnyValue.dtor_ddbClient().dtor_value()));
}
if (dafnyValue.dtor_kmsClient().is_Some()) {
nativeBuilder.kmsClient(software.amazon.cryptography.services.kms.internaldafny.ToNative.TrentService(dafnyValue.dtor_kmsClient().dtor_value()));
}
return nativeBuilder.build();
}
public static VersionKeyInput VersionKeyInput(
software.amazon.cryptography.keystore.internaldafny.types.VersionKeyInput dafnyValue) {
VersionKeyInput.Builder nativeBuilder = VersionKeyInput.builder();
nativeBuilder.branchKeyIdentifier(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_branchKeyIdentifier()));
return nativeBuilder.build();
}
public static VersionKeyOutput VersionKeyOutput(
software.amazon.cryptography.keystore.internaldafny.types.VersionKeyOutput dafnyValue) {
VersionKeyOutput.Builder nativeBuilder = VersionKeyOutput.builder();
return nativeBuilder.build();
}
public static KMSConfiguration KMSConfiguration(
software.amazon.cryptography.keystore.internaldafny.types.KMSConfiguration dafnyValue) {
KMSConfiguration.Builder nativeBuilder = KMSConfiguration.builder();
if (dafnyValue.is_kmsKeyArn()) {
nativeBuilder.kmsKeyArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_kmsKeyArn()));
}
return nativeBuilder.build();
}
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 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 Map<String, ByteBuffer> HmacKeyMap(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Byte>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.smithy.dafny.conversion.ToNative.Simple::ByteBuffer);
}
public static KeyStore KeyStore(IKeyStoreClient dafnyValue) {
return new KeyStore(dafnyValue);
}
}
| 3,050 |
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/keystore/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.keystore;
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.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.BeaconKeyMaterials;
import software.amazon.cryptography.keystore.internaldafny.types.BranchKeyMaterials;
import software.amazon.cryptography.keystore.internaldafny.types.CreateKeyInput;
import software.amazon.cryptography.keystore.internaldafny.types.CreateKeyOutput;
import software.amazon.cryptography.keystore.internaldafny.types.CreateKeyStoreInput;
import software.amazon.cryptography.keystore.internaldafny.types.CreateKeyStoreOutput;
import software.amazon.cryptography.keystore.internaldafny.types.Error;
import software.amazon.cryptography.keystore.internaldafny.types.Error_KeyStoreException;
import software.amazon.cryptography.keystore.internaldafny.types.GetActiveBranchKeyInput;
import software.amazon.cryptography.keystore.internaldafny.types.GetActiveBranchKeyOutput;
import software.amazon.cryptography.keystore.internaldafny.types.GetBeaconKeyInput;
import software.amazon.cryptography.keystore.internaldafny.types.GetBeaconKeyOutput;
import software.amazon.cryptography.keystore.internaldafny.types.GetBranchKeyVersionInput;
import software.amazon.cryptography.keystore.internaldafny.types.GetBranchKeyVersionOutput;
import software.amazon.cryptography.keystore.internaldafny.types.GetKeyStoreInfoOutput;
import software.amazon.cryptography.keystore.internaldafny.types.IKeyStoreClient;
import software.amazon.cryptography.keystore.internaldafny.types.KMSConfiguration;
import software.amazon.cryptography.keystore.internaldafny.types.KeyStoreConfig;
import software.amazon.cryptography.keystore.internaldafny.types.VersionKeyInput;
import software.amazon.cryptography.keystore.internaldafny.types.VersionKeyOutput;
import software.amazon.cryptography.keystore.model.CollectionOfErrors;
import software.amazon.cryptography.keystore.model.KeyStoreException;
import software.amazon.cryptography.keystore.model.OpaqueError;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.IDynamoDBClient;
import software.amazon.cryptography.services.kms.internaldafny.types.IKMSClient;
public class ToDafny {
public static Error Error(RuntimeException nativeValue) {
if (nativeValue instanceof KeyStoreException) {
return ToDafny.Error((KeyStoreException) 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 BeaconKeyMaterials BeaconKeyMaterials(
software.amazon.cryptography.keystore.model.BeaconKeyMaterials nativeValue) {
DafnySequence<? extends Character> beaconKeyIdentifier;
beaconKeyIdentifier = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.beaconKeyIdentifier());
DafnyMap<? extends DafnySequence<? extends Byte>, ? extends DafnySequence<? extends Byte>> encryptionContext;
encryptionContext = ToDafny.EncryptionContext(nativeValue.encryptionContext());
Option<DafnySequence<? extends Byte>> beaconKey;
beaconKey = Objects.nonNull(nativeValue.beaconKey()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.beaconKey()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Byte>>> hmacKeys;
hmacKeys = (Objects.nonNull(nativeValue.hmacKeys()) && nativeValue.hmacKeys().size() > 0) ?
Option.create_Some(ToDafny.HmacKeyMap(nativeValue.hmacKeys()))
: Option.create_None();
return new BeaconKeyMaterials(beaconKeyIdentifier, encryptionContext, beaconKey, hmacKeys);
}
public static BranchKeyMaterials BranchKeyMaterials(
software.amazon.cryptography.keystore.model.BranchKeyMaterials nativeValue) {
DafnySequence<? extends Character> branchKeyIdentifier;
branchKeyIdentifier = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.branchKeyIdentifier());
DafnySequence<? extends Byte> branchKeyVersion;
branchKeyVersion = software.amazon.smithy.dafny.conversion.ToDafny.Simple.DafnyUtf8Bytes(nativeValue.branchKeyVersion());
DafnyMap<? extends DafnySequence<? extends Byte>, ? extends DafnySequence<? extends Byte>> encryptionContext;
encryptionContext = ToDafny.EncryptionContext(nativeValue.encryptionContext());
DafnySequence<? extends Byte> branchKey;
branchKey = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.branchKey());
return new BranchKeyMaterials(branchKeyIdentifier, branchKeyVersion, encryptionContext, branchKey);
}
public static CreateKeyInput CreateKeyInput(
software.amazon.cryptography.keystore.model.CreateKeyInput nativeValue) {
Option<DafnySequence<? extends Character>> branchKeyIdentifier;
branchKeyIdentifier = Objects.nonNull(nativeValue.branchKeyIdentifier()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.branchKeyIdentifier()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Byte>, ? extends DafnySequence<? extends Byte>>> encryptionContext;
encryptionContext = (Objects.nonNull(nativeValue.encryptionContext()) && nativeValue.encryptionContext().size() > 0) ?
Option.create_Some(ToDafny.EncryptionContext(nativeValue.encryptionContext()))
: Option.create_None();
return new CreateKeyInput(branchKeyIdentifier, encryptionContext);
}
public static CreateKeyOutput CreateKeyOutput(
software.amazon.cryptography.keystore.model.CreateKeyOutput nativeValue) {
DafnySequence<? extends Character> branchKeyIdentifier;
branchKeyIdentifier = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.branchKeyIdentifier());
return new CreateKeyOutput(branchKeyIdentifier);
}
public static CreateKeyStoreInput CreateKeyStoreInput(
software.amazon.cryptography.keystore.model.CreateKeyStoreInput nativeValue) {
return new CreateKeyStoreInput();
}
public static CreateKeyStoreOutput CreateKeyStoreOutput(
software.amazon.cryptography.keystore.model.CreateKeyStoreOutput nativeValue) {
DafnySequence<? extends Character> tableArn;
tableArn = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableArn());
return new CreateKeyStoreOutput(tableArn);
}
public static GetActiveBranchKeyInput GetActiveBranchKeyInput(
software.amazon.cryptography.keystore.model.GetActiveBranchKeyInput nativeValue) {
DafnySequence<? extends Character> branchKeyIdentifier;
branchKeyIdentifier = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.branchKeyIdentifier());
return new GetActiveBranchKeyInput(branchKeyIdentifier);
}
public static GetActiveBranchKeyOutput GetActiveBranchKeyOutput(
software.amazon.cryptography.keystore.model.GetActiveBranchKeyOutput nativeValue) {
BranchKeyMaterials branchKeyMaterials;
branchKeyMaterials = ToDafny.BranchKeyMaterials(nativeValue.branchKeyMaterials());
return new GetActiveBranchKeyOutput(branchKeyMaterials);
}
public static GetBeaconKeyInput GetBeaconKeyInput(
software.amazon.cryptography.keystore.model.GetBeaconKeyInput nativeValue) {
DafnySequence<? extends Character> branchKeyIdentifier;
branchKeyIdentifier = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.branchKeyIdentifier());
return new GetBeaconKeyInput(branchKeyIdentifier);
}
public static GetBeaconKeyOutput GetBeaconKeyOutput(
software.amazon.cryptography.keystore.model.GetBeaconKeyOutput nativeValue) {
BeaconKeyMaterials beaconKeyMaterials;
beaconKeyMaterials = ToDafny.BeaconKeyMaterials(nativeValue.beaconKeyMaterials());
return new GetBeaconKeyOutput(beaconKeyMaterials);
}
public static GetBranchKeyVersionInput GetBranchKeyVersionInput(
software.amazon.cryptography.keystore.model.GetBranchKeyVersionInput nativeValue) {
DafnySequence<? extends Character> branchKeyIdentifier;
branchKeyIdentifier = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.branchKeyIdentifier());
DafnySequence<? extends Character> branchKeyVersion;
branchKeyVersion = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.branchKeyVersion());
return new GetBranchKeyVersionInput(branchKeyIdentifier, branchKeyVersion);
}
public static GetBranchKeyVersionOutput GetBranchKeyVersionOutput(
software.amazon.cryptography.keystore.model.GetBranchKeyVersionOutput nativeValue) {
BranchKeyMaterials branchKeyMaterials;
branchKeyMaterials = ToDafny.BranchKeyMaterials(nativeValue.branchKeyMaterials());
return new GetBranchKeyVersionOutput(branchKeyMaterials);
}
public static GetKeyStoreInfoOutput GetKeyStoreInfoOutput(
software.amazon.cryptography.keystore.model.GetKeyStoreInfoOutput nativeValue) {
DafnySequence<? extends Character> keyStoreId;
keyStoreId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyStoreId());
DafnySequence<? extends Character> keyStoreName;
keyStoreName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyStoreName());
DafnySequence<? extends Character> logicalKeyStoreName;
logicalKeyStoreName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.logicalKeyStoreName());
DafnySequence<? extends DafnySequence<? extends Character>> grantTokens;
grantTokens = ToDafny.GrantTokenList(nativeValue.grantTokens());
KMSConfiguration kmsConfiguration;
kmsConfiguration = ToDafny.KMSConfiguration(nativeValue.kmsConfiguration());
return new GetKeyStoreInfoOutput(keyStoreId, keyStoreName, logicalKeyStoreName, grantTokens, kmsConfiguration);
}
public static KeyStoreConfig KeyStoreConfig(
software.amazon.cryptography.keystore.model.KeyStoreConfig nativeValue) {
DafnySequence<? extends Character> ddbTableName;
ddbTableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.ddbTableName());
KMSConfiguration kmsConfiguration;
kmsConfiguration = ToDafny.KMSConfiguration(nativeValue.kmsConfiguration());
DafnySequence<? extends Character> logicalKeyStoreName;
logicalKeyStoreName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.logicalKeyStoreName());
Option<DafnySequence<? extends Character>> id;
id = Objects.nonNull(nativeValue.id()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.id()))
: 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();
Option<IDynamoDBClient> ddbClient;
ddbClient = Objects.nonNull(nativeValue.ddbClient()) ?
Option.create_Some(software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny.DynamoDB_20120810(nativeValue.ddbClient()))
: Option.create_None();
Option<IKMSClient> kmsClient;
kmsClient = Objects.nonNull(nativeValue.kmsClient()) ?
Option.create_Some(software.amazon.cryptography.services.kms.internaldafny.ToDafny.TrentService(nativeValue.kmsClient()))
: Option.create_None();
return new KeyStoreConfig(ddbTableName, kmsConfiguration, logicalKeyStoreName, id, grantTokens, ddbClient, kmsClient);
}
public static VersionKeyInput VersionKeyInput(
software.amazon.cryptography.keystore.model.VersionKeyInput nativeValue) {
DafnySequence<? extends Character> branchKeyIdentifier;
branchKeyIdentifier = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.branchKeyIdentifier());
return new VersionKeyInput(branchKeyIdentifier);
}
public static VersionKeyOutput VersionKeyOutput(
software.amazon.cryptography.keystore.model.VersionKeyOutput nativeValue) {
return new VersionKeyOutput();
}
public static Error Error(KeyStoreException nativeValue) {
DafnySequence<? extends Character> message;
message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message());
return new Error_KeyStoreException(message);
}
public static KMSConfiguration KMSConfiguration(
software.amazon.cryptography.keystore.model.KMSConfiguration nativeValue) {
if (Objects.nonNull(nativeValue.kmsKeyArn())) {
return KMSConfiguration.create(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.kmsKeyArn()));
}
throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.keystore.internaldafny.types.KMSConfiguration.");
}
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 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 DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Byte>> HmacKeyMap(
Map<String, ByteBuffer> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::ByteSequence);
}
public static IKeyStoreClient KeyStore(KeyStore nativeValue) {
return nativeValue.impl();
}
}
| 3,051 |
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/keystore/KeyStore.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;
import Wrappers_Compile.Result;
import java.lang.IllegalArgumentException;
import java.util.Objects;
import software.amazon.cryptography.keystore.internaldafny.KeyStoreClient;
import software.amazon.cryptography.keystore.internaldafny.__default;
import software.amazon.cryptography.keystore.internaldafny.types.Error;
import software.amazon.cryptography.keystore.internaldafny.types.IKeyStoreClient;
import software.amazon.cryptography.keystore.model.CreateKeyInput;
import software.amazon.cryptography.keystore.model.CreateKeyOutput;
import software.amazon.cryptography.keystore.model.CreateKeyStoreInput;
import software.amazon.cryptography.keystore.model.CreateKeyStoreOutput;
import software.amazon.cryptography.keystore.model.GetActiveBranchKeyInput;
import software.amazon.cryptography.keystore.model.GetActiveBranchKeyOutput;
import software.amazon.cryptography.keystore.model.GetBeaconKeyInput;
import software.amazon.cryptography.keystore.model.GetBeaconKeyOutput;
import software.amazon.cryptography.keystore.model.GetBranchKeyVersionInput;
import software.amazon.cryptography.keystore.model.GetBranchKeyVersionOutput;
import software.amazon.cryptography.keystore.model.GetKeyStoreInfoOutput;
import software.amazon.cryptography.keystore.model.KeyStoreConfig;
import software.amazon.cryptography.keystore.model.VersionKeyInput;
import software.amazon.cryptography.keystore.model.VersionKeyOutput;
public class KeyStore {
private final IKeyStoreClient _impl;
protected KeyStore(BuilderImpl builder) {
KeyStoreConfig input = builder.KeyStoreConfig();
software.amazon.cryptography.keystore.internaldafny.types.KeyStoreConfig dafnyValue = ToDafny.KeyStoreConfig(input);
Result<KeyStoreClient, Error> result = __default.KeyStore(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
this._impl = result.dtor_value();
}
KeyStore(IKeyStoreClient impl) {
this._impl = impl;
}
public static Builder builder() {
return new BuilderImpl();
}
/**
* Create a new Branch Key in the Key Store. Additionally create a Beacon Key that is tied to this Branch Key.
* @return Outputs for Branch Key creation.
*/
public CreateKeyOutput CreateKey(CreateKeyInput input) {
software.amazon.cryptography.keystore.internaldafny.types.CreateKeyInput dafnyValue = ToDafny.CreateKeyInput(input);
Result<software.amazon.cryptography.keystore.internaldafny.types.CreateKeyOutput, Error> result = this._impl.CreateKey(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.CreateKeyOutput(result.dtor_value());
}
/**
* Create the DynamoDB table that backs this Key Store based on the Key Store configuration. If a table already exists, validate it is configured as expected.
* @return Outputs for Key Store DynamoDB table creation.
*/
public CreateKeyStoreOutput CreateKeyStore(CreateKeyStoreInput input) {
software.amazon.cryptography.keystore.internaldafny.types.CreateKeyStoreInput dafnyValue = ToDafny.CreateKeyStoreInput(input);
Result<software.amazon.cryptography.keystore.internaldafny.types.CreateKeyStoreOutput, Error> result = this._impl.CreateKeyStore(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.CreateKeyStoreOutput(result.dtor_value());
}
/**
* Get the ACTIVE version for a particular Branch Key from the Key Store.
*
* @param input Inputs for getting a Branch Key's ACTIVE version.
* @return Outputs for getting a Branch Key's ACTIVE version.
*/
public GetActiveBranchKeyOutput GetActiveBranchKey(GetActiveBranchKeyInput input) {
software.amazon.cryptography.keystore.internaldafny.types.GetActiveBranchKeyInput dafnyValue = ToDafny.GetActiveBranchKeyInput(input);
Result<software.amazon.cryptography.keystore.internaldafny.types.GetActiveBranchKeyOutput, Error> result = this._impl.GetActiveBranchKey(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.GetActiveBranchKeyOutput(result.dtor_value());
}
/**
* Get a Beacon Key from the Key Store.
*
* @param input Inputs for getting a Beacon Key
* @return Outputs for getting a Beacon Key
*/
public GetBeaconKeyOutput GetBeaconKey(GetBeaconKeyInput input) {
software.amazon.cryptography.keystore.internaldafny.types.GetBeaconKeyInput dafnyValue = ToDafny.GetBeaconKeyInput(input);
Result<software.amazon.cryptography.keystore.internaldafny.types.GetBeaconKeyOutput, Error> result = this._impl.GetBeaconKey(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.GetBeaconKeyOutput(result.dtor_value());
}
/**
* Get a particular version of a Branch Key from the Key Store.
*
* @param input Inputs for getting a version of a Branch Key.
* @return Outputs for getting a version of a Branch Key.
*/
public GetBranchKeyVersionOutput GetBranchKeyVersion(GetBranchKeyVersionInput input) {
software.amazon.cryptography.keystore.internaldafny.types.GetBranchKeyVersionInput dafnyValue = ToDafny.GetBranchKeyVersionInput(input);
Result<software.amazon.cryptography.keystore.internaldafny.types.GetBranchKeyVersionOutput, Error> result = this._impl.GetBranchKeyVersion(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.GetBranchKeyVersionOutput(result.dtor_value());
}
/**
* Returns the configuration information for a Key Store.
* @return The configuration information for a Key Store.
*/
public GetKeyStoreInfoOutput GetKeyStoreInfo() {
Result<software.amazon.cryptography.keystore.internaldafny.types.GetKeyStoreInfoOutput, Error> result = this._impl.GetKeyStoreInfo();
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.GetKeyStoreInfoOutput(result.dtor_value());
}
/**
* Create a new ACTIVE version of an existing Branch Key in the Key Store, and set the previously ACTIVE version to DECRYPT_ONLY.
*
* @param input Inputs for versioning a Branch Key.
* @return Outputs for versioning a Branch Key.
*/
public VersionKeyOutput VersionKey(VersionKeyInput input) {
software.amazon.cryptography.keystore.internaldafny.types.VersionKeyInput dafnyValue = ToDafny.VersionKeyInput(input);
Result<software.amazon.cryptography.keystore.internaldafny.types.VersionKeyOutput, Error> result = this._impl.VersionKey(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.VersionKeyOutput(result.dtor_value());
}
protected IKeyStoreClient impl() {
return this._impl;
}
public interface Builder {
Builder KeyStoreConfig(KeyStoreConfig KeyStoreConfig);
KeyStoreConfig KeyStoreConfig();
KeyStore build();
}
static class BuilderImpl implements Builder {
protected KeyStoreConfig KeyStoreConfig;
protected BuilderImpl() {
}
public Builder KeyStoreConfig(KeyStoreConfig KeyStoreConfig) {
this.KeyStoreConfig = KeyStoreConfig;
return this;
}
public KeyStoreConfig KeyStoreConfig() {
return this.KeyStoreConfig;
}
public KeyStore build() {
if (Objects.isNull(this.KeyStoreConfig())) {
throw new IllegalArgumentException("Missing value for required field `KeyStoreConfig`");
}
return new KeyStore(this);
}
}
}
| 3,052 |
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/GetBeaconKeyOutput.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 getting a Beacon Key
*/
public class GetBeaconKeyOutput {
/**
* The materials for the Beacon Key.
*/
private final BeaconKeyMaterials beaconKeyMaterials;
protected GetBeaconKeyOutput(BuilderImpl builder) {
this.beaconKeyMaterials = builder.beaconKeyMaterials();
}
/**
* @return The materials for the Beacon Key.
*/
public BeaconKeyMaterials beaconKeyMaterials() {
return this.beaconKeyMaterials;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param beaconKeyMaterials The materials for the Beacon Key.
*/
Builder beaconKeyMaterials(BeaconKeyMaterials beaconKeyMaterials);
/**
* @return The materials for the Beacon Key.
*/
BeaconKeyMaterials beaconKeyMaterials();
GetBeaconKeyOutput build();
}
static class BuilderImpl implements Builder {
protected BeaconKeyMaterials beaconKeyMaterials;
protected BuilderImpl() {
}
protected BuilderImpl(GetBeaconKeyOutput model) {
this.beaconKeyMaterials = model.beaconKeyMaterials();
}
public Builder beaconKeyMaterials(BeaconKeyMaterials beaconKeyMaterials) {
this.beaconKeyMaterials = beaconKeyMaterials;
return this;
}
public BeaconKeyMaterials beaconKeyMaterials() {
return this.beaconKeyMaterials;
}
public GetBeaconKeyOutput build() {
if (Objects.isNull(this.beaconKeyMaterials())) {
throw new IllegalArgumentException("Missing value for required field `beaconKeyMaterials`");
}
return new GetBeaconKeyOutput(this);
}
}
}
| 3,053 |
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/KeyStoreException.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;
public class KeyStoreException extends RuntimeException {
protected KeyStoreException(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();
KeyStoreException build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected BuilderImpl() {
}
protected BuilderImpl(KeyStoreException 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 KeyStoreException build() {
if (Objects.isNull(this.message())) {
throw new IllegalArgumentException("Missing value for required field `message`");
}
return new KeyStoreException(this);
}
}
}
| 3,054 |
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/BeaconKeyMaterials.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 BeaconKeyMaterials {
private final String beaconKeyIdentifier;
private final Map<String, String> encryptionContext;
private final ByteBuffer beaconKey;
private final Map<String, ByteBuffer> hmacKeys;
protected BeaconKeyMaterials(BuilderImpl builder) {
this.beaconKeyIdentifier = builder.beaconKeyIdentifier();
this.encryptionContext = builder.encryptionContext();
this.beaconKey = builder.beaconKey();
this.hmacKeys = builder.hmacKeys();
}
public String beaconKeyIdentifier() {
return this.beaconKeyIdentifier;
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public ByteBuffer beaconKey() {
return this.beaconKey;
}
public Map<String, ByteBuffer> hmacKeys() {
return this.hmacKeys;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder beaconKeyIdentifier(String beaconKeyIdentifier);
String beaconKeyIdentifier();
Builder encryptionContext(Map<String, String> encryptionContext);
Map<String, String> encryptionContext();
Builder beaconKey(ByteBuffer beaconKey);
ByteBuffer beaconKey();
Builder hmacKeys(Map<String, ByteBuffer> hmacKeys);
Map<String, ByteBuffer> hmacKeys();
BeaconKeyMaterials build();
}
static class BuilderImpl implements Builder {
protected String beaconKeyIdentifier;
protected Map<String, String> encryptionContext;
protected ByteBuffer beaconKey;
protected Map<String, ByteBuffer> hmacKeys;
protected BuilderImpl() {
}
protected BuilderImpl(BeaconKeyMaterials model) {
this.beaconKeyIdentifier = model.beaconKeyIdentifier();
this.encryptionContext = model.encryptionContext();
this.beaconKey = model.beaconKey();
this.hmacKeys = model.hmacKeys();
}
public Builder beaconKeyIdentifier(String beaconKeyIdentifier) {
this.beaconKeyIdentifier = beaconKeyIdentifier;
return this;
}
public String beaconKeyIdentifier() {
return this.beaconKeyIdentifier;
}
public Builder encryptionContext(Map<String, String> encryptionContext) {
this.encryptionContext = encryptionContext;
return this;
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public Builder beaconKey(ByteBuffer beaconKey) {
this.beaconKey = beaconKey;
return this;
}
public ByteBuffer beaconKey() {
return this.beaconKey;
}
public Builder hmacKeys(Map<String, ByteBuffer> hmacKeys) {
this.hmacKeys = hmacKeys;
return this;
}
public Map<String, ByteBuffer> hmacKeys() {
return this.hmacKeys;
}
public BeaconKeyMaterials build() {
if (Objects.isNull(this.beaconKeyIdentifier())) {
throw new IllegalArgumentException("Missing value for required field `beaconKeyIdentifier`");
}
if (Objects.isNull(this.encryptionContext())) {
throw new IllegalArgumentException("Missing value for required field `encryptionContext`");
}
return new BeaconKeyMaterials(this);
}
}
}
| 3,055 |
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/GetBranchKeyVersionOutput.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 getting a version of a Branch Key.
*/
public class GetBranchKeyVersionOutput {
/**
* The materials for the Branch Key.
*/
private final BranchKeyMaterials branchKeyMaterials;
protected GetBranchKeyVersionOutput(BuilderImpl builder) {
this.branchKeyMaterials = builder.branchKeyMaterials();
}
/**
* @return The materials for the Branch Key.
*/
public BranchKeyMaterials branchKeyMaterials() {
return this.branchKeyMaterials;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param branchKeyMaterials The materials for the Branch Key.
*/
Builder branchKeyMaterials(BranchKeyMaterials branchKeyMaterials);
/**
* @return The materials for the Branch Key.
*/
BranchKeyMaterials branchKeyMaterials();
GetBranchKeyVersionOutput build();
}
static class BuilderImpl implements Builder {
protected BranchKeyMaterials branchKeyMaterials;
protected BuilderImpl() {
}
protected BuilderImpl(GetBranchKeyVersionOutput model) {
this.branchKeyMaterials = model.branchKeyMaterials();
}
public Builder branchKeyMaterials(BranchKeyMaterials branchKeyMaterials) {
this.branchKeyMaterials = branchKeyMaterials;
return this;
}
public BranchKeyMaterials branchKeyMaterials() {
return this.branchKeyMaterials;
}
public GetBranchKeyVersionOutput build() {
if (Objects.isNull(this.branchKeyMaterials())) {
throw new IllegalArgumentException("Missing value for required field `branchKeyMaterials`");
}
return new GetBranchKeyVersionOutput(this);
}
}
}
| 3,056 |
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/GetBeaconKeyInput.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 Beacon Key
*/
public class GetBeaconKeyInput {
/**
* The identifier of the Branch Key the Beacon Key is associated with.
*/
private final String branchKeyIdentifier;
protected GetBeaconKeyInput(BuilderImpl builder) {
this.branchKeyIdentifier = builder.branchKeyIdentifier();
}
/**
* @return The identifier of the Branch Key the Beacon Key is associated with.
*/
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 of the Branch Key the Beacon Key is associated with.
*/
Builder branchKeyIdentifier(String branchKeyIdentifier);
/**
* @return The identifier of the Branch Key the Beacon Key is associated with.
*/
String branchKeyIdentifier();
GetBeaconKeyInput build();
}
static class BuilderImpl implements Builder {
protected String branchKeyIdentifier;
protected BuilderImpl() {
}
protected BuilderImpl(GetBeaconKeyInput model) {
this.branchKeyIdentifier = model.branchKeyIdentifier();
}
public Builder branchKeyIdentifier(String branchKeyIdentifier) {
this.branchKeyIdentifier = branchKeyIdentifier;
return this;
}
public String branchKeyIdentifier() {
return this.branchKeyIdentifier;
}
public GetBeaconKeyInput build() {
if (Objects.isNull(this.branchKeyIdentifier())) {
throw new IllegalArgumentException("Missing value for required field `branchKeyIdentifier`");
}
return new GetBeaconKeyInput(this);
}
}
}
| 3,057 |
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/VersionKeyInput.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 versioning a Branch Key.
*/
public class VersionKeyInput {
/**
* The identifier for the Branch Key to be versioned.
*/
private final String branchKeyIdentifier;
protected VersionKeyInput(BuilderImpl builder) {
this.branchKeyIdentifier = builder.branchKeyIdentifier();
}
/**
* @return The identifier for the Branch Key to be versioned.
*/
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 be versioned.
*/
Builder branchKeyIdentifier(String branchKeyIdentifier);
/**
* @return The identifier for the Branch Key to be versioned.
*/
String branchKeyIdentifier();
VersionKeyInput build();
}
static class BuilderImpl implements Builder {
protected String branchKeyIdentifier;
protected BuilderImpl() {
}
protected BuilderImpl(VersionKeyInput model) {
this.branchKeyIdentifier = model.branchKeyIdentifier();
}
public Builder branchKeyIdentifier(String branchKeyIdentifier) {
this.branchKeyIdentifier = branchKeyIdentifier;
return this;
}
public String branchKeyIdentifier() {
return this.branchKeyIdentifier;
}
public VersionKeyInput build() {
if (Objects.isNull(this.branchKeyIdentifier())) {
throw new IllegalArgumentException("Missing value for required field `branchKeyIdentifier`");
}
return new VersionKeyInput(this);
}
}
}
| 3,058 |
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/KMSConfiguration.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;
public class KMSConfiguration {
private final String kmsKeyArn;
protected KMSConfiguration(BuilderImpl builder) {
this.kmsKeyArn = builder.kmsKeyArn();
}
public String kmsKeyArn() {
return this.kmsKeyArn;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder kmsKeyArn(String kmsKeyArn);
String kmsKeyArn();
KMSConfiguration build();
}
static class BuilderImpl implements Builder {
protected String kmsKeyArn;
protected BuilderImpl() {
}
protected BuilderImpl(KMSConfiguration model) {
this.kmsKeyArn = model.kmsKeyArn();
}
public Builder kmsKeyArn(String kmsKeyArn) {
this.kmsKeyArn = kmsKeyArn;
return this;
}
public String kmsKeyArn() {
return this.kmsKeyArn;
}
public KMSConfiguration build() {
if (Objects.nonNull(this.kmsKeyArn()) && this.kmsKeyArn().length() < 1) {
throw new IllegalArgumentException("The size of `kmsKeyArn` must be greater than or equal to 1");
}
if (Objects.nonNull(this.kmsKeyArn()) && this.kmsKeyArn().length() > 2048) {
throw new IllegalArgumentException("The size of `kmsKeyArn` must be less than or equal to 2048");
}
if (!onlyOneNonNull()) {
throw new IllegalArgumentException("`KMSConfiguration` is a Union. A Union MUST have one and only one value set.");
}
return new KMSConfiguration(this);
}
private boolean onlyOneNonNull() {
Object[] allValues = {this.kmsKeyArn};
boolean haveOneNonNull = false;
for (Object o : allValues) {
if (Objects.nonNull(o)) {
if (haveOneNonNull) {
return false;
}
haveOneNonNull = true;
}
}
return haveOneNonNull;
}
}
}
| 3,059 |
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/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.keystore.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);
}
}
}
| 3,060 |
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/BranchKeyStatusResolutionInput.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 resolving a multiple ACTIVE versions state.
*/
public class BranchKeyStatusResolutionInput {
/**
* The identifier for the Branch Key which has more than one ACTIVE version
*/
private final String branchKeyIdentifier;
protected BranchKeyStatusResolutionInput(BuilderImpl builder) {
this.branchKeyIdentifier = builder.branchKeyIdentifier();
}
/**
* @return The identifier for the Branch Key which has more than one ACTIVE version
*/
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 which has more than one ACTIVE version
*/
Builder branchKeyIdentifier(String branchKeyIdentifier);
/**
* @return The identifier for the Branch Key which has more than one ACTIVE version
*/
String branchKeyIdentifier();
BranchKeyStatusResolutionInput build();
}
static class BuilderImpl implements Builder {
protected String branchKeyIdentifier;
protected BuilderImpl() {
}
protected BuilderImpl(BranchKeyStatusResolutionInput model) {
this.branchKeyIdentifier = model.branchKeyIdentifier();
}
public Builder branchKeyIdentifier(String branchKeyIdentifier) {
this.branchKeyIdentifier = branchKeyIdentifier;
return this;
}
public String branchKeyIdentifier() {
return this.branchKeyIdentifier;
}
public BranchKeyStatusResolutionInput build() {
if (Objects.isNull(this.branchKeyIdentifier())) {
throw new IllegalArgumentException("Missing value for required field `branchKeyIdentifier`");
}
return new BranchKeyStatusResolutionInput(this);
}
}
}
| 3,061 |
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/CreateKeyOutput.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 Branch Key creation.
*/
public class CreateKeyOutput {
/**
* A identifier for the created Branch Key.
*/
private final String branchKeyIdentifier;
protected CreateKeyOutput(BuilderImpl builder) {
this.branchKeyIdentifier = builder.branchKeyIdentifier();
}
/**
* @return A identifier for the created Branch Key.
*/
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 A identifier for the created Branch Key.
*/
Builder branchKeyIdentifier(String branchKeyIdentifier);
/**
* @return A identifier for the created Branch Key.
*/
String branchKeyIdentifier();
CreateKeyOutput build();
}
static class BuilderImpl implements Builder {
protected String branchKeyIdentifier;
protected BuilderImpl() {
}
protected BuilderImpl(CreateKeyOutput model) {
this.branchKeyIdentifier = model.branchKeyIdentifier();
}
public Builder branchKeyIdentifier(String branchKeyIdentifier) {
this.branchKeyIdentifier = branchKeyIdentifier;
return this;
}
public String branchKeyIdentifier() {
return this.branchKeyIdentifier;
}
public CreateKeyOutput build() {
if (Objects.isNull(this.branchKeyIdentifier())) {
throw new IllegalArgumentException("Missing value for required field `branchKeyIdentifier`");
}
return new CreateKeyOutput(this);
}
}
}
| 3,062 |
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/KeyStoreConfig.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;
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
import software.amazon.awssdk.services.kms.KmsClient;
public class KeyStoreConfig {
/**
* The DynamoDB table name that backs this Key Store.
*/
private final String ddbTableName;
/**
* The AWS KMS Key that protects this Key Store.
*/
private final KMSConfiguration kmsConfiguration;
/**
* The logical name for this Key Store, which is cryptographically bound to the keys it holds.
*/
private final String logicalKeyStoreName;
/**
* An identifier for this Key Store.
*/
private final String id;
/**
* The AWS KMS grant tokens that are used when this Key Store calls to AWS KMS.
*/
private final List<String> grantTokens;
/**
* The DynamoDB client this Key Store uses to call Amazon DynamoDB.
*/
private final DynamoDbClient ddbClient;
/**
* The KMS client this Key Store uses to call AWS KMS.
*/
private final KmsClient kmsClient;
protected KeyStoreConfig(BuilderImpl builder) {
this.ddbTableName = builder.ddbTableName();
this.kmsConfiguration = builder.kmsConfiguration();
this.logicalKeyStoreName = builder.logicalKeyStoreName();
this.id = builder.id();
this.grantTokens = builder.grantTokens();
this.ddbClient = builder.ddbClient();
this.kmsClient = builder.kmsClient();
}
/**
* @return The DynamoDB table name that backs this Key Store.
*/
public String ddbTableName() {
return this.ddbTableName;
}
/**
* @return The AWS KMS Key that protects this Key Store.
*/
public KMSConfiguration kmsConfiguration() {
return this.kmsConfiguration;
}
/**
* @return The logical name for this Key Store, which is cryptographically bound to the keys it holds.
*/
public String logicalKeyStoreName() {
return this.logicalKeyStoreName;
}
/**
* @return An identifier for this Key Store.
*/
public String id() {
return this.id;
}
/**
* @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 DynamoDB client this Key Store uses to call Amazon DynamoDB.
*/
public DynamoDbClient ddbClient() {
return this.ddbClient;
}
/**
* @return The KMS client this Key Store uses to call AWS KMS.
*/
public KmsClient kmsClient() {
return this.kmsClient;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param ddbTableName The DynamoDB table name that backs this Key Store.
*/
Builder ddbTableName(String ddbTableName);
/**
* @return The DynamoDB table name that backs this Key Store.
*/
String ddbTableName();
/**
* @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();
/**
* @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 id An identifier for this Key Store.
*/
Builder id(String id);
/**
* @return An identifier for this Key Store.
*/
String id();
/**
* @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 ddbClient The DynamoDB client this Key Store uses to call Amazon DynamoDB.
*/
Builder ddbClient(DynamoDbClient ddbClient);
/**
* @return The DynamoDB client this Key Store uses to call Amazon DynamoDB.
*/
DynamoDbClient ddbClient();
/**
* @param kmsClient The KMS client this Key Store uses to call AWS KMS.
*/
Builder kmsClient(KmsClient kmsClient);
/**
* @return The KMS client this Key Store uses to call AWS KMS.
*/
KmsClient kmsClient();
KeyStoreConfig build();
}
static class BuilderImpl implements Builder {
protected String ddbTableName;
protected KMSConfiguration kmsConfiguration;
protected String logicalKeyStoreName;
protected String id;
protected List<String> grantTokens;
protected DynamoDbClient ddbClient;
protected KmsClient kmsClient;
protected BuilderImpl() {
}
protected BuilderImpl(KeyStoreConfig model) {
this.ddbTableName = model.ddbTableName();
this.kmsConfiguration = model.kmsConfiguration();
this.logicalKeyStoreName = model.logicalKeyStoreName();
this.id = model.id();
this.grantTokens = model.grantTokens();
this.ddbClient = model.ddbClient();
this.kmsClient = model.kmsClient();
}
public Builder ddbTableName(String ddbTableName) {
this.ddbTableName = ddbTableName;
return this;
}
public String ddbTableName() {
return this.ddbTableName;
}
public Builder kmsConfiguration(KMSConfiguration kmsConfiguration) {
this.kmsConfiguration = kmsConfiguration;
return this;
}
public KMSConfiguration kmsConfiguration() {
return this.kmsConfiguration;
}
public Builder logicalKeyStoreName(String logicalKeyStoreName) {
this.logicalKeyStoreName = logicalKeyStoreName;
return this;
}
public String logicalKeyStoreName() {
return this.logicalKeyStoreName;
}
public Builder id(String id) {
this.id = id;
return this;
}
public String id() {
return this.id;
}
public Builder grantTokens(List<String> grantTokens) {
this.grantTokens = grantTokens;
return this;
}
public List<String> grantTokens() {
return this.grantTokens;
}
public Builder ddbClient(DynamoDbClient ddbClient) {
this.ddbClient = ddbClient;
return this;
}
public DynamoDbClient ddbClient() {
return this.ddbClient;
}
public Builder kmsClient(KmsClient kmsClient) {
this.kmsClient = kmsClient;
return this;
}
public KmsClient kmsClient() {
return this.kmsClient;
}
public KeyStoreConfig build() {
if (Objects.isNull(this.ddbTableName())) {
throw new IllegalArgumentException("Missing value for required field `ddbTableName`");
}
if (Objects.nonNull(this.ddbTableName()) && this.ddbTableName().length() < 3) {
throw new IllegalArgumentException("The size of `ddbTableName` must be greater than or equal to 3");
}
if (Objects.nonNull(this.ddbTableName()) && this.ddbTableName().length() > 255) {
throw new IllegalArgumentException("The size of `ddbTableName` must be less than or equal to 255");
}
if (Objects.isNull(this.kmsConfiguration())) {
throw new IllegalArgumentException("Missing value for required field `kmsConfiguration`");
}
if (Objects.isNull(this.logicalKeyStoreName())) {
throw new IllegalArgumentException("Missing value for required field `logicalKeyStoreName`");
}
return new KeyStoreConfig(this);
}
}
}
| 3,063 |
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/GetBranchKeyVersionInput.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 version of a Branch Key.
*/
public class GetBranchKeyVersionInput {
/**
* The identifier for the Branch Key to get a particular version for.
*/
private final String branchKeyIdentifier;
/**
* The version to get.
*/
private final String branchKeyVersion;
protected GetBranchKeyVersionInput(BuilderImpl builder) {
this.branchKeyIdentifier = builder.branchKeyIdentifier();
this.branchKeyVersion = builder.branchKeyVersion();
}
/**
* @return The identifier for the Branch Key to get a particular version for.
*/
public String branchKeyIdentifier() {
return this.branchKeyIdentifier;
}
/**
* @return The version to get.
*/
public String branchKeyVersion() {
return this.branchKeyVersion;
}
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 a particular version for.
*/
Builder branchKeyIdentifier(String branchKeyIdentifier);
/**
* @return The identifier for the Branch Key to get a particular version for.
*/
String branchKeyIdentifier();
/**
* @param branchKeyVersion The version to get.
*/
Builder branchKeyVersion(String branchKeyVersion);
/**
* @return The version to get.
*/
String branchKeyVersion();
GetBranchKeyVersionInput build();
}
static class BuilderImpl implements Builder {
protected String branchKeyIdentifier;
protected String branchKeyVersion;
protected BuilderImpl() {
}
protected BuilderImpl(GetBranchKeyVersionInput model) {
this.branchKeyIdentifier = model.branchKeyIdentifier();
this.branchKeyVersion = model.branchKeyVersion();
}
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 GetBranchKeyVersionInput 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`");
}
return new GetBranchKeyVersionInput(this);
}
}
}
| 3,064 |
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/GetActiveBranchKeyOutput.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 getting a Branch Key's ACTIVE version.
*/
public class GetActiveBranchKeyOutput {
/**
* The materials for the Branch Key.
*/
private final BranchKeyMaterials branchKeyMaterials;
protected GetActiveBranchKeyOutput(BuilderImpl builder) {
this.branchKeyMaterials = builder.branchKeyMaterials();
}
/**
* @return The materials for the Branch Key.
*/
public BranchKeyMaterials branchKeyMaterials() {
return this.branchKeyMaterials;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param branchKeyMaterials The materials for the Branch Key.
*/
Builder branchKeyMaterials(BranchKeyMaterials branchKeyMaterials);
/**
* @return The materials for the Branch Key.
*/
BranchKeyMaterials branchKeyMaterials();
GetActiveBranchKeyOutput build();
}
static class BuilderImpl implements Builder {
protected BranchKeyMaterials branchKeyMaterials;
protected BuilderImpl() {
}
protected BuilderImpl(GetActiveBranchKeyOutput model) {
this.branchKeyMaterials = model.branchKeyMaterials();
}
public Builder branchKeyMaterials(BranchKeyMaterials branchKeyMaterials) {
this.branchKeyMaterials = branchKeyMaterials;
return this;
}
public BranchKeyMaterials branchKeyMaterials() {
return this.branchKeyMaterials;
}
public GetActiveBranchKeyOutput build() {
if (Objects.isNull(this.branchKeyMaterials())) {
throw new IllegalArgumentException("Missing value for required field `branchKeyMaterials`");
}
return new GetActiveBranchKeyOutput(this);
}
}
}
| 3,065 |
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);
}
}
}
| 3,066 |
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);
}
}
}
| 3,067 |
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);
}
}
}
| 3,068 |
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);
}
}
}
| 3,069 |
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);
}
}
}
| 3,070 |
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);
}
}
}
| 3,071 |
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);
}
}
}
| 3,072 |
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);
}
}
}
| 3,073 |
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.");
}
}
}
| 3,074 |
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.");
}
}
}
| 3,075 |
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);
}
| 3,076 |
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);
}
}
| 3,077 |
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);
}
| 3,078 |
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);
}
| 3,079 |
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.");
}
}
}
| 3,080 |
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.");
}
}
}
| 3,081 |
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);
}
| 3,082 |
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);
}
}
}
| 3,083 |
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.");
}
}
}
| 3,084 |
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();
}
}
| 3,085 |
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);
}
| 3,086 |
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);
}
}
}
| 3,087 |
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);
}
}
}
| 3,088 |
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);
}
}
}
| 3,089 |
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);
}
}
}
| 3,090 |
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);
}
}
}
| 3,091 |
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);
}
}
}
| 3,092 |
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);
}
}
| 3,093 |
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);
}
}
}
| 3,094 |
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);
}
}
}
| 3,095 |
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);
}
}
}
| 3,096 |
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);
}
}
}
| 3,097 |
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);
}
}
}
| 3,098 |
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);
}
}
}
| 3,099 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.