/* * 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; /** *

* Contains metadata about a KMS key. *

*

* This data type is used as a response element for the CreateKey, * DescribeKey, and ReplicateKey operations. *

*/ public class KeyMetadata implements Serializable { /** *

* The twelve-digit account ID of the Amazon Web Services account that owns * the KMS key. *

*/ private String aWSAccountId; /** *

* The globally unique identifier for the KMS key. *

*

* Constraints:
* Length: 1 - 2048
*/ private String keyId; /** *

* The Amazon Resource Name (ARN) of the KMS key. For examples, see Key Management Service (KMS) in the Example ARNs section of the * Amazon Web Services General Reference. *

*

* Constraints:
* Length: 20 - 2048
*/ private String arn; /** *

* The date and time when the KMS key was created. *

*/ private java.util.Date creationDate; /** *

* Specifies whether the KMS key is enabled. When KeyState is * Enabled this value is true, otherwise it is false. *

*/ private Boolean enabled; /** *

* The description of the KMS key. *

*

* Constraints:
* Length: 0 - 8192
*/ private String description; /** *

* The cryptographic operations for which you can use the KMS key. *

*

* Constraints:
* Allowed Values: SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC */ private String keyUsage; /** *

* The current status of the KMS key. *

*

* For more information about how key state affects the use of a KMS key, * see Key states of KMS keys in the Key Management Service Developer * Guide. *

*

* Constraints:
* Allowed Values: Creating, Enabled, Disabled, PendingDeletion, * PendingImport, PendingReplicaDeletion, Unavailable, Updating */ private String keyState; /** *

* The date and time after which KMS deletes this KMS key. This value is * present only when the KMS key is scheduled for deletion, that is, when * its KeyState is PendingDeletion. *

*

* When the primary key in a multi-Region key is scheduled for deletion but * still has replica keys, its key state is * PendingReplicaDeletion and the length of its waiting period * is displayed in the PendingDeletionWindowInDays field. *

*/ private java.util.Date deletionDate; /** *

* The time at which the imported key material expires. When the key * material expires, KMS deletes the key material and the KMS key becomes * unusable. This value is present only for KMS keys whose * Origin is EXTERNAL and whose * ExpirationModel is KEY_MATERIAL_EXPIRES, * otherwise this value is omitted. *

*/ private java.util.Date validTo; /** *

* The source of the key material for the KMS key. When this value is * AWS_KMS, KMS created the key material. When this value is * EXTERNAL, the key material was imported or the KMS key * doesn't have any key material. When this value is * AWS_CLOUDHSM, the key material was created in the CloudHSM * cluster associated with a custom key store. *

*

* Constraints:
* Allowed Values: AWS_KMS, EXTERNAL, AWS_CLOUDHSM, * EXTERNAL_KEY_STORE */ private String origin; /** *

* A unique identifier for the custom key store that contains the KMS key. This field is present * only when the KMS key is created in a custom key store. *

*

* Constraints:
* Length: 1 - 64
*/ private String customKeyStoreId; /** *

* The cluster ID of the CloudHSM cluster that contains the key material for * the KMS key. When you create a KMS key in an CloudHSM custom key store, KMS creates the key material for the KMS key in * the associated CloudHSM cluster. This field is present only when the KMS * key is created in an CloudHSM key store. *

*

* Constraints:
* Length: 19 - 24
* Pattern: cluster-[2-7a-zA-Z]{11,16}
*/ private String cloudHsmClusterId; /** *

* Specifies whether the KMS key's key material expires. This value is * present only when Origin is EXTERNAL, otherwise * this value is omitted. *

*

* Constraints:
* Allowed Values: KEY_MATERIAL_EXPIRES, KEY_MATERIAL_DOES_NOT_EXPIRE */ private String expirationModel; /** *

* The manager of the KMS key. KMS keys in your Amazon Web Services account * are either customer managed or Amazon Web Services managed. For more * information about the difference, see KMS keys in the Key Management Service Developer Guide. *

*

* Constraints:
* Allowed Values: AWS, CUSTOMER */ private String keyManager; /** *

* Instead, use the KeySpec field. *

*

* 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; /** *

* Describes the type of key material in the KMS key. *

*

* 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 encryption algorithms that the KMS key supports. You cannot use the * KMS key with other encryption algorithms within KMS. *

*

* This value is present only when the KeyUsage of the KMS key * is ENCRYPT_DECRYPT. *

*/ private java.util.List encryptionAlgorithms = new java.util.ArrayList(); /** *

* The signing algorithms that the KMS key supports. You cannot use the KMS * key with other signing algorithms within KMS. *

*

* This field appears only when the KeyUsage of the KMS key is * SIGN_VERIFY. *

*/ private java.util.List signingAlgorithms = new java.util.ArrayList(); /** *

* Indicates whether the KMS key is a multi-Region (True) or * regional (False) key. This value is True for * multi-Region primary and replica keys and False for regional * KMS keys. *

*

* For more information about multi-Region keys, see Multi-Region keys in KMS in the Key Management Service Developer * Guide. *

*/ private Boolean multiRegion; /** *

* Lists the primary and replica keys in same multi-Region key. This field * is present only when the value of the MultiRegion field is * True. *

*

* For more information about any listed KMS key, use the DescribeKey * operation. *

*
    *
  • *

    * MultiRegionKeyType indicates whether the KMS key is a * PRIMARY or REPLICA key. *

    *
  • *
  • *

    * PrimaryKey displays the key ARN and Region of the primary * key. This field displays the current KMS key if it is the primary key. *

    *
  • *
  • *

    * ReplicaKeys displays the key ARNs and Regions of all replica * keys. This field includes the current KMS key if it is a replica key. *

    *
  • *
*/ private MultiRegionConfiguration multiRegionConfiguration; /** *

* The waiting period before the primary key in a multi-Region key is * deleted. This waiting period begins when the last of its replica keys is * deleted. This value is present only when the KeyState of the * KMS key is PendingReplicaDeletion. That indicates that the * KMS key is the primary key in a multi-Region key, it is scheduled for * deletion, and it still has existing replica keys. *

*

* When a single-Region KMS key or a multi-Region replica key is scheduled * for deletion, its deletion date is displayed in the * DeletionDate field. However, when the primary key in a * multi-Region key is scheduled for deletion, its waiting period doesn't * begin until all of its replica keys are deleted. This value displays that * waiting period. When the last replica key in the multi-Region key is * deleted, the KeyState of the scheduled primary key changes * from PendingReplicaDeletion to PendingDeletion * and the deletion date appears in the DeletionDate field. *

*

* Constraints:
* Range: 1 - 365
*/ private Integer pendingDeletionWindowInDays; /** *

* The message authentication code (MAC) algorithm that the HMAC KMS key * supports. *

*

* This value is present only when the KeyUsage of the KMS key * is GENERATE_VERIFY_MAC. *

*/ private java.util.List macAlgorithms = new java.util.ArrayList(); /** *

* Information about the external key that is associated with a KMS key in * an external key store. *

*

* For more information, see External key in the Key Management Service Developer Guide. *

*/ private XksKeyConfigurationType xksKeyConfiguration; /** *

* The twelve-digit account ID of the Amazon Web Services account that owns * the KMS key. *

* * @return

* The twelve-digit account ID of the Amazon Web Services account * that owns the KMS key. *

*/ public String getAWSAccountId() { return aWSAccountId; } /** *

* The twelve-digit account ID of the Amazon Web Services account that owns * the KMS key. *

* * @param aWSAccountId

* The twelve-digit account ID of the Amazon Web Services account * that owns the KMS key. *

*/ public void setAWSAccountId(String aWSAccountId) { this.aWSAccountId = aWSAccountId; } /** *

* The twelve-digit account ID of the Amazon Web Services account that owns * the KMS key. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param aWSAccountId

* The twelve-digit account ID of the Amazon Web Services account * that owns the KMS key. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withAWSAccountId(String aWSAccountId) { this.aWSAccountId = aWSAccountId; return this; } /** *

* The globally unique identifier for the KMS key. *

*

* Constraints:
* Length: 1 - 2048
* * @return

* The globally unique identifier for the KMS key. *

*/ public String getKeyId() { return keyId; } /** *

* The globally unique identifier for the KMS key. *

*

* Constraints:
* Length: 1 - 2048
* * @param keyId

* The globally unique identifier for the KMS key. *

*/ public void setKeyId(String keyId) { this.keyId = keyId; } /** *

* The globally unique identifier for the KMS key. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 2048
* * @param keyId

* The globally unique identifier for the KMS key. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withKeyId(String keyId) { this.keyId = keyId; return this; } /** *

* The Amazon Resource Name (ARN) of the KMS key. For examples, see Key Management Service (KMS) in the Example ARNs section of the * Amazon Web Services General Reference. *

*

* Constraints:
* Length: 20 - 2048
* * @return

* The Amazon Resource Name (ARN) of the KMS key. For examples, see * Key Management Service (KMS) in the Example ARNs section of * the Amazon Web Services General Reference. *

*/ public String getArn() { return arn; } /** *

* The Amazon Resource Name (ARN) of the KMS key. For examples, see Key Management Service (KMS) in the Example ARNs section of the * Amazon Web Services General Reference. *

*

* Constraints:
* Length: 20 - 2048
* * @param arn

* The Amazon Resource Name (ARN) of the KMS key. For examples, * see Key Management Service (KMS) in the Example ARNs section * of the Amazon Web Services General Reference. *

*/ public void setArn(String arn) { this.arn = arn; } /** *

* The Amazon Resource Name (ARN) of the KMS key. For examples, see Key Management Service (KMS) in the Example ARNs section of the * Amazon Web Services General Reference. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 20 - 2048
* * @param arn

* The Amazon Resource Name (ARN) of the KMS key. For examples, * see Key Management Service (KMS) in the Example ARNs section * of the Amazon Web Services General Reference. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withArn(String arn) { this.arn = arn; return this; } /** *

* The date and time when the KMS key was created. *

* * @return

* The date and time when the KMS key was created. *

*/ public java.util.Date getCreationDate() { return creationDate; } /** *

* The date and time when the KMS key was created. *

* * @param creationDate

* The date and time when the KMS key was created. *

*/ public void setCreationDate(java.util.Date creationDate) { this.creationDate = creationDate; } /** *

* The date and time when the KMS key was created. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param creationDate

* The date and time when the KMS key was created. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withCreationDate(java.util.Date creationDate) { this.creationDate = creationDate; return this; } /** *

* Specifies whether the KMS key is enabled. When KeyState is * Enabled this value is true, otherwise it is false. *

* * @return

* Specifies whether the KMS key is enabled. When * KeyState is Enabled this value is true, * otherwise it is false. *

*/ public Boolean isEnabled() { return enabled; } /** *

* Specifies whether the KMS key is enabled. When KeyState is * Enabled this value is true, otherwise it is false. *

* * @return

* Specifies whether the KMS key is enabled. When * KeyState is Enabled this value is true, * otherwise it is false. *

*/ public Boolean getEnabled() { return enabled; } /** *

* Specifies whether the KMS key is enabled. When KeyState is * Enabled this value is true, otherwise it is false. *

* * @param enabled

* Specifies whether the KMS key is enabled. When * KeyState is Enabled this value is * true, otherwise it is false. *

*/ public void setEnabled(Boolean enabled) { this.enabled = enabled; } /** *

* Specifies whether the KMS key is enabled. When KeyState is * Enabled this value is true, otherwise it is false. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param enabled

* Specifies whether the KMS key is enabled. When * KeyState is Enabled this value is * true, otherwise it is false. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withEnabled(Boolean enabled) { this.enabled = enabled; return this; } /** *

* The description of the KMS key. *

*

* Constraints:
* Length: 0 - 8192
* * @return

* The description of the KMS key. *

*/ public String getDescription() { return description; } /** *

* The description of the KMS key. *

*

* Constraints:
* Length: 0 - 8192
* * @param description

* The description of the KMS key. *

*/ public void setDescription(String description) { this.description = description; } /** *

* The description of the KMS key. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 0 - 8192
* * @param description

* The description of the KMS key. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withDescription(String description) { this.description = description; return this; } /** *

* The cryptographic operations for which you can use the KMS key. *

*

* Constraints:
* Allowed Values: SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC * * @return

* The cryptographic operations for which you can use the KMS key. *

* @see KeyUsageType */ public String getKeyUsage() { return keyUsage; } /** *

* The cryptographic operations for which you can use the KMS key. *

*

* Constraints:
* Allowed Values: SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC * * @param keyUsage

* The cryptographic operations for which you can use the KMS * key. *

* @see KeyUsageType */ public void setKeyUsage(String keyUsage) { this.keyUsage = keyUsage; } /** *

* The cryptographic operations for which you can use the KMS key. *

*

* 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 cryptographic operations for which you can use the KMS * key. *

* @return A reference to this updated object so that method calls can be * chained together. * @see KeyUsageType */ public KeyMetadata withKeyUsage(String keyUsage) { this.keyUsage = keyUsage; return this; } /** *

* The cryptographic operations for which you can use the KMS key. *

*

* Constraints:
* Allowed Values: SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC * * @param keyUsage

* The cryptographic operations for which you can use the KMS * key. *

* @see KeyUsageType */ public void setKeyUsage(KeyUsageType keyUsage) { this.keyUsage = keyUsage.toString(); } /** *

* The cryptographic operations for which you can use the KMS key. *

*

* 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 cryptographic operations for which you can use the KMS * key. *

* @return A reference to this updated object so that method calls can be * chained together. * @see KeyUsageType */ public KeyMetadata withKeyUsage(KeyUsageType keyUsage) { this.keyUsage = keyUsage.toString(); return this; } /** *

* The current status of the KMS key. *

*

* For more information about how key state affects the use of a KMS key, * see Key states of KMS keys in the Key Management Service Developer * Guide. *

*

* Constraints:
* Allowed Values: Creating, Enabled, Disabled, PendingDeletion, * PendingImport, PendingReplicaDeletion, Unavailable, Updating * * @return

* The current status of the KMS key. *

*

* For more information about how key state affects the use of a KMS * key, see Key states of KMS keys in the Key Management Service * Developer Guide. *

* @see KeyState */ public String getKeyState() { return keyState; } /** *

* The current status of the KMS key. *

*

* For more information about how key state affects the use of a KMS key, * see Key states of KMS keys in the Key Management Service Developer * Guide. *

*

* Constraints:
* Allowed Values: Creating, Enabled, Disabled, PendingDeletion, * PendingImport, PendingReplicaDeletion, Unavailable, Updating * * @param keyState

* The current status of the KMS key. *

*

* For more information about how key state affects the use of a * KMS key, see Key states of KMS keys in the Key Management Service * Developer Guide. *

* @see KeyState */ public void setKeyState(String keyState) { this.keyState = keyState; } /** *

* The current status of the KMS key. *

*

* For more information about how key state affects the use of a KMS key, * see Key states of KMS keys in the Key Management Service Developer * Guide. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: Creating, Enabled, Disabled, PendingDeletion, * PendingImport, PendingReplicaDeletion, Unavailable, Updating * * @param keyState

* The current status of the KMS key. *

*

* For more information about how key state affects the use of a * KMS key, see Key states of KMS keys in the Key Management Service * Developer Guide. *

* @return A reference to this updated object so that method calls can be * chained together. * @see KeyState */ public KeyMetadata withKeyState(String keyState) { this.keyState = keyState; return this; } /** *

* The current status of the KMS key. *

*

* For more information about how key state affects the use of a KMS key, * see Key states of KMS keys in the Key Management Service Developer * Guide. *

*

* Constraints:
* Allowed Values: Creating, Enabled, Disabled, PendingDeletion, * PendingImport, PendingReplicaDeletion, Unavailable, Updating * * @param keyState

* The current status of the KMS key. *

*

* For more information about how key state affects the use of a * KMS key, see Key states of KMS keys in the Key Management Service * Developer Guide. *

* @see KeyState */ public void setKeyState(KeyState keyState) { this.keyState = keyState.toString(); } /** *

* The current status of the KMS key. *

*

* For more information about how key state affects the use of a KMS key, * see Key states of KMS keys in the Key Management Service Developer * Guide. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: Creating, Enabled, Disabled, PendingDeletion, * PendingImport, PendingReplicaDeletion, Unavailable, Updating * * @param keyState

* The current status of the KMS key. *

*

* For more information about how key state affects the use of a * KMS key, see Key states of KMS keys in the Key Management Service * Developer Guide. *

* @return A reference to this updated object so that method calls can be * chained together. * @see KeyState */ public KeyMetadata withKeyState(KeyState keyState) { this.keyState = keyState.toString(); return this; } /** *

* The date and time after which KMS deletes this KMS key. This value is * present only when the KMS key is scheduled for deletion, that is, when * its KeyState is PendingDeletion. *

*

* When the primary key in a multi-Region key is scheduled for deletion but * still has replica keys, its key state is * PendingReplicaDeletion and the length of its waiting period * is displayed in the PendingDeletionWindowInDays field. *

* * @return

* The date and time after which KMS deletes this KMS key. This * value is present only when the KMS key is scheduled for deletion, * that is, when its KeyState is * PendingDeletion. *

*

* When the primary key in a multi-Region key is scheduled for * deletion but still has replica keys, its key state is * PendingReplicaDeletion and the length of its waiting * period is displayed in the * PendingDeletionWindowInDays field. *

*/ public java.util.Date getDeletionDate() { return deletionDate; } /** *

* The date and time after which KMS deletes this KMS key. This value is * present only when the KMS key is scheduled for deletion, that is, when * its KeyState is PendingDeletion. *

*

* When the primary key in a multi-Region key is scheduled for deletion but * still has replica keys, its key state is * PendingReplicaDeletion and the length of its waiting period * is displayed in the PendingDeletionWindowInDays field. *

* * @param deletionDate

* The date and time after which KMS deletes this KMS key. This * value is present only when the KMS key is scheduled for * deletion, that is, when its KeyState is * PendingDeletion. *

*

* When the primary key in a multi-Region key is scheduled for * deletion but still has replica keys, its key state is * PendingReplicaDeletion and the length of its * waiting period is displayed in the * PendingDeletionWindowInDays field. *

*/ public void setDeletionDate(java.util.Date deletionDate) { this.deletionDate = deletionDate; } /** *

* The date and time after which KMS deletes this KMS key. This value is * present only when the KMS key is scheduled for deletion, that is, when * its KeyState is PendingDeletion. *

*

* When the primary key in a multi-Region key is scheduled for deletion but * still has replica keys, its key state is * PendingReplicaDeletion and the length of its waiting period * is displayed in the PendingDeletionWindowInDays field. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param deletionDate

* The date and time after which KMS deletes this KMS key. This * value is present only when the KMS key is scheduled for * deletion, that is, when its KeyState is * PendingDeletion. *

*

* When the primary key in a multi-Region key is scheduled for * deletion but still has replica keys, its key state is * PendingReplicaDeletion and the length of its * waiting period is displayed in the * PendingDeletionWindowInDays field. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withDeletionDate(java.util.Date deletionDate) { this.deletionDate = deletionDate; return this; } /** *

* The time at which the imported key material expires. When the key * material expires, KMS deletes the key material and the KMS key becomes * unusable. This value is present only for KMS keys whose * Origin is EXTERNAL and whose * ExpirationModel is KEY_MATERIAL_EXPIRES, * otherwise this value is omitted. *

* * @return

* The time at which the imported key material expires. When the key * material expires, KMS deletes the key material and the KMS key * becomes unusable. This value is present only for KMS keys whose * Origin is EXTERNAL and whose * ExpirationModel is KEY_MATERIAL_EXPIRES * , otherwise this value is omitted. *

*/ public java.util.Date getValidTo() { return validTo; } /** *

* The time at which the imported key material expires. When the key * material expires, KMS deletes the key material and the KMS key becomes * unusable. This value is present only for KMS keys whose * Origin is EXTERNAL and whose * ExpirationModel is KEY_MATERIAL_EXPIRES, * otherwise this value is omitted. *

* * @param validTo

* The time at which the imported key material expires. When the * key material expires, KMS deletes the key material and the KMS * key becomes unusable. This value is present only for KMS keys * whose Origin is EXTERNAL and whose * ExpirationModel is * KEY_MATERIAL_EXPIRES, otherwise this value is * omitted. *

*/ public void setValidTo(java.util.Date validTo) { this.validTo = validTo; } /** *

* The time at which the imported key material expires. When the key * material expires, KMS deletes the key material and the KMS key becomes * unusable. This value is present only for KMS keys whose * Origin is EXTERNAL and whose * ExpirationModel is KEY_MATERIAL_EXPIRES, * otherwise this value is omitted. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param validTo

* The time at which the imported key material expires. When the * key material expires, KMS deletes the key material and the KMS * key becomes unusable. This value is present only for KMS keys * whose Origin is EXTERNAL and whose * ExpirationModel is * KEY_MATERIAL_EXPIRES, otherwise this value is * omitted. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withValidTo(java.util.Date validTo) { this.validTo = validTo; return this; } /** *

* The source of the key material for the KMS key. When this value is * AWS_KMS, KMS created the key material. When this value is * EXTERNAL, the key material was imported or the KMS key * doesn't have any key material. When this value is * AWS_CLOUDHSM, the key material was created in the CloudHSM * cluster associated with a custom key store. *

*

* Constraints:
* Allowed Values: AWS_KMS, EXTERNAL, AWS_CLOUDHSM, * EXTERNAL_KEY_STORE * * @return

* The source of the key material for the KMS key. When this value * is AWS_KMS, KMS created the key material. When this * value is EXTERNAL, the key material was imported or * the KMS key doesn't have any key material. When this value is * AWS_CLOUDHSM, the key material was created in the * CloudHSM cluster associated with a custom key store. *

* @see OriginType */ public String getOrigin() { return origin; } /** *

* The source of the key material for the KMS key. When this value is * AWS_KMS, KMS created the key material. When this value is * EXTERNAL, the key material was imported or the KMS key * doesn't have any key material. When this value is * AWS_CLOUDHSM, the key material was created in the CloudHSM * cluster associated with a custom key store. *

*

* Constraints:
* Allowed Values: AWS_KMS, EXTERNAL, AWS_CLOUDHSM, * EXTERNAL_KEY_STORE * * @param origin

* The source of the key material for the KMS key. When this * value is AWS_KMS, KMS created the key material. * When this value is EXTERNAL, the key material was * imported or the KMS key doesn't have any key material. When * this value is AWS_CLOUDHSM, the key material was * created in the CloudHSM cluster associated with a custom key * store. *

* @see OriginType */ public void setOrigin(String origin) { this.origin = origin; } /** *

* The source of the key material for the KMS key. When this value is * AWS_KMS, KMS created the key material. When this value is * EXTERNAL, the key material was imported or the KMS key * doesn't have any key material. When this value is * AWS_CLOUDHSM, the key material was created in the CloudHSM * cluster associated with a custom key store. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: AWS_KMS, EXTERNAL, AWS_CLOUDHSM, * EXTERNAL_KEY_STORE * * @param origin

* The source of the key material for the KMS key. When this * value is AWS_KMS, KMS created the key material. * When this value is EXTERNAL, the key material was * imported or the KMS key doesn't have any key material. When * this value is AWS_CLOUDHSM, the key material was * created in the CloudHSM cluster associated with a custom key * store. *

* @return A reference to this updated object so that method calls can be * chained together. * @see OriginType */ public KeyMetadata withOrigin(String origin) { this.origin = origin; return this; } /** *

* The source of the key material for the KMS key. When this value is * AWS_KMS, KMS created the key material. When this value is * EXTERNAL, the key material was imported or the KMS key * doesn't have any key material. When this value is * AWS_CLOUDHSM, the key material was created in the CloudHSM * cluster associated with a custom key store. *

*

* Constraints:
* Allowed Values: AWS_KMS, EXTERNAL, AWS_CLOUDHSM, * EXTERNAL_KEY_STORE * * @param origin

* The source of the key material for the KMS key. When this * value is AWS_KMS, KMS created the key material. * When this value is EXTERNAL, the key material was * imported or the KMS key doesn't have any key material. When * this value is AWS_CLOUDHSM, the key material was * created in the CloudHSM cluster associated with a custom key * store. *

* @see OriginType */ public void setOrigin(OriginType origin) { this.origin = origin.toString(); } /** *

* The source of the key material for the KMS key. When this value is * AWS_KMS, KMS created the key material. When this value is * EXTERNAL, the key material was imported or the KMS key * doesn't have any key material. When this value is * AWS_CLOUDHSM, the key material was created in the CloudHSM * cluster associated with a custom key store. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: AWS_KMS, EXTERNAL, AWS_CLOUDHSM, * EXTERNAL_KEY_STORE * * @param origin

* The source of the key material for the KMS key. When this * value is AWS_KMS, KMS created the key material. * When this value is EXTERNAL, the key material was * imported or the KMS key doesn't have any key material. When * this value is AWS_CLOUDHSM, the key material was * created in the CloudHSM cluster associated with a custom key * store. *

* @return A reference to this updated object so that method calls can be * chained together. * @see OriginType */ public KeyMetadata withOrigin(OriginType origin) { this.origin = origin.toString(); return this; } /** *

* A unique identifier for the custom key store that contains the KMS key. This field is present * only when the KMS key is created in a custom key store. *

*

* Constraints:
* Length: 1 - 64
* * @return

* A unique identifier for the custom key store that contains the KMS key. This field is * present only when the KMS key is created in a custom key store. *

*/ public String getCustomKeyStoreId() { return customKeyStoreId; } /** *

* A unique identifier for the custom key store that contains the KMS key. This field is present * only when the KMS key is created in a custom key store. *

*

* Constraints:
* Length: 1 - 64
* * @param customKeyStoreId

* A unique identifier for the custom key store that contains the KMS key. This field is * present only when the KMS key is created in a custom key * store. *

*/ public void setCustomKeyStoreId(String customKeyStoreId) { this.customKeyStoreId = customKeyStoreId; } /** *

* A unique identifier for the custom key store that contains the KMS key. This field is present * only when the KMS key is created in a custom key store. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 64
* * @param customKeyStoreId

* A unique identifier for the custom key store that contains the KMS key. This field is * present only when the KMS key is created in a custom key * store. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withCustomKeyStoreId(String customKeyStoreId) { this.customKeyStoreId = customKeyStoreId; return this; } /** *

* The cluster ID of the CloudHSM cluster that contains the key material for * the KMS key. When you create a KMS key in an CloudHSM custom key store, KMS creates the key material for the KMS key in * the associated CloudHSM cluster. This field is present only when the KMS * key is created in an CloudHSM key store. *

*

* Constraints:
* Length: 19 - 24
* Pattern: cluster-[2-7a-zA-Z]{11,16}
* * @return

* The cluster ID of the CloudHSM cluster that contains the key * material for the KMS key. When you create a KMS key in an * CloudHSM custom key store, KMS creates the key material for the KMS * key in the associated CloudHSM cluster. This field is present * only when the KMS key is created in an CloudHSM key store. *

*/ public String getCloudHsmClusterId() { return cloudHsmClusterId; } /** *

* The cluster ID of the CloudHSM cluster that contains the key material for * the KMS key. When you create a KMS key in an CloudHSM custom key store, KMS creates the key material for the KMS key in * the associated CloudHSM cluster. This field is present only when the KMS * key is created in an CloudHSM key store. *

*

* Constraints:
* Length: 19 - 24
* Pattern: cluster-[2-7a-zA-Z]{11,16}
* * @param cloudHsmClusterId

* The cluster ID of the CloudHSM cluster that contains the key * material for the KMS key. When you create a KMS key in an * CloudHSM custom key store, KMS creates the key material for the * KMS key in the associated CloudHSM cluster. This field is * present only when the KMS key is created in an CloudHSM key * store. *

*/ public void setCloudHsmClusterId(String cloudHsmClusterId) { this.cloudHsmClusterId = cloudHsmClusterId; } /** *

* The cluster ID of the CloudHSM cluster that contains the key material for * the KMS key. When you create a KMS key in an CloudHSM custom key store, KMS creates the key material for the KMS key in * the associated CloudHSM cluster. This field is present only when the KMS * key is created in an CloudHSM key store. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 19 - 24
* Pattern: cluster-[2-7a-zA-Z]{11,16}
* * @param cloudHsmClusterId

* The cluster ID of the CloudHSM cluster that contains the key * material for the KMS key. When you create a KMS key in an * CloudHSM custom key store, KMS creates the key material for the * KMS key in the associated CloudHSM cluster. This field is * present only when the KMS key is created in an CloudHSM key * store. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withCloudHsmClusterId(String cloudHsmClusterId) { this.cloudHsmClusterId = cloudHsmClusterId; return this; } /** *

* Specifies whether the KMS key's key material expires. This value is * present only when Origin is EXTERNAL, otherwise * this value is omitted. *

*

* Constraints:
* Allowed Values: KEY_MATERIAL_EXPIRES, KEY_MATERIAL_DOES_NOT_EXPIRE * * @return

* Specifies whether the KMS key's key material expires. This value * is present only when Origin is EXTERNAL * , otherwise this value is omitted. *

* @see ExpirationModelType */ public String getExpirationModel() { return expirationModel; } /** *

* Specifies whether the KMS key's key material expires. This value is * present only when Origin is EXTERNAL, otherwise * this value is omitted. *

*

* Constraints:
* Allowed Values: KEY_MATERIAL_EXPIRES, KEY_MATERIAL_DOES_NOT_EXPIRE * * @param expirationModel

* Specifies whether the KMS key's key material expires. This * value is present only when Origin is * EXTERNAL, otherwise this value is omitted. *

* @see ExpirationModelType */ public void setExpirationModel(String expirationModel) { this.expirationModel = expirationModel; } /** *

* Specifies whether the KMS key's key material expires. This value is * present only when Origin is EXTERNAL, otherwise * this value is omitted. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: KEY_MATERIAL_EXPIRES, KEY_MATERIAL_DOES_NOT_EXPIRE * * @param expirationModel

* Specifies whether the KMS key's key material expires. This * value is present only when Origin is * EXTERNAL, otherwise this value is omitted. *

* @return A reference to this updated object so that method calls can be * chained together. * @see ExpirationModelType */ public KeyMetadata withExpirationModel(String expirationModel) { this.expirationModel = expirationModel; return this; } /** *

* Specifies whether the KMS key's key material expires. This value is * present only when Origin is EXTERNAL, otherwise * this value is omitted. *

*

* Constraints:
* Allowed Values: KEY_MATERIAL_EXPIRES, KEY_MATERIAL_DOES_NOT_EXPIRE * * @param expirationModel

* Specifies whether the KMS key's key material expires. This * value is present only when Origin is * EXTERNAL, otherwise this value is omitted. *

* @see ExpirationModelType */ public void setExpirationModel(ExpirationModelType expirationModel) { this.expirationModel = expirationModel.toString(); } /** *

* Specifies whether the KMS key's key material expires. This value is * present only when Origin is EXTERNAL, otherwise * this value is omitted. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: KEY_MATERIAL_EXPIRES, KEY_MATERIAL_DOES_NOT_EXPIRE * * @param expirationModel

* Specifies whether the KMS key's key material expires. This * value is present only when Origin is * EXTERNAL, otherwise this value is omitted. *

* @return A reference to this updated object so that method calls can be * chained together. * @see ExpirationModelType */ public KeyMetadata withExpirationModel(ExpirationModelType expirationModel) { this.expirationModel = expirationModel.toString(); return this; } /** *

* The manager of the KMS key. KMS keys in your Amazon Web Services account * are either customer managed or Amazon Web Services managed. For more * information about the difference, see KMS keys in the Key Management Service Developer Guide. *

*

* Constraints:
* Allowed Values: AWS, CUSTOMER * * @return

* The manager of the KMS key. KMS keys in your Amazon Web Services * account are either customer managed or Amazon Web Services * managed. For more information about the difference, see KMS keys in the Key Management Service Developer * Guide. *

* @see KeyManagerType */ public String getKeyManager() { return keyManager; } /** *

* The manager of the KMS key. KMS keys in your Amazon Web Services account * are either customer managed or Amazon Web Services managed. For more * information about the difference, see KMS keys in the Key Management Service Developer Guide. *

*

* Constraints:
* Allowed Values: AWS, CUSTOMER * * @param keyManager

* The manager of the KMS key. KMS keys in your Amazon Web * Services account are either customer managed or Amazon Web * Services managed. For more information about the difference, * see KMS keys in the Key Management Service Developer * Guide. *

* @see KeyManagerType */ public void setKeyManager(String keyManager) { this.keyManager = keyManager; } /** *

* The manager of the KMS key. KMS keys in your Amazon Web Services account * are either customer managed or Amazon Web Services managed. For more * information about the difference, see KMS keys in the Key Management Service Developer Guide. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: AWS, CUSTOMER * * @param keyManager

* The manager of the KMS key. KMS keys in your Amazon Web * Services account are either customer managed or Amazon Web * Services managed. For more information about the difference, * see KMS keys in the Key Management Service Developer * Guide. *

* @return A reference to this updated object so that method calls can be * chained together. * @see KeyManagerType */ public KeyMetadata withKeyManager(String keyManager) { this.keyManager = keyManager; return this; } /** *

* The manager of the KMS key. KMS keys in your Amazon Web Services account * are either customer managed or Amazon Web Services managed. For more * information about the difference, see KMS keys in the Key Management Service Developer Guide. *

*

* Constraints:
* Allowed Values: AWS, CUSTOMER * * @param keyManager

* The manager of the KMS key. KMS keys in your Amazon Web * Services account are either customer managed or Amazon Web * Services managed. For more information about the difference, * see KMS keys in the Key Management Service Developer * Guide. *

* @see KeyManagerType */ public void setKeyManager(KeyManagerType keyManager) { this.keyManager = keyManager.toString(); } /** *

* The manager of the KMS key. KMS keys in your Amazon Web Services account * are either customer managed or Amazon Web Services managed. For more * information about the difference, see KMS keys in the Key Management Service Developer Guide. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: AWS, CUSTOMER * * @param keyManager

* The manager of the KMS key. KMS keys in your Amazon Web * Services account are either customer managed or Amazon Web * Services managed. For more information about the difference, * see KMS keys in the Key Management Service Developer * Guide. *

* @return A reference to this updated object so that method calls can be * chained together. * @see KeyManagerType */ public KeyMetadata withKeyManager(KeyManagerType keyManager) { this.keyManager = keyManager.toString(); return this; } /** *

* Instead, use the KeySpec field. *

*

* 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. *

*

* 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. *

* @see CustomerMasterKeySpec */ public String getCustomerMasterKeySpec() { return customerMasterKeySpec; } /** *

* Instead, use the KeySpec field. *

*

* 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. *

*

* 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. *

* @see CustomerMasterKeySpec */ public void setCustomerMasterKeySpec(String customerMasterKeySpec) { this.customerMasterKeySpec = customerMasterKeySpec; } /** *

* Instead, use the KeySpec field. *

*

* 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. *

*

* 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. *

* @return A reference to this updated object so that method calls can be * chained together. * @see CustomerMasterKeySpec */ public KeyMetadata withCustomerMasterKeySpec(String customerMasterKeySpec) { this.customerMasterKeySpec = customerMasterKeySpec; return this; } /** *

* Instead, use the KeySpec field. *

*

* 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. *

*

* 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. *

* @see CustomerMasterKeySpec */ public void setCustomerMasterKeySpec(CustomerMasterKeySpec customerMasterKeySpec) { this.customerMasterKeySpec = customerMasterKeySpec.toString(); } /** *

* Instead, use the KeySpec field. *

*

* 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. *

*

* 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. *

* @return A reference to this updated object so that method calls can be * chained together. * @see CustomerMasterKeySpec */ public KeyMetadata withCustomerMasterKeySpec(CustomerMasterKeySpec customerMasterKeySpec) { this.customerMasterKeySpec = customerMasterKeySpec.toString(); return this; } /** *

* Describes the type of key material in the KMS key. *

*

* 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

* Describes the type of key material in the KMS key. *

* @see KeySpec */ public String getKeySpec() { return keySpec; } /** *

* Describes the type of key material in the KMS key. *

*

* 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

* Describes the type of key material in the KMS key. *

* @see KeySpec */ public void setKeySpec(String keySpec) { this.keySpec = keySpec; } /** *

* Describes the type of key material in the KMS key. *

*

* 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

* Describes the type of key material in the KMS key. *

* @return A reference to this updated object so that method calls can be * chained together. * @see KeySpec */ public KeyMetadata withKeySpec(String keySpec) { this.keySpec = keySpec; return this; } /** *

* Describes the type of key material in the KMS key. *

*

* 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

* Describes the type of key material in the KMS key. *

* @see KeySpec */ public void setKeySpec(KeySpec keySpec) { this.keySpec = keySpec.toString(); } /** *

* Describes the type of key material in the KMS key. *

*

* 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

* Describes the type of key material in the KMS key. *

* @return A reference to this updated object so that method calls can be * chained together. * @see KeySpec */ public KeyMetadata withKeySpec(KeySpec keySpec) { this.keySpec = keySpec.toString(); return this; } /** *

* The encryption algorithms that the KMS key supports. You cannot use the * KMS key with other encryption algorithms within KMS. *

*

* This value is present only when the KeyUsage of the KMS key * is ENCRYPT_DECRYPT. *

* * @return

* The encryption algorithms that the KMS key supports. You cannot * use the KMS key with other encryption algorithms within KMS. *

*

* This value is present only when the KeyUsage of the * KMS key is ENCRYPT_DECRYPT. *

*/ public java.util.List getEncryptionAlgorithms() { return encryptionAlgorithms; } /** *

* The encryption algorithms that the KMS key supports. You cannot use the * KMS key with other encryption algorithms within KMS. *

*

* This value is present only when the KeyUsage of the KMS key * is ENCRYPT_DECRYPT. *

* * @param encryptionAlgorithms

* The encryption algorithms that the KMS key supports. You * cannot use the KMS key with other encryption algorithms within * KMS. *

*

* This value is present only when the KeyUsage of * the KMS key is ENCRYPT_DECRYPT. *

*/ public void setEncryptionAlgorithms(java.util.Collection encryptionAlgorithms) { if (encryptionAlgorithms == null) { this.encryptionAlgorithms = null; return; } this.encryptionAlgorithms = new java.util.ArrayList(encryptionAlgorithms); } /** *

* The encryption algorithms that the KMS key supports. You cannot use the * KMS key with other encryption algorithms within KMS. *

*

* This value is present only when the KeyUsage of the KMS key * is ENCRYPT_DECRYPT. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param encryptionAlgorithms

* The encryption algorithms that the KMS key supports. You * cannot use the KMS key with other encryption algorithms within * KMS. *

*

* This value is present only when the KeyUsage of * the KMS key is ENCRYPT_DECRYPT. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withEncryptionAlgorithms(String... encryptionAlgorithms) { if (getEncryptionAlgorithms() == null) { this.encryptionAlgorithms = new java.util.ArrayList(encryptionAlgorithms.length); } for (String value : encryptionAlgorithms) { this.encryptionAlgorithms.add(value); } return this; } /** *

* The encryption algorithms that the KMS key supports. You cannot use the * KMS key with other encryption algorithms within KMS. *

*

* This value is present only when the KeyUsage of the KMS key * is ENCRYPT_DECRYPT. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param encryptionAlgorithms

* The encryption algorithms that the KMS key supports. You * cannot use the KMS key with other encryption algorithms within * KMS. *

*

* This value is present only when the KeyUsage of * the KMS key is ENCRYPT_DECRYPT. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withEncryptionAlgorithms(java.util.Collection encryptionAlgorithms) { setEncryptionAlgorithms(encryptionAlgorithms); return this; } /** *

* The signing algorithms that the KMS key supports. You cannot use the KMS * key with other signing algorithms within KMS. *

*

* This field appears only when the KeyUsage of the KMS key is * SIGN_VERIFY. *

* * @return

* The signing algorithms that the KMS key supports. You cannot use * the KMS key with other signing algorithms within KMS. *

*

* This field appears only when the KeyUsage of the KMS * key is SIGN_VERIFY. *

*/ public java.util.List getSigningAlgorithms() { return signingAlgorithms; } /** *

* The signing algorithms that the KMS key supports. You cannot use the KMS * key with other signing algorithms within KMS. *

*

* This field appears only when the KeyUsage of the KMS key is * SIGN_VERIFY. *

* * @param signingAlgorithms

* The signing algorithms that the KMS key supports. You cannot * use the KMS key with other signing algorithms within KMS. *

*

* This field appears only when the KeyUsage of the * KMS key is SIGN_VERIFY. *

*/ public void setSigningAlgorithms(java.util.Collection signingAlgorithms) { if (signingAlgorithms == null) { this.signingAlgorithms = null; return; } this.signingAlgorithms = new java.util.ArrayList(signingAlgorithms); } /** *

* The signing algorithms that the KMS key supports. You cannot use the KMS * key with other signing algorithms within KMS. *

*

* This field appears only when the KeyUsage of the KMS key is * SIGN_VERIFY. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param signingAlgorithms

* The signing algorithms that the KMS key supports. You cannot * use the KMS key with other signing algorithms within KMS. *

*

* This field appears only when the KeyUsage of the * KMS key is SIGN_VERIFY. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withSigningAlgorithms(String... signingAlgorithms) { if (getSigningAlgorithms() == null) { this.signingAlgorithms = new java.util.ArrayList(signingAlgorithms.length); } for (String value : signingAlgorithms) { this.signingAlgorithms.add(value); } return this; } /** *

* The signing algorithms that the KMS key supports. You cannot use the KMS * key with other signing algorithms within KMS. *

*

* This field appears only when the KeyUsage of the KMS key is * SIGN_VERIFY. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param signingAlgorithms

* The signing algorithms that the KMS key supports. You cannot * use the KMS key with other signing algorithms within KMS. *

*

* This field appears only when the KeyUsage of the * KMS key is SIGN_VERIFY. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withSigningAlgorithms(java.util.Collection signingAlgorithms) { setSigningAlgorithms(signingAlgorithms); return this; } /** *

* Indicates whether the KMS key is a multi-Region (True) or * regional (False) key. This value is True for * multi-Region primary and replica keys and False for regional * KMS keys. *

*

* For more information about multi-Region keys, see Multi-Region keys in KMS in the Key Management Service Developer * Guide. *

* * @return

* Indicates whether the KMS key is a multi-Region ( * True) or regional (False) key. This * value is True for multi-Region primary and replica * keys and False for regional KMS keys. *

*

* For more information about multi-Region keys, see Multi-Region keys in KMS in the Key Management Service * Developer Guide. *

*/ public Boolean isMultiRegion() { return multiRegion; } /** *

* Indicates whether the KMS key is a multi-Region (True) or * regional (False) key. This value is True for * multi-Region primary and replica keys and False for regional * KMS keys. *

*

* For more information about multi-Region keys, see Multi-Region keys in KMS in the Key Management Service Developer * Guide. *

* * @return

* Indicates whether the KMS key is a multi-Region ( * True) or regional (False) key. This * value is True for multi-Region primary and replica * keys and False for regional KMS keys. *

*

* For more information about multi-Region keys, see Multi-Region keys in KMS in the Key Management Service * Developer Guide. *

*/ public Boolean getMultiRegion() { return multiRegion; } /** *

* Indicates whether the KMS key is a multi-Region (True) or * regional (False) key. This value is True for * multi-Region primary and replica keys and False for regional * KMS keys. *

*

* For more information about multi-Region keys, see Multi-Region keys in KMS in the Key Management Service Developer * Guide. *

* * @param multiRegion

* Indicates whether the KMS key is a multi-Region ( * True) or regional (False) key. This * value is True for multi-Region primary and * replica keys and False for regional KMS keys. *

*

* For more information about multi-Region keys, see Multi-Region keys in KMS in the Key Management Service * Developer Guide. *

*/ public void setMultiRegion(Boolean multiRegion) { this.multiRegion = multiRegion; } /** *

* Indicates whether the KMS key is a multi-Region (True) or * regional (False) key. This value is True for * multi-Region primary and replica keys and False for regional * KMS keys. *

*

* For more information about multi-Region keys, see Multi-Region keys in KMS in the Key Management Service Developer * Guide. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param multiRegion

* Indicates whether the KMS key is a multi-Region ( * True) or regional (False) key. This * value is True for multi-Region primary and * replica keys and False for regional KMS keys. *

*

* For more information about multi-Region keys, see Multi-Region keys in KMS in the Key Management Service * Developer Guide. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withMultiRegion(Boolean multiRegion) { this.multiRegion = multiRegion; return this; } /** *

* Lists the primary and replica keys in same multi-Region key. This field * is present only when the value of the MultiRegion field is * True. *

*

* For more information about any listed KMS key, use the DescribeKey * operation. *

*
    *
  • *

    * MultiRegionKeyType indicates whether the KMS key is a * PRIMARY or REPLICA key. *

    *
  • *
  • *

    * PrimaryKey displays the key ARN and Region of the primary * key. This field displays the current KMS key if it is the primary key. *

    *
  • *
  • *

    * ReplicaKeys displays the key ARNs and Regions of all replica * keys. This field includes the current KMS key if it is a replica key. *

    *
  • *
* * @return

* Lists the primary and replica keys in same multi-Region key. This * field is present only when the value of the * MultiRegion field is True. *

*

* For more information about any listed KMS key, use the * DescribeKey operation. *

*
    *
  • *

    * MultiRegionKeyType indicates whether the KMS key is * a PRIMARY or REPLICA key. *

    *
  • *
  • *

    * PrimaryKey displays the key ARN and Region of the * primary key. This field displays the current KMS key if it is the * primary key. *

    *
  • *
  • *

    * ReplicaKeys displays the key ARNs and Regions of all * replica keys. This field includes the current KMS key if it is a * replica key. *

    *
  • *
*/ public MultiRegionConfiguration getMultiRegionConfiguration() { return multiRegionConfiguration; } /** *

* Lists the primary and replica keys in same multi-Region key. This field * is present only when the value of the MultiRegion field is * True. *

*

* For more information about any listed KMS key, use the DescribeKey * operation. *

*
    *
  • *

    * MultiRegionKeyType indicates whether the KMS key is a * PRIMARY or REPLICA key. *

    *
  • *
  • *

    * PrimaryKey displays the key ARN and Region of the primary * key. This field displays the current KMS key if it is the primary key. *

    *
  • *
  • *

    * ReplicaKeys displays the key ARNs and Regions of all replica * keys. This field includes the current KMS key if it is a replica key. *

    *
  • *
* * @param multiRegionConfiguration

* Lists the primary and replica keys in same multi-Region key. * This field is present only when the value of the * MultiRegion field is True. *

*

* For more information about any listed KMS key, use the * DescribeKey operation. *

*
    *
  • *

    * MultiRegionKeyType indicates whether the KMS key * is a PRIMARY or REPLICA key. *

    *
  • *
  • *

    * PrimaryKey displays the key ARN and Region of the * primary key. This field displays the current KMS key if it is * the primary key. *

    *
  • *
  • *

    * ReplicaKeys displays the key ARNs and Regions of * all replica keys. This field includes the current KMS key if * it is a replica key. *

    *
  • *
*/ public void setMultiRegionConfiguration(MultiRegionConfiguration multiRegionConfiguration) { this.multiRegionConfiguration = multiRegionConfiguration; } /** *

* Lists the primary and replica keys in same multi-Region key. This field * is present only when the value of the MultiRegion field is * True. *

*

* For more information about any listed KMS key, use the DescribeKey * operation. *

*
    *
  • *

    * MultiRegionKeyType indicates whether the KMS key is a * PRIMARY or REPLICA key. *

    *
  • *
  • *

    * PrimaryKey displays the key ARN and Region of the primary * key. This field displays the current KMS key if it is the primary key. *

    *
  • *
  • *

    * ReplicaKeys displays the key ARNs and Regions of all replica * keys. This field includes the current KMS key if it is a replica key. *

    *
  • *
*

* Returns a reference to this object so that method calls can be chained * together. * * @param multiRegionConfiguration

* Lists the primary and replica keys in same multi-Region key. * This field is present only when the value of the * MultiRegion field is True. *

*

* For more information about any listed KMS key, use the * DescribeKey operation. *

*
    *
  • *

    * MultiRegionKeyType indicates whether the KMS key * is a PRIMARY or REPLICA key. *

    *
  • *
  • *

    * PrimaryKey displays the key ARN and Region of the * primary key. This field displays the current KMS key if it is * the primary key. *

    *
  • *
  • *

    * ReplicaKeys displays the key ARNs and Regions of * all replica keys. This field includes the current KMS key if * it is a replica key. *

    *
  • *
* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withMultiRegionConfiguration( MultiRegionConfiguration multiRegionConfiguration) { this.multiRegionConfiguration = multiRegionConfiguration; return this; } /** *

* The waiting period before the primary key in a multi-Region key is * deleted. This waiting period begins when the last of its replica keys is * deleted. This value is present only when the KeyState of the * KMS key is PendingReplicaDeletion. That indicates that the * KMS key is the primary key in a multi-Region key, it is scheduled for * deletion, and it still has existing replica keys. *

*

* When a single-Region KMS key or a multi-Region replica key is scheduled * for deletion, its deletion date is displayed in the * DeletionDate field. However, when the primary key in a * multi-Region key is scheduled for deletion, its waiting period doesn't * begin until all of its replica keys are deleted. This value displays that * waiting period. When the last replica key in the multi-Region key is * deleted, the KeyState of the scheduled primary key changes * from PendingReplicaDeletion to PendingDeletion * and the deletion date appears in the DeletionDate field. *

*

* Constraints:
* Range: 1 - 365
* * @return

* The waiting period before the primary key in a multi-Region key * is deleted. This waiting period begins when the last of its * replica keys is deleted. This value is present only when the * KeyState of the KMS key is * PendingReplicaDeletion. That indicates that the KMS * key is the primary key in a multi-Region key, it is scheduled for * deletion, and it still has existing replica keys. *

*

* When a single-Region KMS key or a multi-Region replica key is * scheduled for deletion, its deletion date is displayed in the * DeletionDate field. However, when the primary key in * a multi-Region key is scheduled for deletion, its waiting period * doesn't begin until all of its replica keys are deleted. This * value displays that waiting period. When the last replica key in * the multi-Region key is deleted, the KeyState of the * scheduled primary key changes from * PendingReplicaDeletion to * PendingDeletion and the deletion date appears in the * DeletionDate field. *

*/ public Integer getPendingDeletionWindowInDays() { return pendingDeletionWindowInDays; } /** *

* The waiting period before the primary key in a multi-Region key is * deleted. This waiting period begins when the last of its replica keys is * deleted. This value is present only when the KeyState of the * KMS key is PendingReplicaDeletion. That indicates that the * KMS key is the primary key in a multi-Region key, it is scheduled for * deletion, and it still has existing replica keys. *

*

* When a single-Region KMS key or a multi-Region replica key is scheduled * for deletion, its deletion date is displayed in the * DeletionDate field. However, when the primary key in a * multi-Region key is scheduled for deletion, its waiting period doesn't * begin until all of its replica keys are deleted. This value displays that * waiting period. When the last replica key in the multi-Region key is * deleted, the KeyState of the scheduled primary key changes * from PendingReplicaDeletion to PendingDeletion * and the deletion date appears in the DeletionDate field. *

*

* Constraints:
* Range: 1 - 365
* * @param pendingDeletionWindowInDays

* The waiting period before the primary key in a multi-Region * key is deleted. This waiting period begins when the last of * its replica keys is deleted. This value is present only when * the KeyState of the KMS key is * PendingReplicaDeletion. That indicates that the * KMS key is the primary key in a multi-Region key, it is * scheduled for deletion, and it still has existing replica * keys. *

*

* When a single-Region KMS key or a multi-Region replica key is * scheduled for deletion, its deletion date is displayed in the * DeletionDate field. However, when the primary key * in a multi-Region key is scheduled for deletion, its waiting * period doesn't begin until all of its replica keys are * deleted. This value displays that waiting period. When the * last replica key in the multi-Region key is deleted, the * KeyState of the scheduled primary key changes * from PendingReplicaDeletion to * PendingDeletion and the deletion date appears in * the DeletionDate field. *

*/ public void setPendingDeletionWindowInDays(Integer pendingDeletionWindowInDays) { this.pendingDeletionWindowInDays = pendingDeletionWindowInDays; } /** *

* The waiting period before the primary key in a multi-Region key is * deleted. This waiting period begins when the last of its replica keys is * deleted. This value is present only when the KeyState of the * KMS key is PendingReplicaDeletion. That indicates that the * KMS key is the primary key in a multi-Region key, it is scheduled for * deletion, and it still has existing replica keys. *

*

* When a single-Region KMS key or a multi-Region replica key is scheduled * for deletion, its deletion date is displayed in the * DeletionDate field. However, when the primary key in a * multi-Region key is scheduled for deletion, its waiting period doesn't * begin until all of its replica keys are deleted. This value displays that * waiting period. When the last replica key in the multi-Region key is * deleted, the KeyState of the scheduled primary key changes * from PendingReplicaDeletion to PendingDeletion * and the deletion date appears in the DeletionDate field. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Range: 1 - 365
* * @param pendingDeletionWindowInDays

* The waiting period before the primary key in a multi-Region * key is deleted. This waiting period begins when the last of * its replica keys is deleted. This value is present only when * the KeyState of the KMS key is * PendingReplicaDeletion. That indicates that the * KMS key is the primary key in a multi-Region key, it is * scheduled for deletion, and it still has existing replica * keys. *

*

* When a single-Region KMS key or a multi-Region replica key is * scheduled for deletion, its deletion date is displayed in the * DeletionDate field. However, when the primary key * in a multi-Region key is scheduled for deletion, its waiting * period doesn't begin until all of its replica keys are * deleted. This value displays that waiting period. When the * last replica key in the multi-Region key is deleted, the * KeyState of the scheduled primary key changes * from PendingReplicaDeletion to * PendingDeletion and the deletion date appears in * the DeletionDate field. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withPendingDeletionWindowInDays(Integer pendingDeletionWindowInDays) { this.pendingDeletionWindowInDays = pendingDeletionWindowInDays; return this; } /** *

* The message authentication code (MAC) algorithm that the HMAC KMS key * supports. *

*

* This value is present only when the KeyUsage of the KMS key * is GENERATE_VERIFY_MAC. *

* * @return

* The message authentication code (MAC) algorithm that the HMAC KMS * key supports. *

*

* This value is present only when the KeyUsage of the * KMS key is GENERATE_VERIFY_MAC. *

*/ public java.util.List getMacAlgorithms() { return macAlgorithms; } /** *

* The message authentication code (MAC) algorithm that the HMAC KMS key * supports. *

*

* This value is present only when the KeyUsage of the KMS key * is GENERATE_VERIFY_MAC. *

* * @param macAlgorithms

* The message authentication code (MAC) algorithm that the HMAC * KMS key supports. *

*

* This value is present only when the KeyUsage of * the KMS key is GENERATE_VERIFY_MAC. *

*/ public void setMacAlgorithms(java.util.Collection macAlgorithms) { if (macAlgorithms == null) { this.macAlgorithms = null; return; } this.macAlgorithms = new java.util.ArrayList(macAlgorithms); } /** *

* The message authentication code (MAC) algorithm that the HMAC KMS key * supports. *

*

* This value is present only when the KeyUsage of the KMS key * is GENERATE_VERIFY_MAC. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param macAlgorithms

* The message authentication code (MAC) algorithm that the HMAC * KMS key supports. *

*

* This value is present only when the KeyUsage of * the KMS key is GENERATE_VERIFY_MAC. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withMacAlgorithms(String... macAlgorithms) { if (getMacAlgorithms() == null) { this.macAlgorithms = new java.util.ArrayList(macAlgorithms.length); } for (String value : macAlgorithms) { this.macAlgorithms.add(value); } return this; } /** *

* The message authentication code (MAC) algorithm that the HMAC KMS key * supports. *

*

* This value is present only when the KeyUsage of the KMS key * is GENERATE_VERIFY_MAC. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param macAlgorithms

* The message authentication code (MAC) algorithm that the HMAC * KMS key supports. *

*

* This value is present only when the KeyUsage of * the KMS key is GENERATE_VERIFY_MAC. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withMacAlgorithms(java.util.Collection macAlgorithms) { setMacAlgorithms(macAlgorithms); return this; } /** *

* Information about the external key that is associated with a KMS key in * an external key store. *

*

* For more information, see External key in the Key Management Service Developer Guide. *

* * @return

* Information about the external key that is associated with a KMS * key in an external key store. *

*

* For more information, see External key in the Key Management Service Developer * Guide. *

*/ public XksKeyConfigurationType getXksKeyConfiguration() { return xksKeyConfiguration; } /** *

* Information about the external key that is associated with a KMS key in * an external key store. *

*

* For more information, see External key in the Key Management Service Developer Guide. *

* * @param xksKeyConfiguration

* Information about the external key that is associated with a * KMS key in an external key store. *

*

* For more information, see External key in the Key Management Service Developer * Guide. *

*/ public void setXksKeyConfiguration(XksKeyConfigurationType xksKeyConfiguration) { this.xksKeyConfiguration = xksKeyConfiguration; } /** *

* Information about the external key that is associated with a KMS key in * an external key store. *

*

* For more information, see External key in the Key Management Service Developer Guide. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param xksKeyConfiguration

* Information about the external key that is associated with a * KMS key in an external key store. *

*

* For more information, see External key in the Key Management Service Developer * Guide. *

* @return A reference to this updated object so that method calls can be * chained together. */ public KeyMetadata withXksKeyConfiguration(XksKeyConfigurationType xksKeyConfiguration) { this.xksKeyConfiguration = xksKeyConfiguration; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAWSAccountId() != null) sb.append("AWSAccountId: " + getAWSAccountId() + ","); if (getKeyId() != null) sb.append("KeyId: " + getKeyId() + ","); if (getArn() != null) sb.append("Arn: " + getArn() + ","); if (getCreationDate() != null) sb.append("CreationDate: " + getCreationDate() + ","); if (getEnabled() != null) sb.append("Enabled: " + getEnabled() + ","); if (getDescription() != null) sb.append("Description: " + getDescription() + ","); if (getKeyUsage() != null) sb.append("KeyUsage: " + getKeyUsage() + ","); if (getKeyState() != null) sb.append("KeyState: " + getKeyState() + ","); if (getDeletionDate() != null) sb.append("DeletionDate: " + getDeletionDate() + ","); if (getValidTo() != null) sb.append("ValidTo: " + getValidTo() + ","); if (getOrigin() != null) sb.append("Origin: " + getOrigin() + ","); if (getCustomKeyStoreId() != null) sb.append("CustomKeyStoreId: " + getCustomKeyStoreId() + ","); if (getCloudHsmClusterId() != null) sb.append("CloudHsmClusterId: " + getCloudHsmClusterId() + ","); if (getExpirationModel() != null) sb.append("ExpirationModel: " + getExpirationModel() + ","); if (getKeyManager() != null) sb.append("KeyManager: " + getKeyManager() + ","); if (getCustomerMasterKeySpec() != null) sb.append("CustomerMasterKeySpec: " + getCustomerMasterKeySpec() + ","); if (getKeySpec() != null) sb.append("KeySpec: " + getKeySpec() + ","); if (getEncryptionAlgorithms() != null) sb.append("EncryptionAlgorithms: " + getEncryptionAlgorithms() + ","); if (getSigningAlgorithms() != null) sb.append("SigningAlgorithms: " + getSigningAlgorithms() + ","); if (getMultiRegion() != null) sb.append("MultiRegion: " + getMultiRegion() + ","); if (getMultiRegionConfiguration() != null) sb.append("MultiRegionConfiguration: " + getMultiRegionConfiguration() + ","); if (getPendingDeletionWindowInDays() != null) sb.append("PendingDeletionWindowInDays: " + getPendingDeletionWindowInDays() + ","); if (getMacAlgorithms() != null) sb.append("MacAlgorithms: " + getMacAlgorithms() + ","); if (getXksKeyConfiguration() != null) sb.append("XksKeyConfiguration: " + getXksKeyConfiguration()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAWSAccountId() == null) ? 0 : getAWSAccountId().hashCode()); hashCode = prime * hashCode + ((getKeyId() == null) ? 0 : getKeyId().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode()); hashCode = prime * hashCode + ((getEnabled() == null) ? 0 : getEnabled().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getKeyUsage() == null) ? 0 : getKeyUsage().hashCode()); hashCode = prime * hashCode + ((getKeyState() == null) ? 0 : getKeyState().hashCode()); hashCode = prime * hashCode + ((getDeletionDate() == null) ? 0 : getDeletionDate().hashCode()); hashCode = prime * hashCode + ((getValidTo() == null) ? 0 : getValidTo().hashCode()); hashCode = prime * hashCode + ((getOrigin() == null) ? 0 : getOrigin().hashCode()); hashCode = prime * hashCode + ((getCustomKeyStoreId() == null) ? 0 : getCustomKeyStoreId().hashCode()); hashCode = prime * hashCode + ((getCloudHsmClusterId() == null) ? 0 : getCloudHsmClusterId().hashCode()); hashCode = prime * hashCode + ((getExpirationModel() == null) ? 0 : getExpirationModel().hashCode()); hashCode = prime * hashCode + ((getKeyManager() == null) ? 0 : getKeyManager().hashCode()); hashCode = prime * hashCode + ((getCustomerMasterKeySpec() == null) ? 0 : getCustomerMasterKeySpec().hashCode()); hashCode = prime * hashCode + ((getKeySpec() == null) ? 0 : getKeySpec().hashCode()); hashCode = prime * hashCode + ((getEncryptionAlgorithms() == null) ? 0 : getEncryptionAlgorithms().hashCode()); hashCode = prime * hashCode + ((getSigningAlgorithms() == null) ? 0 : getSigningAlgorithms().hashCode()); hashCode = prime * hashCode + ((getMultiRegion() == null) ? 0 : getMultiRegion().hashCode()); hashCode = prime * hashCode + ((getMultiRegionConfiguration() == null) ? 0 : getMultiRegionConfiguration() .hashCode()); hashCode = prime * hashCode + ((getPendingDeletionWindowInDays() == null) ? 0 : getPendingDeletionWindowInDays().hashCode()); hashCode = prime * hashCode + ((getMacAlgorithms() == null) ? 0 : getMacAlgorithms().hashCode()); hashCode = prime * hashCode + ((getXksKeyConfiguration() == null) ? 0 : getXksKeyConfiguration().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof KeyMetadata == false) return false; KeyMetadata other = (KeyMetadata) obj; if (other.getAWSAccountId() == null ^ this.getAWSAccountId() == null) return false; if (other.getAWSAccountId() != null && other.getAWSAccountId().equals(this.getAWSAccountId()) == false) return false; if (other.getKeyId() == null ^ this.getKeyId() == null) return false; if (other.getKeyId() != null && other.getKeyId().equals(this.getKeyId()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getCreationDate() == null ^ this.getCreationDate() == null) return false; if (other.getCreationDate() != null && other.getCreationDate().equals(this.getCreationDate()) == false) return false; if (other.getEnabled() == null ^ this.getEnabled() == null) return false; if (other.getEnabled() != null && other.getEnabled().equals(this.getEnabled()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getKeyUsage() == null ^ this.getKeyUsage() == null) return false; if (other.getKeyUsage() != null && other.getKeyUsage().equals(this.getKeyUsage()) == false) return false; if (other.getKeyState() == null ^ this.getKeyState() == null) return false; if (other.getKeyState() != null && other.getKeyState().equals(this.getKeyState()) == false) return false; if (other.getDeletionDate() == null ^ this.getDeletionDate() == null) return false; if (other.getDeletionDate() != null && other.getDeletionDate().equals(this.getDeletionDate()) == false) return false; if (other.getValidTo() == null ^ this.getValidTo() == null) return false; if (other.getValidTo() != null && other.getValidTo().equals(this.getValidTo()) == false) return false; if (other.getOrigin() == null ^ this.getOrigin() == null) return false; if (other.getOrigin() != null && other.getOrigin().equals(this.getOrigin()) == false) return false; if (other.getCustomKeyStoreId() == null ^ this.getCustomKeyStoreId() == null) return false; if (other.getCustomKeyStoreId() != null && other.getCustomKeyStoreId().equals(this.getCustomKeyStoreId()) == false) return false; if (other.getCloudHsmClusterId() == null ^ this.getCloudHsmClusterId() == null) return false; if (other.getCloudHsmClusterId() != null && other.getCloudHsmClusterId().equals(this.getCloudHsmClusterId()) == false) return false; if (other.getExpirationModel() == null ^ this.getExpirationModel() == null) return false; if (other.getExpirationModel() != null && other.getExpirationModel().equals(this.getExpirationModel()) == false) return false; if (other.getKeyManager() == null ^ this.getKeyManager() == null) return false; if (other.getKeyManager() != null && other.getKeyManager().equals(this.getKeyManager()) == false) return false; if (other.getCustomerMasterKeySpec() == null ^ this.getCustomerMasterKeySpec() == null) return false; if (other.getCustomerMasterKeySpec() != null && other.getCustomerMasterKeySpec().equals(this.getCustomerMasterKeySpec()) == false) return false; if (other.getKeySpec() == null ^ this.getKeySpec() == null) return false; if (other.getKeySpec() != null && other.getKeySpec().equals(this.getKeySpec()) == false) return false; if (other.getEncryptionAlgorithms() == null ^ this.getEncryptionAlgorithms() == null) return false; if (other.getEncryptionAlgorithms() != null && other.getEncryptionAlgorithms().equals(this.getEncryptionAlgorithms()) == false) return false; if (other.getSigningAlgorithms() == null ^ this.getSigningAlgorithms() == null) return false; if (other.getSigningAlgorithms() != null && other.getSigningAlgorithms().equals(this.getSigningAlgorithms()) == false) return false; if (other.getMultiRegion() == null ^ this.getMultiRegion() == null) return false; if (other.getMultiRegion() != null && other.getMultiRegion().equals(this.getMultiRegion()) == false) return false; if (other.getMultiRegionConfiguration() == null ^ this.getMultiRegionConfiguration() == null) return false; if (other.getMultiRegionConfiguration() != null && other.getMultiRegionConfiguration().equals(this.getMultiRegionConfiguration()) == false) return false; if (other.getPendingDeletionWindowInDays() == null ^ this.getPendingDeletionWindowInDays() == null) return false; if (other.getPendingDeletionWindowInDays() != null && other.getPendingDeletionWindowInDays().equals( this.getPendingDeletionWindowInDays()) == false) return false; if (other.getMacAlgorithms() == null ^ this.getMacAlgorithms() == null) return false; if (other.getMacAlgorithms() != null && other.getMacAlgorithms().equals(this.getMacAlgorithms()) == false) return false; if (other.getXksKeyConfiguration() == null ^ this.getXksKeyConfiguration() == null) return false; if (other.getXksKeyConfiguration() != null && other.getXksKeyConfiguration().equals(this.getXksKeyConfiguration()) == false) return false; return true; } }