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 KeyMetadata
clone()
boolean
equals(Object obj)
String
getArn()
The Amazon Resource Name (ARN) of the key.String
getAWSAccountId()
The twelve-digit account ID of the AWS account that owns the key.Date
getCreationDate()
The date and time when the key was created.Date
getDeletionDate()
The date and time after which AWS KMS deletes the customer master key (CMK).String
getDescription()
The friendly description of the key.Boolean
getEnabled()
Specifies whether the key is enabled.String
getKeyId()
The globally unique identifier for the key.String
getKeyState()
The state of the customer master key (CMK).String
getKeyUsage()
The cryptographic operations for which you can use the key.int
hashCode()
Boolean
isEnabled()
Specifies whether the key is enabled.void
setArn(String arn)
The Amazon Resource Name (ARN) of the key.void
setAWSAccountId(String aWSAccountId)
The twelve-digit account ID of the AWS account that owns the key.void
setCreationDate(Date creationDate)
The date and time when the key was created.void
setDeletionDate(Date deletionDate)
The date and time after which AWS KMS deletes the customer master key (CMK).void
setDescription(String description)
The friendly description of the key.void
setEnabled(Boolean enabled)
Specifies whether the key is enabled.void
setKeyId(String keyId)
The globally unique identifier for the key.void
setKeyState(KeyState keyState)
The state of the customer master key (CMK).void
setKeyState(String keyState)
The state of the customer master key (CMK).void
setKeyUsage(KeyUsageType keyUsage)
The cryptographic operations for which you can use the key.void
setKeyUsage(String keyUsage)
The cryptographic operations for which you can use the key.String
toString()
Returns a string representation of this object; useful for testing and debugging.KeyMetadata
withArn(String arn)
The Amazon Resource Name (ARN) of the key.KeyMetadata
withAWSAccountId(String aWSAccountId)
The twelve-digit account ID of the AWS account that owns the key.KeyMetadata
withCreationDate(Date creationDate)
The date and time when the key was created.KeyMetadata
withDeletionDate(Date deletionDate)
The date and time after which AWS KMS deletes the customer master key (CMK).KeyMetadata
withDescription(String description)
The friendly description of the key.KeyMetadata
withEnabled(Boolean enabled)
Specifies whether the key is enabled.KeyMetadata
withKeyId(String keyId)
The globally unique identifier for the key.KeyMetadata
withKeyState(KeyState keyState)
The state of the customer master key (CMK).KeyMetadata
withKeyState(String keyState)
The state of the customer master key (CMK).KeyMetadata
withKeyUsage(KeyUsageType keyUsage)
The cryptographic operations for which you can use the key.KeyMetadata
withKeyUsage(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
KeyState
isEnabled
this value is true, otherwise it is false.- Parameters:
enabled
- Specifies whether the key is enabled. WhenKeyState
isEnabled
this value is true, otherwise it is false.
-
getEnabled
public Boolean getEnabled()
Specifies whether the key is enabled. When
KeyState
isEnabled
this value is true, otherwise it is false.- Returns:
- Specifies whether the key is enabled. When
KeyState
isEnabled
this value is true, otherwise it is false.
-
withEnabled
public KeyMetadata withEnabled(Boolean enabled)
Specifies whether the key is enabled. When
KeyState
isEnabled
this value is true, otherwise it is false.- Parameters:
enabled
- Specifies whether the key is enabled. WhenKeyState
isEnabled
this 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
KeyState
isEnabled
this value is true, otherwise it is false.- Returns:
- Specifies whether the key is enabled. When
KeyState
isEnabled
this 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
KeyState
isPendingDeletion
, 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 whenKeyState
isPendingDeletion
, 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
KeyState
isPendingDeletion
, 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
KeyState
isPendingDeletion
, 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
KeyState
isPendingDeletion
, 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 whenKeyState
isPendingDeletion
, 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:
toString
in classObject
- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
clone
public KeyMetadata clone()
-
-