/* * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.kms.model; import java.io.Serializable; public class GetPublicKeyResult implements Serializable { /** *
* The Amazon Resource Name (key ARN) of the asymmetric KMS key from which the public key was * downloaded. *
*
* Constraints:
* Length: 1 - 2048
*/
private String keyId;
/**
*
* The exported public key. *
*
* The value is a DER-encoded X.509 public key, also known as
* SubjectPublicKeyInfo
(SPKI), as defined in RFC 5280. When you use the
* HTTP API or the Amazon Web Services CLI, the value is Base64-encoded.
* Otherwise, it is not Base64-encoded.
*
* Constraints:
* Length: 1 - 8192
*/
private java.nio.ByteBuffer publicKey;
/**
*
* Instead, use the KeySpec
field in the
* GetPublicKey
response.
*
* The KeySpec
and CustomerMasterKeySpec
fields
* have the same value. We recommend that you use the KeySpec
* field in your code. However, to avoid breaking changes, KMS supports both
* fields.
*
* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256,
* ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT,
* HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
*/
private String customerMasterKeySpec;
/**
*
* The type of the of the public key that was downloaded. *
*
* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256,
* ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT,
* HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
*/
private String keySpec;
/**
*
* The permitted use of the public key. Valid values are
* ENCRYPT_DECRYPT
or SIGN_VERIFY
.
*
* This information is critical. If a public key with
* SIGN_VERIFY
key usage encrypts data outside of KMS, the
* ciphertext cannot be decrypted.
*
* Constraints:
* Allowed Values: SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC
*/
private String keyUsage;
/**
*
* The encryption algorithms that KMS supports for this key. *
** This information is critical. If a public key encrypts data outside of * KMS by using an unsupported encryption algorithm, the ciphertext cannot * be decrypted. *
*
* This field appears in the response only when the KeyUsage
of
* the public key is ENCRYPT_DECRYPT
.
*
* The signing algorithms that KMS supports for this key. *
*
* This field appears in the response only when the KeyUsage
of
* the public key is SIGN_VERIFY
.
*
* The Amazon Resource Name (key ARN) of the asymmetric KMS key from which the public key was * downloaded. *
*
* Constraints:
* Length: 1 - 2048
*
* @return
* The Amazon Resource Name (key ARN) of the asymmetric KMS key from which the public key * was downloaded. *
*/ public String getKeyId() { return keyId; } /** ** The Amazon Resource Name (key ARN) of the asymmetric KMS key from which the public key was * downloaded. *
*
* Constraints:
* Length: 1 - 2048
*
* @param keyId
* The Amazon Resource Name (key ARN) of the asymmetric KMS key from which the public * key was downloaded. *
*/ public void setKeyId(String keyId) { this.keyId = keyId; } /** ** The Amazon Resource Name (key ARN) of the asymmetric KMS key from which the public key was * downloaded. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 2048
*
* @param keyId
* The Amazon Resource Name (key ARN) of the asymmetric KMS key from which the public * key was downloaded. *
* @return A reference to this updated object so that method calls can be * chained together. */ public GetPublicKeyResult withKeyId(String keyId) { this.keyId = keyId; return this; } /** ** The exported public key. *
*
* The value is a DER-encoded X.509 public key, also known as
* SubjectPublicKeyInfo
(SPKI), as defined in RFC 5280. When you use the
* HTTP API or the Amazon Web Services CLI, the value is Base64-encoded.
* Otherwise, it is not Base64-encoded.
*
* Constraints:
* Length: 1 - 8192
*
* @return
* The exported public key. *
*
* The value is a DER-encoded X.509 public key, also known as
* SubjectPublicKeyInfo
(SPKI), as defined in RFC 5280. When you
* use the HTTP API or the Amazon Web Services CLI, the value is
* Base64-encoded. Otherwise, it is not Base64-encoded.
*
* The exported public key. *
*
* The value is a DER-encoded X.509 public key, also known as
* SubjectPublicKeyInfo
(SPKI), as defined in RFC 5280. When you use the
* HTTP API or the Amazon Web Services CLI, the value is Base64-encoded.
* Otherwise, it is not Base64-encoded.
*
* Constraints:
* Length: 1 - 8192
*
* @param publicKey
* The exported public key. *
*
* The value is a DER-encoded X.509 public key, also known as
* SubjectPublicKeyInfo
(SPKI), as defined in RFC 5280. When
* you use the HTTP API or the Amazon Web Services CLI, the value
* is Base64-encoded. Otherwise, it is not Base64-encoded.
*
* The exported public key. *
*
* The value is a DER-encoded X.509 public key, also known as
* SubjectPublicKeyInfo
(SPKI), as defined in RFC 5280. When you use the
* HTTP API or the Amazon Web Services CLI, the value is Base64-encoded.
* Otherwise, it is not Base64-encoded.
*
* Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 8192
*
* @param publicKey
* The exported public key. *
*
* The value is a DER-encoded X.509 public key, also known as
* SubjectPublicKeyInfo
(SPKI), as defined in RFC 5280. When
* you use the HTTP API or the Amazon Web Services CLI, the value
* is Base64-encoded. Otherwise, it is not Base64-encoded.
*
* Instead, use the KeySpec
field in the
* GetPublicKey
response.
*
* The KeySpec
and CustomerMasterKeySpec
fields
* have the same value. We recommend that you use the KeySpec
* field in your code. However, to avoid breaking changes, KMS supports both
* fields.
*
* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256,
* ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT,
* HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
*
* @return
* Instead, use the KeySpec
field in the
* GetPublicKey
response.
*
* The KeySpec
and CustomerMasterKeySpec
* fields have the same value. We recommend that you use the
* KeySpec
field in your code. However, to avoid
* breaking changes, KMS supports both fields.
*
* Instead, use the KeySpec
field in the
* GetPublicKey
response.
*
* The KeySpec
and CustomerMasterKeySpec
fields
* have the same value. We recommend that you use the KeySpec
* field in your code. However, to avoid breaking changes, KMS supports both
* fields.
*
* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256,
* ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT,
* HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
*
* @param customerMasterKeySpec
* Instead, use the KeySpec
field in the
* GetPublicKey
response.
*
* The KeySpec
and
* CustomerMasterKeySpec
fields have the same value.
* We recommend that you use the KeySpec
field in
* your code. However, to avoid breaking changes, KMS supports
* both fields.
*
* Instead, use the KeySpec
field in the
* GetPublicKey
response.
*
* The KeySpec
and CustomerMasterKeySpec
fields
* have the same value. We recommend that you use the KeySpec
* field in your code. However, to avoid breaking changes, KMS supports both
* fields.
*
* Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256,
* ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT,
* HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
*
* @param customerMasterKeySpec
* Instead, use the KeySpec
field in the
* GetPublicKey
response.
*
* The KeySpec
and
* CustomerMasterKeySpec
fields have the same value.
* We recommend that you use the KeySpec
field in
* your code. However, to avoid breaking changes, KMS supports
* both fields.
*
* Instead, use the KeySpec
field in the
* GetPublicKey
response.
*
* The KeySpec
and CustomerMasterKeySpec
fields
* have the same value. We recommend that you use the KeySpec
* field in your code. However, to avoid breaking changes, KMS supports both
* fields.
*
* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256,
* ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT,
* HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
*
* @param customerMasterKeySpec
* Instead, use the KeySpec
field in the
* GetPublicKey
response.
*
* The KeySpec
and
* CustomerMasterKeySpec
fields have the same value.
* We recommend that you use the KeySpec
field in
* your code. However, to avoid breaking changes, KMS supports
* both fields.
*
* Instead, use the KeySpec
field in the
* GetPublicKey
response.
*
* The KeySpec
and CustomerMasterKeySpec
fields
* have the same value. We recommend that you use the KeySpec
* field in your code. However, to avoid breaking changes, KMS supports both
* fields.
*
* Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256,
* ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT,
* HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
*
* @param customerMasterKeySpec
* Instead, use the KeySpec
field in the
* GetPublicKey
response.
*
* The KeySpec
and
* CustomerMasterKeySpec
fields have the same value.
* We recommend that you use the KeySpec
field in
* your code. However, to avoid breaking changes, KMS supports
* both fields.
*
* The type of the of the public key that was downloaded. *
*
* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256,
* ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT,
* HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
*
* @return
* The type of the of the public key that was downloaded. *
* @see KeySpec */ public String getKeySpec() { return keySpec; } /** ** The type of the of the public key that was downloaded. *
*
* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256,
* ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT,
* HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
*
* @param keySpec
* The type of the of the public key that was downloaded. *
* @see KeySpec */ public void setKeySpec(String keySpec) { this.keySpec = keySpec; } /** ** The type of the of the public key that was downloaded. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256,
* ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT,
* HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
*
* @param keySpec
* The type of the of the public key that was downloaded. *
* @return A reference to this updated object so that method calls can be * chained together. * @see KeySpec */ public GetPublicKeyResult withKeySpec(String keySpec) { this.keySpec = keySpec; return this; } /** ** The type of the of the public key that was downloaded. *
*
* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256,
* ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT,
* HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
*
* @param keySpec
* The type of the of the public key that was downloaded. *
* @see KeySpec */ public void setKeySpec(KeySpec keySpec) { this.keySpec = keySpec.toString(); } /** ** The type of the of the public key that was downloaded. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256,
* ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT,
* HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
*
* @param keySpec
* The type of the of the public key that was downloaded. *
* @return A reference to this updated object so that method calls can be * chained together. * @see KeySpec */ public GetPublicKeyResult withKeySpec(KeySpec keySpec) { this.keySpec = keySpec.toString(); return this; } /** *
* The permitted use of the public key. Valid values are
* ENCRYPT_DECRYPT
or SIGN_VERIFY
.
*
* This information is critical. If a public key with
* SIGN_VERIFY
key usage encrypts data outside of KMS, the
* ciphertext cannot be decrypted.
*
* Constraints:
* Allowed Values: SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC
*
* @return
* The permitted use of the public key. Valid values are
* ENCRYPT_DECRYPT
or SIGN_VERIFY
.
*
* This information is critical. If a public key with
* SIGN_VERIFY
key usage encrypts data outside of KMS,
* the ciphertext cannot be decrypted.
*
* The permitted use of the public key. Valid values are
* ENCRYPT_DECRYPT
or SIGN_VERIFY
.
*
* This information is critical. If a public key with
* SIGN_VERIFY
key usage encrypts data outside of KMS, the
* ciphertext cannot be decrypted.
*
* Constraints:
* Allowed Values: SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC
*
* @param keyUsage
* The permitted use of the public key. Valid values are
* ENCRYPT_DECRYPT
or SIGN_VERIFY
.
*
* This information is critical. If a public key with
* SIGN_VERIFY
key usage encrypts data outside of
* KMS, the ciphertext cannot be decrypted.
*
* The permitted use of the public key. Valid values are
* ENCRYPT_DECRYPT
or SIGN_VERIFY
.
*
* This information is critical. If a public key with
* SIGN_VERIFY
key usage encrypts data outside of KMS, the
* ciphertext cannot be decrypted.
*
* Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC
*
* @param keyUsage
* The permitted use of the public key. Valid values are
* ENCRYPT_DECRYPT
or SIGN_VERIFY
.
*
* This information is critical. If a public key with
* SIGN_VERIFY
key usage encrypts data outside of
* KMS, the ciphertext cannot be decrypted.
*
* The permitted use of the public key. Valid values are
* ENCRYPT_DECRYPT
or SIGN_VERIFY
.
*
* This information is critical. If a public key with
* SIGN_VERIFY
key usage encrypts data outside of KMS, the
* ciphertext cannot be decrypted.
*
* Constraints:
* Allowed Values: SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC
*
* @param keyUsage
* The permitted use of the public key. Valid values are
* ENCRYPT_DECRYPT
or SIGN_VERIFY
.
*
* This information is critical. If a public key with
* SIGN_VERIFY
key usage encrypts data outside of
* KMS, the ciphertext cannot be decrypted.
*
* The permitted use of the public key. Valid values are
* ENCRYPT_DECRYPT
or SIGN_VERIFY
.
*
* This information is critical. If a public key with
* SIGN_VERIFY
key usage encrypts data outside of KMS, the
* ciphertext cannot be decrypted.
*
* Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC
*
* @param keyUsage
* The permitted use of the public key. Valid values are
* ENCRYPT_DECRYPT
or SIGN_VERIFY
.
*
* This information is critical. If a public key with
* SIGN_VERIFY
key usage encrypts data outside of
* KMS, the ciphertext cannot be decrypted.
*
* The encryption algorithms that KMS supports for this key. *
** This information is critical. If a public key encrypts data outside of * KMS by using an unsupported encryption algorithm, the ciphertext cannot * be decrypted. *
*
* This field appears in the response only when the KeyUsage
of
* the public key is ENCRYPT_DECRYPT
.
*
* The encryption algorithms that KMS supports for this key. *
** This information is critical. If a public key encrypts data * outside of KMS by using an unsupported encryption algorithm, the * ciphertext cannot be decrypted. *
*
* This field appears in the response only when the
* KeyUsage
of the public key is
* ENCRYPT_DECRYPT
.
*
* The encryption algorithms that KMS supports for this key. *
** This information is critical. If a public key encrypts data outside of * KMS by using an unsupported encryption algorithm, the ciphertext cannot * be decrypted. *
*
* This field appears in the response only when the KeyUsage
of
* the public key is ENCRYPT_DECRYPT
.
*
* The encryption algorithms that KMS supports for this key. *
** This information is critical. If a public key encrypts data * outside of KMS by using an unsupported encryption algorithm, * the ciphertext cannot be decrypted. *
*
* This field appears in the response only when the
* KeyUsage
of the public key is
* ENCRYPT_DECRYPT
.
*
* The encryption algorithms that KMS supports for this key. *
** This information is critical. If a public key encrypts data outside of * KMS by using an unsupported encryption algorithm, the ciphertext cannot * be decrypted. *
*
* This field appears in the response only when the KeyUsage
of
* the public key is ENCRYPT_DECRYPT
.
*
* Returns a reference to this object so that method calls can be chained * together. * * @param encryptionAlgorithms
* The encryption algorithms that KMS supports for this key. *
** This information is critical. If a public key encrypts data * outside of KMS by using an unsupported encryption algorithm, * the ciphertext cannot be decrypted. *
*
* This field appears in the response only when the
* KeyUsage
of the public key is
* ENCRYPT_DECRYPT
.
*
* The encryption algorithms that KMS supports for this key. *
** This information is critical. If a public key encrypts data outside of * KMS by using an unsupported encryption algorithm, the ciphertext cannot * be decrypted. *
*
* This field appears in the response only when the KeyUsage
of
* the public key is ENCRYPT_DECRYPT
.
*
* Returns a reference to this object so that method calls can be chained * together. * * @param encryptionAlgorithms
* The encryption algorithms that KMS supports for this key. *
** This information is critical. If a public key encrypts data * outside of KMS by using an unsupported encryption algorithm, * the ciphertext cannot be decrypted. *
*
* This field appears in the response only when the
* KeyUsage
of the public key is
* ENCRYPT_DECRYPT
.
*
* The signing algorithms that KMS supports for this key. *
*
* This field appears in the response only when the KeyUsage
of
* the public key is SIGN_VERIFY
.
*
* The signing algorithms that KMS supports for this key. *
*
* This field appears in the response only when the
* KeyUsage
of the public key is
* SIGN_VERIFY
.
*
* The signing algorithms that KMS supports for this key. *
*
* This field appears in the response only when the KeyUsage
of
* the public key is SIGN_VERIFY
.
*
* The signing algorithms that KMS supports for this key. *
*
* This field appears in the response only when the
* KeyUsage
of the public key is
* SIGN_VERIFY
.
*
* The signing algorithms that KMS supports for this key. *
*
* This field appears in the response only when the KeyUsage
of
* the public key is SIGN_VERIFY
.
*
* Returns a reference to this object so that method calls can be chained * together. * * @param signingAlgorithms
* The signing algorithms that KMS supports for this key. *
*
* This field appears in the response only when the
* KeyUsage
of the public key is
* SIGN_VERIFY
.
*
* The signing algorithms that KMS supports for this key. *
*
* This field appears in the response only when the KeyUsage
of
* the public key is SIGN_VERIFY
.
*
* Returns a reference to this object so that method calls can be chained * together. * * @param signingAlgorithms
* The signing algorithms that KMS supports for this key. *
*
* This field appears in the response only when the
* KeyUsage
of the public key is
* SIGN_VERIFY
.
*