/* * Copyright 2018-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; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Contains metadata about a KMS key. *
** This data type is used as a response element for the CreateKey, DescribeKey, and ReplicateKey * operations. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class KeyMetadata implements Serializable, Cloneable, StructuredPojo { /** ** 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. *
*/ 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. *
*/ 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.
*
* The description of the KMS key. *
*/ private String description; /** ** The * cryptographic operations for which you can use the KMS key. *
*/ 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. *
*/ 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.
*
* 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.
*
* 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.
*
* 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. *
*/ 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. *
*/ 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.
*
* 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. *
*/ 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.
*
* Describes the type of key material in the KMS key. *
*/ 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
.
*
* 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
.
*
* 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.
*
* 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.
*
* 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
.
*
* 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. *
* * @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. *
* * @return The twelve-digit account ID of the Amazon Web Services account that owns the KMS key. */ public String getAWSAccountId() { return this.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. * @return Returns a reference to this object so that method calls can be chained together. */ public KeyMetadata withAWSAccountId(String aWSAccountId) { setAWSAccountId(aWSAccountId); return this; } /** ** The globally unique identifier for the KMS key. *
* * @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. *
* * @return The globally unique identifier for the KMS key. */ public String getKeyId() { return this.keyId; } /** ** The globally unique identifier for the KMS key. *
* * @param keyId * The globally unique identifier for the KMS key. * @return Returns a reference to this object so that method calls can be chained together. */ public KeyMetadata withKeyId(String keyId) { setKeyId(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. *
* * @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. *
* * @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 this.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. *
* * @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 Returns a reference to this object so that method calls can be chained together. */ public KeyMetadata withArn(String arn) { setArn(arn); return this; } /** ** 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. *
* * @return The date and time when the KMS key was created. */ public java.util.Date getCreationDate() { return this.creationDate; } /** ** The date and time when the KMS key was created. *
* * @param creationDate * The date and time when the KMS key was created. * @return Returns a reference to this object so that method calls can be chained together. */ public KeyMetadata withCreationDate(java.util.Date creationDate) { setCreationDate(creationDate); return this; } /** *
* Specifies whether the KMS key is enabled. When KeyState
is Enabled
this value is true,
* otherwise it is false.
*
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.
*
KeyState
is Enabled
this value
* is true, otherwise it is false.
*/
public Boolean getEnabled() {
return this.enabled;
}
/**
*
* Specifies whether the KMS key is enabled. When KeyState
is Enabled
this value is true,
* otherwise it is false.
*
KeyState
is Enabled
this value is
* true, otherwise it is false.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public KeyMetadata withEnabled(Boolean enabled) {
setEnabled(enabled);
return this;
}
/**
*
* Specifies whether the KMS key is enabled. When KeyState
is Enabled
this value is true,
* otherwise it is false.
*
KeyState
is Enabled
this value
* is true, otherwise it is false.
*/
public Boolean isEnabled() {
return this.enabled;
}
/**
* * The description of the KMS key. *
* * @param description * The description of the KMS key. */ public void setDescription(String description) { this.description = description; } /** ** The description of the KMS key. *
* * @return The description of the KMS key. */ public String getDescription() { return this.description; } /** ** The description of the KMS key. *
* * @param description * The description of the KMS key. * @return Returns a reference to this object so that method calls can be chained together. */ public KeyMetadata withDescription(String description) { setDescription(description); return this; } /** ** The * cryptographic operations for which you can use the KMS key. *
* * @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. *
* * @return The cryptographic operations for which you can use the KMS key. * @see KeyUsageType */ public String getKeyUsage() { return this.keyUsage; } /** ** The * cryptographic operations for which you can use the KMS key. *
* * @param keyUsage * The * cryptographic operations for which you can use the KMS key. * @return Returns a reference to this object so that method calls can be chained together. * @see KeyUsageType */ public KeyMetadata withKeyUsage(String keyUsage) { setKeyUsage(keyUsage); return this; } /** ** The * cryptographic operations for which you can use the KMS key. *
* * @param keyUsage * The * cryptographic operations for which you can use the KMS key. * @see KeyUsageType */ public void setKeyUsage(KeyUsageType keyUsage) { withKeyUsage(keyUsage); } /** ** The * cryptographic operations for which you can use the KMS key. *
* * @param keyUsage * The * cryptographic operations for which you can use the KMS key. * @return Returns a reference to this 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. *
* * @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. *
* * @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 this.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. *
* * @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 Returns a reference to this object so that method calls can be chained together. * @see KeyState */ public KeyMetadata withKeyState(String keyState) { setKeyState(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. *
* * @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) { withKeyState(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. *
* * @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 Returns a reference to this 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.
*
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.
*
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 this.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.
*
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 Returns a reference to this object so that method calls can be chained together.
*/
public KeyMetadata withDeletionDate(java.util.Date deletionDate) {
setDeletionDate(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.
*
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.
*
Origin
is EXTERNAL
and whose ExpirationModel
is
* KEY_MATERIAL_EXPIRES
, otherwise this value is omitted.
*/
public java.util.Date getValidTo() {
return this.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.
*
Origin
is EXTERNAL
and whose ExpirationModel
is
* KEY_MATERIAL_EXPIRES
, otherwise this value is omitted.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public KeyMetadata withValidTo(java.util.Date validTo) {
setValidTo(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.
*
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.
*
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 this.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.
*
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 Returns a reference to this object so that method calls can be chained together.
* @see OriginType
*/
public KeyMetadata withOrigin(String origin) {
setOrigin(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.
*
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) {
withOrigin(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.
*
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 Returns a reference to this 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. *
* * @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. *
* * @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 this.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. *
* * @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 Returns a reference to this object so that method calls can be chained together. */ public KeyMetadata withCustomKeyStoreId(String customKeyStoreId) { setCustomKeyStoreId(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. *
* * @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. *
* * @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 this.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. *
* * @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 Returns a reference to this object so that method calls can be chained together. */ public KeyMetadata withCloudHsmClusterId(String cloudHsmClusterId) { setCloudHsmClusterId(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.
*
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.
*
Origin
* is EXTERNAL
, otherwise this value is omitted.
* @see ExpirationModelType
*/
public String getExpirationModel() {
return this.expirationModel;
}
/**
*
* Specifies whether the KMS key's key material expires. This value is present only when Origin
is
* EXTERNAL
, otherwise this value is omitted.
*
Origin
* is EXTERNAL
, otherwise this value is omitted.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ExpirationModelType
*/
public KeyMetadata withExpirationModel(String expirationModel) {
setExpirationModel(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.
*
Origin
* is EXTERNAL
, otherwise this value is omitted.
* @see ExpirationModelType
*/
public void setExpirationModel(ExpirationModelType expirationModel) {
withExpirationModel(expirationModel);
}
/**
*
* Specifies whether the KMS key's key material expires. This value is present only when Origin
is
* EXTERNAL
, otherwise this value is omitted.
*
Origin
* is EXTERNAL
, otherwise this value is omitted.
* @return Returns a reference to this 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. *
* * @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. *
* * @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 this.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. *
* * @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 Returns a reference to this object so that method calls can be chained together. * @see KeyManagerType */ public KeyMetadata withKeyManager(String keyManager) { setKeyManager(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. *
* * @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) { withKeyManager(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. *
* * @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 Returns a reference to this 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.
*
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
*/
@Deprecated
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.
*
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
*/
@Deprecated
public String getCustomerMasterKeySpec() {
return this.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.
*
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 Returns a reference to this object so that method calls can be chained together.
* @see CustomerMasterKeySpec
*/
@Deprecated
public KeyMetadata withCustomerMasterKeySpec(String customerMasterKeySpec) {
setCustomerMasterKeySpec(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.
*
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
*/
@Deprecated
public void setCustomerMasterKeySpec(CustomerMasterKeySpec customerMasterKeySpec) {
withCustomerMasterKeySpec(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.
*
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 Returns a reference to this object so that method calls can be chained together.
* @see CustomerMasterKeySpec
*/
@Deprecated
public KeyMetadata withCustomerMasterKeySpec(CustomerMasterKeySpec customerMasterKeySpec) {
this.customerMasterKeySpec = customerMasterKeySpec.toString();
return this;
}
/**
*
* Describes the type of key material in the KMS key. *
* * @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. *
* * @return Describes the type of key material in the KMS key. * @see KeySpec */ public String getKeySpec() { return this.keySpec; } /** ** Describes the type of key material in the KMS key. *
* * @param keySpec * Describes the type of key material in the KMS key. * @return Returns a reference to this object so that method calls can be chained together. * @see KeySpec */ public KeyMetadata withKeySpec(String keySpec) { setKeySpec(keySpec); return this; } /** ** Describes the type of key material in the KMS key. *
* * @param keySpec * Describes the type of key material in the KMS key. * @see KeySpec */ public void setKeySpec(KeySpec keySpec) { withKeySpec(keySpec); } /** ** Describes the type of key material in the KMS key. *
* * @param keySpec * Describes the type of key material in the KMS key. * @return Returns a reference to this 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
.
*
* This value is present only when the
* 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
.
* @see EncryptionAlgorithmSpec
*/
public java.util.ListKeyUsage
of the KMS key is ENCRYPT_DECRYPT
.
*
* This value is present only when the
* 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
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setEncryptionAlgorithms(java.util.Collection)} or {@link #withEncryptionAlgorithms(java.util.Collection)}
* if you want to override the existing values.
* KeyUsage
of the KMS key is ENCRYPT_DECRYPT
.
* @see EncryptionAlgorithmSpec
*/
public void setEncryptionAlgorithms(java.util.CollectionKeyUsage
of the KMS key is ENCRYPT_DECRYPT
.
*
* This value is present only when the
* 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 Returns a reference to this object so that method calls can be chained together.
* @see EncryptionAlgorithmSpec
*/
public KeyMetadata withEncryptionAlgorithms(String... encryptionAlgorithms) {
if (this.encryptionAlgorithms == null) {
setEncryptionAlgorithms(new com.amazonaws.internal.SdkInternalListKeyUsage
of the KMS key is ENCRYPT_DECRYPT
.
*
* This value is present only when the
* 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 Returns a reference to this object so that method calls can be chained together.
* @see EncryptionAlgorithmSpec
*/
public KeyMetadata withEncryptionAlgorithms(java.util.CollectionKeyUsage
of the KMS key is ENCRYPT_DECRYPT
.
*
* This value is present only when the
* 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 ENCRYPT_DECRYPT
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see EncryptionAlgorithmSpec
*/
public KeyMetadata withEncryptionAlgorithms(EncryptionAlgorithmSpec... encryptionAlgorithms) {
com.amazonaws.internal.SdkInternalListKeyUsage
of the KMS key is SIGN_VERIFY
.
*
* This field appears only when the
* 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
.
* @see SigningAlgorithmSpec
*/
public java.util.ListKeyUsage
of the KMS key is SIGN_VERIFY
.
*
* This field appears only when the
* 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
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSigningAlgorithms(java.util.Collection)} or {@link #withSigningAlgorithms(java.util.Collection)} if
* you want to override the existing values.
* KeyUsage
of the KMS key is SIGN_VERIFY
.
* @see SigningAlgorithmSpec
*/
public void setSigningAlgorithms(java.util.CollectionKeyUsage
of the KMS key is SIGN_VERIFY
.
*
* This field appears only when the
* 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 Returns a reference to this object so that method calls can be chained together.
* @see SigningAlgorithmSpec
*/
public KeyMetadata withSigningAlgorithms(String... signingAlgorithms) {
if (this.signingAlgorithms == null) {
setSigningAlgorithms(new com.amazonaws.internal.SdkInternalListKeyUsage
of the KMS key is SIGN_VERIFY
.
*
* This field appears only when the
* 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 Returns a reference to this object so that method calls can be chained together.
* @see SigningAlgorithmSpec
*/
public KeyMetadata withSigningAlgorithms(java.util.CollectionKeyUsage
of the KMS key is SIGN_VERIFY
.
*
* This field appears only when the
* Indicates whether the KMS key is a multi-Region (
* For more information about multi-Region keys, see Multi-Region keys in
* KMS in the Key Management Service Developer Guide.
* KeyUsage
of the KMS key is SIGN_VERIFY
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SigningAlgorithmSpec
*/
public KeyMetadata withSigningAlgorithms(SigningAlgorithmSpec... signingAlgorithms) {
com.amazonaws.internal.SdkInternalListTrue
) or regional (False
) key. This
* value is True
for multi-Region primary and replica keys and False
for regional KMS
* keys.
* 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. *
* * @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 this.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. * @return Returns a reference to this object so that method calls can be chained together. */ public KeyMetadata withMultiRegion(Boolean multiRegion) { setMultiRegion(multiRegion); 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 this.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.
*
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.
*
* 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.
*
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.
*
* 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.
*
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.
*
* 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.
*
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.
*
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 this.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.
*
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 Returns a reference to this object so that method calls can be chained together.
*/
public KeyMetadata withPendingDeletionWindowInDays(Integer pendingDeletionWindowInDays) {
setPendingDeletionWindowInDays(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
.
*
* This value is present only when the
* 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
.
* @see MacAlgorithmSpec
*/
public java.util.ListKeyUsage
of the KMS key is GENERATE_VERIFY_MAC
.
*
* This value is present only when the
* The message authentication code (MAC) algorithm that the HMAC KMS key supports.
*
* This value is present only when the
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setMacAlgorithms(java.util.Collection)} or {@link #withMacAlgorithms(java.util.Collection)} if you want
* to override the existing values.
* KeyUsage
of the KMS key is
* GENERATE_VERIFY_MAC
.
* @see MacAlgorithmSpec
*/
public void setMacAlgorithms(java.util.CollectionKeyUsage
of the KMS key is GENERATE_VERIFY_MAC
.
*
* This value is present only when the
* 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 Returns a reference to this object so that method calls can be chained together.
* @see MacAlgorithmSpec
*/
public KeyMetadata withMacAlgorithms(String... macAlgorithms) {
if (this.macAlgorithms == null) {
setMacAlgorithms(new com.amazonaws.internal.SdkInternalListKeyUsage
of the KMS key is GENERATE_VERIFY_MAC
.
*
* This value is present only when the
* 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 Returns a reference to this object so that method calls can be chained together.
* @see MacAlgorithmSpec
*/
public KeyMetadata withMacAlgorithms(java.util.CollectionKeyUsage
of the KMS key is GENERATE_VERIFY_MAC
.
*
* This value is present only when the
* 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.
* KeyUsage
of the KMS key is
* GENERATE_VERIFY_MAC
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see MacAlgorithmSpec
*/
public KeyMetadata withMacAlgorithms(MacAlgorithmSpec... macAlgorithms) {
com.amazonaws.internal.SdkInternalList
* 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. *
* * @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 this.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. * @return Returns a reference to this object so that method calls can be chained together. */ public KeyMetadata withXksKeyConfiguration(XksKeyConfigurationType xksKeyConfiguration) { setXksKeyConfiguration(xksKeyConfiguration); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @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: ").append(getAWSAccountId()).append(","); if (getKeyId() != null) sb.append("KeyId: ").append(getKeyId()).append(","); if (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getCreationDate() != null) sb.append("CreationDate: ").append(getCreationDate()).append(","); if (getEnabled() != null) sb.append("Enabled: ").append(getEnabled()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getKeyUsage() != null) sb.append("KeyUsage: ").append(getKeyUsage()).append(","); if (getKeyState() != null) sb.append("KeyState: ").append(getKeyState()).append(","); if (getDeletionDate() != null) sb.append("DeletionDate: ").append(getDeletionDate()).append(","); if (getValidTo() != null) sb.append("ValidTo: ").append(getValidTo()).append(","); if (getOrigin() != null) sb.append("Origin: ").append(getOrigin()).append(","); if (getCustomKeyStoreId() != null) sb.append("CustomKeyStoreId: ").append(getCustomKeyStoreId()).append(","); if (getCloudHsmClusterId() != null) sb.append("CloudHsmClusterId: ").append(getCloudHsmClusterId()).append(","); if (getExpirationModel() != null) sb.append("ExpirationModel: ").append(getExpirationModel()).append(","); if (getKeyManager() != null) sb.append("KeyManager: ").append(getKeyManager()).append(","); if (getCustomerMasterKeySpec() != null) sb.append("CustomerMasterKeySpec: ").append(getCustomerMasterKeySpec()).append(","); if (getKeySpec() != null) sb.append("KeySpec: ").append(getKeySpec()).append(","); if (getEncryptionAlgorithms() != null) sb.append("EncryptionAlgorithms: ").append(getEncryptionAlgorithms()).append(","); if (getSigningAlgorithms() != null) sb.append("SigningAlgorithms: ").append(getSigningAlgorithms()).append(","); if (getMultiRegion() != null) sb.append("MultiRegion: ").append(getMultiRegion()).append(","); if (getMultiRegionConfiguration() != null) sb.append("MultiRegionConfiguration: ").append(getMultiRegionConfiguration()).append(","); if (getPendingDeletionWindowInDays() != null) sb.append("PendingDeletionWindowInDays: ").append(getPendingDeletionWindowInDays()).append(","); if (getMacAlgorithms() != null) sb.append("MacAlgorithms: ").append(getMacAlgorithms()).append(","); if (getXksKeyConfiguration() != null) sb.append("XksKeyConfiguration: ").append(getXksKeyConfiguration()); sb.append("}"); return sb.toString(); } @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; } @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 KeyMetadata clone() { try { return (KeyMetadata) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.kms.model.transform.KeyMetadataMarshaller.getInstance().marshall(this, protocolMarshaller); } }