Class KeyMetadata
- java.lang.Object
-
- com.amazonaws.services.kms.model.KeyMetadata
-
- All Implemented Interfaces:
Serializable,Cloneable
public class KeyMetadata extends Object implements Serializable, Cloneable
Contains metadata about a customer master key (CMK).
This data type is used as a response element for the CreateKey and DescribeKey operations.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description KeyMetadata()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyMetadataclone()booleanequals(Object obj)StringgetArn()The Amazon Resource Name (ARN) of the key.StringgetAWSAccountId()The twelve-digit account ID of the AWS account that owns the key.DategetCreationDate()The date and time when the key was created.DategetDeletionDate()The date and time after which AWS KMS deletes the customer master key (CMK).StringgetDescription()The friendly description of the key.BooleangetEnabled()Specifies whether the key is enabled.StringgetKeyId()The globally unique identifier for the key.StringgetKeyState()The state of the customer master key (CMK).StringgetKeyUsage()The cryptographic operations for which you can use the key.inthashCode()BooleanisEnabled()Specifies whether the key is enabled.voidsetArn(String arn)The Amazon Resource Name (ARN) of the key.voidsetAWSAccountId(String aWSAccountId)The twelve-digit account ID of the AWS account that owns the key.voidsetCreationDate(Date creationDate)The date and time when the key was created.voidsetDeletionDate(Date deletionDate)The date and time after which AWS KMS deletes the customer master key (CMK).voidsetDescription(String description)The friendly description of the key.voidsetEnabled(Boolean enabled)Specifies whether the key is enabled.voidsetKeyId(String keyId)The globally unique identifier for the key.voidsetKeyState(KeyState keyState)The state of the customer master key (CMK).voidsetKeyState(String keyState)The state of the customer master key (CMK).voidsetKeyUsage(KeyUsageType keyUsage)The cryptographic operations for which you can use the key.voidsetKeyUsage(String keyUsage)The cryptographic operations for which you can use the key.StringtoString()Returns a string representation of this object; useful for testing and debugging.KeyMetadatawithArn(String arn)The Amazon Resource Name (ARN) of the key.KeyMetadatawithAWSAccountId(String aWSAccountId)The twelve-digit account ID of the AWS account that owns the key.KeyMetadatawithCreationDate(Date creationDate)The date and time when the key was created.KeyMetadatawithDeletionDate(Date deletionDate)The date and time after which AWS KMS deletes the customer master key (CMK).KeyMetadatawithDescription(String description)The friendly description of the key.KeyMetadatawithEnabled(Boolean enabled)Specifies whether the key is enabled.KeyMetadatawithKeyId(String keyId)The globally unique identifier for the key.KeyMetadatawithKeyState(KeyState keyState)The state of the customer master key (CMK).KeyMetadatawithKeyState(String keyState)The state of the customer master key (CMK).KeyMetadatawithKeyUsage(KeyUsageType keyUsage)The cryptographic operations for which you can use the key.KeyMetadatawithKeyUsage(String keyUsage)The cryptographic operations for which you can use the key.
-
-
-
Method Detail
-
setAWSAccountId
public void setAWSAccountId(String aWSAccountId)
The twelve-digit account ID of the AWS account that owns the key.
- Parameters:
aWSAccountId- The twelve-digit account ID of the AWS account that owns the key.
-
getAWSAccountId
public String getAWSAccountId()
The twelve-digit account ID of the AWS account that owns the key.
- Returns:
- The twelve-digit account ID of the AWS account that owns the key.
-
withAWSAccountId
public KeyMetadata withAWSAccountId(String aWSAccountId)
The twelve-digit account ID of the AWS account that owns the key.
- Parameters:
aWSAccountId- The twelve-digit account ID of the AWS account that owns the key.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setKeyId
public void setKeyId(String keyId)
The globally unique identifier for the key.
- Parameters:
keyId- The globally unique identifier for the key.
-
getKeyId
public String getKeyId()
The globally unique identifier for the key.
- Returns:
- The globally unique identifier for the key.
-
withKeyId
public KeyMetadata withKeyId(String keyId)
The globally unique identifier for the key.
- Parameters:
keyId- The globally unique identifier for the key.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setArn
public void setArn(String arn)
The Amazon Resource Name (ARN) of the key. For examples, see AWS Key Management Service (AWS KMS) in the Example ARNs section of the AWS General Reference.
- Parameters:
arn- The Amazon Resource Name (ARN) of the key. For examples, see AWS Key Management Service (AWS KMS) in the Example ARNs section of the AWS General Reference.
-
getArn
public String getArn()
The Amazon Resource Name (ARN) of the key. For examples, see AWS Key Management Service (AWS KMS) in the Example ARNs section of the AWS General Reference.
- Returns:
- The Amazon Resource Name (ARN) of the key. For examples, see AWS Key Management Service (AWS KMS) in the Example ARNs section of the AWS General Reference.
-
withArn
public KeyMetadata withArn(String arn)
The Amazon Resource Name (ARN) of the key. For examples, see AWS Key Management Service (AWS KMS) in the Example ARNs section of the AWS General Reference.
- Parameters:
arn- The Amazon Resource Name (ARN) of the key. For examples, see AWS Key Management Service (AWS KMS) in the Example ARNs section of the AWS General Reference.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setCreationDate
public void setCreationDate(Date creationDate)
The date and time when the key was created.
- Parameters:
creationDate- The date and time when the key was created.
-
getCreationDate
public Date getCreationDate()
The date and time when the key was created.
- Returns:
- The date and time when the key was created.
-
withCreationDate
public KeyMetadata withCreationDate(Date creationDate)
The date and time when the key was created.
- Parameters:
creationDate- The date and time when the key was created.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setEnabled
public void setEnabled(Boolean enabled)
Specifies whether the key is enabled. When
KeyStateisEnabledthis value is true, otherwise it is false.- Parameters:
enabled- Specifies whether the key is enabled. WhenKeyStateisEnabledthis value is true, otherwise it is false.
-
getEnabled
public Boolean getEnabled()
Specifies whether the key is enabled. When
KeyStateisEnabledthis value is true, otherwise it is false.- Returns:
- Specifies whether the key is enabled. When
KeyStateisEnabledthis value is true, otherwise it is false.
-
withEnabled
public KeyMetadata withEnabled(Boolean enabled)
Specifies whether the key is enabled. When
KeyStateisEnabledthis value is true, otherwise it is false.- Parameters:
enabled- Specifies whether the key is enabled. WhenKeyStateisEnabledthis value is true, otherwise it is false.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
isEnabled
public Boolean isEnabled()
Specifies whether the key is enabled. When
KeyStateisEnabledthis value is true, otherwise it is false.- Returns:
- Specifies whether the key is enabled. When
KeyStateisEnabledthis value is true, otherwise it is false.
-
setDescription
public void setDescription(String description)
The friendly description of the key.
- Parameters:
description- The friendly description of the key.
-
getDescription
public String getDescription()
The friendly description of the key.
- Returns:
- The friendly description of the key.
-
withDescription
public KeyMetadata withDescription(String description)
The friendly description of the key.
- Parameters:
description- The friendly description of the key.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setKeyUsage
public void setKeyUsage(String keyUsage)
The cryptographic operations for which you can use the key. Currently the only allowed value is
ENCRYPT_DECRYPT, which means you can use the key for the Encrypt and Decrypt operations.- Parameters:
keyUsage- The cryptographic operations for which you can use the key. Currently the only allowed value isENCRYPT_DECRYPT, which means you can use the key for the Encrypt and Decrypt operations.- See Also:
KeyUsageType
-
getKeyUsage
public String getKeyUsage()
The cryptographic operations for which you can use the key. Currently the only allowed value is
ENCRYPT_DECRYPT, which means you can use the key for the Encrypt and Decrypt operations.- Returns:
- The cryptographic operations for which you can use the key.
Currently the only allowed value is
ENCRYPT_DECRYPT, which means you can use the key for the Encrypt and Decrypt operations. - See Also:
KeyUsageType
-
withKeyUsage
public KeyMetadata withKeyUsage(String keyUsage)
The cryptographic operations for which you can use the key. Currently the only allowed value is
ENCRYPT_DECRYPT, which means you can use the key for the Encrypt and Decrypt operations.- Parameters:
keyUsage- The cryptographic operations for which you can use the key. Currently the only allowed value isENCRYPT_DECRYPT, which means you can use the key for the Encrypt and Decrypt operations.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
KeyUsageType
-
setKeyUsage
public void setKeyUsage(KeyUsageType keyUsage)
The cryptographic operations for which you can use the key. Currently the only allowed value is
ENCRYPT_DECRYPT, which means you can use the key for the Encrypt and Decrypt operations.- Parameters:
keyUsage- The cryptographic operations for which you can use the key. Currently the only allowed value isENCRYPT_DECRYPT, which means you can use the key for the Encrypt and Decrypt operations.- See Also:
KeyUsageType
-
withKeyUsage
public KeyMetadata withKeyUsage(KeyUsageType keyUsage)
The cryptographic operations for which you can use the key. Currently the only allowed value is
ENCRYPT_DECRYPT, which means you can use the key for the Encrypt and Decrypt operations.- Parameters:
keyUsage- The cryptographic operations for which you can use the key. Currently the only allowed value isENCRYPT_DECRYPT, which means you can use the key for the Encrypt and Decrypt operations.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
KeyUsageType
-
setKeyState
public void setKeyState(String keyState)
The state of the customer master key (CMK).
For more information about how key state affects the use of a CMK, see How Key State Affects the Use of a Customer Master Key in the AWS Key Management Service Developer Guide.
- Parameters:
keyState- The state of the customer master key (CMK).For more information about how key state affects the use of a CMK, see How Key State Affects the Use of a Customer Master Key in the AWS Key Management Service Developer Guide.
- See Also:
KeyState
-
getKeyState
public String getKeyState()
The state of the customer master key (CMK).
For more information about how key state affects the use of a CMK, see How Key State Affects the Use of a Customer Master Key in the AWS Key Management Service Developer Guide.
- Returns:
- The state of the customer master key (CMK).
For more information about how key state affects the use of a CMK, see How Key State Affects the Use of a Customer Master Key in the AWS Key Management Service Developer Guide.
- See Also:
KeyState
-
withKeyState
public KeyMetadata withKeyState(String keyState)
The state of the customer master key (CMK).
For more information about how key state affects the use of a CMK, see How Key State Affects the Use of a Customer Master Key in the AWS Key Management Service Developer Guide.
- Parameters:
keyState- The state of the customer master key (CMK).For more information about how key state affects the use of a CMK, see How Key State Affects the Use of a Customer Master Key in the AWS Key Management Service Developer Guide.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
KeyState
-
setKeyState
public void setKeyState(KeyState keyState)
The state of the customer master key (CMK).
For more information about how key state affects the use of a CMK, see How Key State Affects the Use of a Customer Master Key in the AWS Key Management Service Developer Guide.
- Parameters:
keyState- The state of the customer master key (CMK).For more information about how key state affects the use of a CMK, see How Key State Affects the Use of a Customer Master Key in the AWS Key Management Service Developer Guide.
- See Also:
KeyState
-
withKeyState
public KeyMetadata withKeyState(KeyState keyState)
The state of the customer master key (CMK).
For more information about how key state affects the use of a CMK, see How Key State Affects the Use of a Customer Master Key in the AWS Key Management Service Developer Guide.
- Parameters:
keyState- The state of the customer master key (CMK).For more information about how key state affects the use of a CMK, see How Key State Affects the Use of a Customer Master Key in the AWS Key Management Service Developer Guide.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
KeyState
-
setDeletionDate
public void setDeletionDate(Date deletionDate)
The date and time after which AWS KMS deletes the customer master key (CMK). This value is present only when
KeyStateisPendingDeletion, otherwise this value is null.- Parameters:
deletionDate- The date and time after which AWS KMS deletes the customer master key (CMK). This value is present only whenKeyStateisPendingDeletion, otherwise this value is null.
-
getDeletionDate
public Date getDeletionDate()
The date and time after which AWS KMS deletes the customer master key (CMK). This value is present only when
KeyStateisPendingDeletion, otherwise this value is null.- Returns:
- The date and time after which AWS KMS deletes the customer master
key (CMK). This value is present only when
KeyStateisPendingDeletion, otherwise this value is null.
-
withDeletionDate
public KeyMetadata withDeletionDate(Date deletionDate)
The date and time after which AWS KMS deletes the customer master key (CMK). This value is present only when
KeyStateisPendingDeletion, otherwise this value is null.- Parameters:
deletionDate- The date and time after which AWS KMS deletes the customer master key (CMK). This value is present only whenKeyStateisPendingDeletion, otherwise this value is null.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toString
public String toString()
Returns a string representation of this object; useful for testing and debugging.- Overrides:
toStringin classObject- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
clone
public KeyMetadata clone()
-
-