public class KeyMetadata extends Object implements Serializable
Contains metadata about a customer master key (CMK).
This data type is used as a response element for the CreateKey and DescribeKey operations.
| Constructor and Description |
|---|
KeyMetadata() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getArn()
The Amazon Resource Name (ARN) of the CMK.
|
String |
getAWSAccountId()
The twelve-digit account ID of the AWS account that owns the CMK.
|
Date |
getCreationDate()
The date and time when the CMK was created.
|
Date |
getDeletionDate()
The date and time after which AWS KMS deletes the CMK.
|
String |
getDescription()
The description of the CMK.
|
Boolean |
getEnabled()
Specifies whether the CMK is enabled.
|
String |
getExpirationModel()
Specifies whether the CMK's key material expires.
|
String |
getKeyId()
The globally unique identifier for the CMK.
|
String |
getKeyManager()
The CMK's manager.
|
String |
getKeyState()
The state of the CMK.
|
String |
getKeyUsage()
The cryptographic operations for which you can use the CMK.
|
String |
getOrigin()
The source of the CMK's key material.
|
Date |
getValidTo()
The time at which the imported key material expires.
|
int |
hashCode() |
Boolean |
isEnabled()
Specifies whether the CMK is enabled.
|
void |
setArn(String arn)
The Amazon Resource Name (ARN) of the CMK.
|
void |
setAWSAccountId(String aWSAccountId)
The twelve-digit account ID of the AWS account that owns the CMK.
|
void |
setCreationDate(Date creationDate)
The date and time when the CMK was created.
|
void |
setDeletionDate(Date deletionDate)
The date and time after which AWS KMS deletes the CMK.
|
void |
setDescription(String description)
The description of the CMK.
|
void |
setEnabled(Boolean enabled)
Specifies whether the CMK is enabled.
|
void |
setExpirationModel(ExpirationModelType expirationModel)
Specifies whether the CMK's key material expires.
|
void |
setExpirationModel(String expirationModel)
Specifies whether the CMK's key material expires.
|
void |
setKeyId(String keyId)
The globally unique identifier for the CMK.
|
void |
setKeyManager(KeyManagerType keyManager)
The CMK's manager.
|
void |
setKeyManager(String keyManager)
The CMK's manager.
|
void |
setKeyState(KeyState keyState)
The state of the CMK.
|
void |
setKeyState(String keyState)
The state of the CMK.
|
void |
setKeyUsage(KeyUsageType keyUsage)
The cryptographic operations for which you can use the CMK.
|
void |
setKeyUsage(String keyUsage)
The cryptographic operations for which you can use the CMK.
|
void |
setOrigin(OriginType origin)
The source of the CMK's key material.
|
void |
setOrigin(String origin)
The source of the CMK's key material.
|
void |
setValidTo(Date validTo)
The time at which the imported key material expires.
|
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 CMK.
|
KeyMetadata |
withAWSAccountId(String aWSAccountId)
The twelve-digit account ID of the AWS account that owns the CMK.
|
KeyMetadata |
withCreationDate(Date creationDate)
The date and time when the CMK was created.
|
KeyMetadata |
withDeletionDate(Date deletionDate)
The date and time after which AWS KMS deletes the CMK.
|
KeyMetadata |
withDescription(String description)
The description of the CMK.
|
KeyMetadata |
withEnabled(Boolean enabled)
Specifies whether the CMK is enabled.
|
KeyMetadata |
withExpirationModel(ExpirationModelType expirationModel)
Specifies whether the CMK's key material expires.
|
KeyMetadata |
withExpirationModel(String expirationModel)
Specifies whether the CMK's key material expires.
|
KeyMetadata |
withKeyId(String keyId)
The globally unique identifier for the CMK.
|
KeyMetadata |
withKeyManager(KeyManagerType keyManager)
The CMK's manager.
|
KeyMetadata |
withKeyManager(String keyManager)
The CMK's manager.
|
KeyMetadata |
withKeyState(KeyState keyState)
The state of the CMK.
|
KeyMetadata |
withKeyState(String keyState)
The state of the CMK.
|
KeyMetadata |
withKeyUsage(KeyUsageType keyUsage)
The cryptographic operations for which you can use the CMK.
|
KeyMetadata |
withKeyUsage(String keyUsage)
The cryptographic operations for which you can use the CMK.
|
KeyMetadata |
withOrigin(OriginType origin)
The source of the CMK's key material.
|
KeyMetadata |
withOrigin(String origin)
The source of the CMK's key material.
|
KeyMetadata |
withValidTo(Date validTo)
The time at which the imported key material expires.
|
public String getAWSAccountId()
The twelve-digit account ID of the AWS account that owns the CMK.
The twelve-digit account ID of the AWS account that owns the CMK.
public void setAWSAccountId(String aWSAccountId)
The twelve-digit account ID of the AWS account that owns the CMK.
aWSAccountId - The twelve-digit account ID of the AWS account that owns the CMK.
public KeyMetadata withAWSAccountId(String aWSAccountId)
The twelve-digit account ID of the AWS account that owns the CMK.
Returns a reference to this object so that method calls can be chained together.
aWSAccountId - The twelve-digit account ID of the AWS account that owns the CMK.
public String getKeyId()
The globally unique identifier for the CMK.
Constraints:
Length: 1 - 2048
The globally unique identifier for the CMK.
public void setKeyId(String keyId)
The globally unique identifier for the CMK.
Constraints:
Length: 1 - 2048
keyId - The globally unique identifier for the CMK.
public KeyMetadata withKeyId(String keyId)
The globally unique identifier for the CMK.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 2048
keyId - The globally unique identifier for the CMK.
public String getArn()
The Amazon Resource Name (ARN) of the CMK. For examples, see AWS Key Management Service (AWS KMS) in the Example ARNs section of the AWS General Reference.
Constraints:
Length: 20 - 2048
The Amazon Resource Name (ARN) of the CMK. For examples, see AWS Key Management Service (AWS KMS) in the Example ARNs section of the AWS General Reference.
public void setArn(String arn)
The Amazon Resource Name (ARN) of the CMK. For examples, see AWS Key Management Service (AWS KMS) in the Example ARNs section of the AWS General Reference.
Constraints:
Length: 20 - 2048
arn - The Amazon Resource Name (ARN) of the CMK. For examples, see AWS Key Management Service (AWS KMS) in the Example ARNs section of the AWS General Reference.
public KeyMetadata withArn(String arn)
The Amazon Resource Name (ARN) of the CMK. For examples, see AWS Key Management Service (AWS KMS) in the Example ARNs section of the AWS General Reference.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 20 - 2048
arn - The Amazon Resource Name (ARN) of the CMK. For examples, see AWS Key Management Service (AWS KMS) in the Example ARNs section of the AWS General Reference.
public Date getCreationDate()
The date and time when the CMK was created.
The date and time when the CMK was created.
public void setCreationDate(Date creationDate)
The date and time when the CMK was created.
creationDate - The date and time when the CMK was created.
public KeyMetadata withCreationDate(Date creationDate)
The date and time when the CMK was created.
Returns a reference to this object so that method calls can be chained together.
creationDate - The date and time when the CMK was created.
public Boolean isEnabled()
Specifies whether the CMK is enabled. When KeyState is
Enabled this value is true, otherwise it is false.
Specifies whether the CMK is enabled. When KeyState
is Enabled this value is true, otherwise it is
false.
public Boolean getEnabled()
Specifies whether the CMK is enabled. When KeyState is
Enabled this value is true, otherwise it is false.
Specifies whether the CMK is enabled. When KeyState
is Enabled this value is true, otherwise it is
false.
public void setEnabled(Boolean enabled)
Specifies whether the CMK is enabled. When KeyState is
Enabled this value is true, otherwise it is false.
enabled -
Specifies whether the CMK is enabled. When
KeyState is Enabled this value is
true, otherwise it is false.
public KeyMetadata withEnabled(Boolean enabled)
Specifies whether the CMK is enabled. When KeyState is
Enabled this value is true, otherwise it is false.
Returns a reference to this object so that method calls can be chained together.
enabled -
Specifies whether the CMK is enabled. When
KeyState is Enabled this value is
true, otherwise it is false.
public String getDescription()
The description of the CMK.
Constraints:
Length: 0 - 8192
The description of the CMK.
public void setDescription(String description)
The description of the CMK.
Constraints:
Length: 0 - 8192
description - The description of the CMK.
public KeyMetadata withDescription(String description)
The description of the CMK.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 0 - 8192
description - The description of the CMK.
public String getKeyUsage()
The cryptographic operations for which you can use the CMK. Currently the
only allowed value is ENCRYPT_DECRYPT, which means you can
use the CMK for the Encrypt and Decrypt operations.
Constraints:
Allowed Values: ENCRYPT_DECRYPT
The cryptographic operations for which you can use the CMK.
Currently the only allowed value is ENCRYPT_DECRYPT,
which means you can use the CMK for the Encrypt and
Decrypt operations.
KeyUsageTypepublic void setKeyUsage(String keyUsage)
The cryptographic operations for which you can use the CMK. Currently the
only allowed value is ENCRYPT_DECRYPT, which means you can
use the CMK for the Encrypt and Decrypt operations.
Constraints:
Allowed Values: ENCRYPT_DECRYPT
keyUsage -
The cryptographic operations for which you can use the CMK.
Currently the only allowed value is
ENCRYPT_DECRYPT, which means you can use the CMK
for the Encrypt and Decrypt operations.
KeyUsageTypepublic KeyMetadata withKeyUsage(String keyUsage)
The cryptographic operations for which you can use the CMK. Currently the
only allowed value is ENCRYPT_DECRYPT, which means you can
use the CMK for the Encrypt and Decrypt operations.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: ENCRYPT_DECRYPT
keyUsage -
The cryptographic operations for which you can use the CMK.
Currently the only allowed value is
ENCRYPT_DECRYPT, which means you can use the CMK
for the Encrypt and Decrypt operations.
KeyUsageTypepublic void setKeyUsage(KeyUsageType keyUsage)
The cryptographic operations for which you can use the CMK. Currently the
only allowed value is ENCRYPT_DECRYPT, which means you can
use the CMK for the Encrypt and Decrypt operations.
Constraints:
Allowed Values: ENCRYPT_DECRYPT
keyUsage -
The cryptographic operations for which you can use the CMK.
Currently the only allowed value is
ENCRYPT_DECRYPT, which means you can use the CMK
for the Encrypt and Decrypt operations.
KeyUsageTypepublic KeyMetadata withKeyUsage(KeyUsageType keyUsage)
The cryptographic operations for which you can use the CMK. Currently the
only allowed value is ENCRYPT_DECRYPT, which means you can
use the CMK for the Encrypt and Decrypt operations.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: ENCRYPT_DECRYPT
keyUsage -
The cryptographic operations for which you can use the CMK.
Currently the only allowed value is
ENCRYPT_DECRYPT, which means you can use the CMK
for the Encrypt and Decrypt operations.
KeyUsageTypepublic String getKeyState()
The state of the 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.
Constraints:
Allowed Values: Enabled, Disabled, PendingDeletion, PendingImport
The state of the 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.
KeyStatepublic void setKeyState(String keyState)
The state of the 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.
Constraints:
Allowed Values: Enabled, Disabled, PendingDeletion, PendingImport
keyState - The state of the 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.
KeyStatepublic KeyMetadata withKeyState(String keyState)
The state of the 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 a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: Enabled, Disabled, PendingDeletion, PendingImport
keyState - The state of the 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.
KeyStatepublic void setKeyState(KeyState keyState)
The state of the 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.
Constraints:
Allowed Values: Enabled, Disabled, PendingDeletion, PendingImport
keyState - The state of the 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.
KeyStatepublic KeyMetadata withKeyState(KeyState keyState)
The state of the 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 a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: Enabled, Disabled, PendingDeletion, PendingImport
keyState - The state of the 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.
KeyStatepublic Date getDeletionDate()
The date and time after which AWS KMS deletes the CMK. This value is
present only when KeyState is PendingDeletion,
otherwise this value is omitted.
The date and time after which AWS KMS deletes the CMK. This value
is present only when KeyState is
PendingDeletion, otherwise this value is omitted.
public void setDeletionDate(Date deletionDate)
The date and time after which AWS KMS deletes the CMK. This value is
present only when KeyState is PendingDeletion,
otherwise this value is omitted.
deletionDate -
The date and time after which AWS KMS deletes the CMK. This
value is present only when KeyState is
PendingDeletion, otherwise this value is omitted.
public KeyMetadata withDeletionDate(Date deletionDate)
The date and time after which AWS KMS deletes the CMK. This value is
present only when KeyState is PendingDeletion,
otherwise this value is omitted.
Returns a reference to this object so that method calls can be chained together.
deletionDate -
The date and time after which AWS KMS deletes the CMK. This
value is present only when KeyState is
PendingDeletion, otherwise this value is omitted.
public Date getValidTo()
The time at which the imported key material expires. When the key
material expires, AWS KMS deletes the key material and the CMK becomes
unusable. This value is present only for CMKs whose Origin
is EXTERNAL and whose ExpirationModel is
KEY_MATERIAL_EXPIRES, otherwise this value is omitted.
The time at which the imported key material expires. When the key
material expires, AWS KMS deletes the key material and the CMK
becomes unusable. This value is present only for CMKs whose
Origin is EXTERNAL and whose
ExpirationModel is KEY_MATERIAL_EXPIRES
, otherwise this value is omitted.
public void setValidTo(Date validTo)
The time at which the imported key material expires. When the key
material expires, AWS KMS deletes the key material and the CMK becomes
unusable. This value is present only for CMKs whose Origin
is EXTERNAL and whose ExpirationModel is
KEY_MATERIAL_EXPIRES, otherwise this value is omitted.
validTo -
The time at which the imported key material expires. When the
key material expires, AWS KMS deletes the key material and the
CMK becomes unusable. This value is present only for CMKs
whose Origin is EXTERNAL and whose
ExpirationModel is
KEY_MATERIAL_EXPIRES, otherwise this value is
omitted.
public KeyMetadata withValidTo(Date validTo)
The time at which the imported key material expires. When the key
material expires, AWS KMS deletes the key material and the CMK becomes
unusable. This value is present only for CMKs whose Origin
is EXTERNAL and whose ExpirationModel is
KEY_MATERIAL_EXPIRES, otherwise this value is omitted.
Returns a reference to this object so that method calls can be chained together.
validTo -
The time at which the imported key material expires. When the
key material expires, AWS KMS deletes the key material and the
CMK becomes unusable. This value is present only for CMKs
whose Origin is EXTERNAL and whose
ExpirationModel is
KEY_MATERIAL_EXPIRES, otherwise this value is
omitted.
public String getOrigin()
The source of the CMK's key material. When this value is
AWS_KMS, AWS KMS created the key material. When this value
is EXTERNAL, the key material was imported from your
existing key management infrastructure or the CMK lacks key material.
Constraints:
Allowed Values: AWS_KMS, EXTERNAL
The source of the CMK's key material. When this value is
AWS_KMS, AWS KMS created the key material. When this
value is EXTERNAL, the key material was imported
from your existing key management infrastructure or the CMK lacks
key material.
OriginTypepublic void setOrigin(String origin)
The source of the CMK's key material. When this value is
AWS_KMS, AWS KMS created the key material. When this value
is EXTERNAL, the key material was imported from your
existing key management infrastructure or the CMK lacks key material.
Constraints:
Allowed Values: AWS_KMS, EXTERNAL
origin -
The source of the CMK's key material. When this value is
AWS_KMS, AWS KMS created the key material. When
this value is EXTERNAL, the key material was
imported from your existing key management infrastructure or
the CMK lacks key material.
OriginTypepublic KeyMetadata withOrigin(String origin)
The source of the CMK's key material. When this value is
AWS_KMS, AWS KMS created the key material. When this value
is EXTERNAL, the key material was imported from your
existing key management infrastructure or the CMK lacks key material.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: AWS_KMS, EXTERNAL
origin -
The source of the CMK's key material. When this value is
AWS_KMS, AWS KMS created the key material. When
this value is EXTERNAL, the key material was
imported from your existing key management infrastructure or
the CMK lacks key material.
OriginTypepublic void setOrigin(OriginType origin)
The source of the CMK's key material. When this value is
AWS_KMS, AWS KMS created the key material. When this value
is EXTERNAL, the key material was imported from your
existing key management infrastructure or the CMK lacks key material.
Constraints:
Allowed Values: AWS_KMS, EXTERNAL
origin -
The source of the CMK's key material. When this value is
AWS_KMS, AWS KMS created the key material. When
this value is EXTERNAL, the key material was
imported from your existing key management infrastructure or
the CMK lacks key material.
OriginTypepublic KeyMetadata withOrigin(OriginType origin)
The source of the CMK's key material. When this value is
AWS_KMS, AWS KMS created the key material. When this value
is EXTERNAL, the key material was imported from your
existing key management infrastructure or the CMK lacks key material.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: AWS_KMS, EXTERNAL
origin -
The source of the CMK's key material. When this value is
AWS_KMS, AWS KMS created the key material. When
this value is EXTERNAL, the key material was
imported from your existing key management infrastructure or
the CMK lacks key material.
OriginTypepublic String getExpirationModel()
Specifies whether the CMK's key material expires. This value is present
only when Origin is EXTERNAL, otherwise this
value is omitted.
Constraints:
Allowed Values: KEY_MATERIAL_EXPIRES, KEY_MATERIAL_DOES_NOT_EXPIRE
Specifies whether the CMK's key material expires. This value is
present only when Origin is EXTERNAL,
otherwise this value is omitted.
ExpirationModelTypepublic void setExpirationModel(String expirationModel)
Specifies whether the CMK's key material expires. This value is present
only when Origin is EXTERNAL, otherwise this
value is omitted.
Constraints:
Allowed Values: KEY_MATERIAL_EXPIRES, KEY_MATERIAL_DOES_NOT_EXPIRE
expirationModel -
Specifies whether the CMK's key material expires. This value
is present only when Origin is
EXTERNAL, otherwise this value is omitted.
ExpirationModelTypepublic KeyMetadata withExpirationModel(String expirationModel)
Specifies whether the CMK's key material expires. This value is present
only when Origin is EXTERNAL, otherwise this
value is omitted.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: KEY_MATERIAL_EXPIRES, KEY_MATERIAL_DOES_NOT_EXPIRE
expirationModel -
Specifies whether the CMK's key material expires. This value
is present only when Origin is
EXTERNAL, otherwise this value is omitted.
ExpirationModelTypepublic void setExpirationModel(ExpirationModelType expirationModel)
Specifies whether the CMK's key material expires. This value is present
only when Origin is EXTERNAL, otherwise this
value is omitted.
Constraints:
Allowed Values: KEY_MATERIAL_EXPIRES, KEY_MATERIAL_DOES_NOT_EXPIRE
expirationModel -
Specifies whether the CMK's key material expires. This value
is present only when Origin is
EXTERNAL, otherwise this value is omitted.
ExpirationModelTypepublic KeyMetadata withExpirationModel(ExpirationModelType expirationModel)
Specifies whether the CMK's key material expires. This value is present
only when Origin is EXTERNAL, otherwise this
value is omitted.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: KEY_MATERIAL_EXPIRES, KEY_MATERIAL_DOES_NOT_EXPIRE
expirationModel -
Specifies whether the CMK's key material expires. This value
is present only when Origin is
EXTERNAL, otherwise this value is omitted.
ExpirationModelTypepublic String getKeyManager()
The CMK's manager. CMKs are either customer-managed or AWS-managed. For more information about the difference, see Customer Master Keys in the AWS Key Management Service Developer Guide.
Constraints:
Allowed Values: AWS, CUSTOMER
The CMK's manager. CMKs are either customer-managed or AWS-managed. For more information about the difference, see Customer Master Keys in the AWS Key Management Service Developer Guide.
KeyManagerTypepublic void setKeyManager(String keyManager)
The CMK's manager. CMKs are either customer-managed or AWS-managed. For more information about the difference, see Customer Master Keys in the AWS Key Management Service Developer Guide.
Constraints:
Allowed Values: AWS, CUSTOMER
keyManager - The CMK's manager. CMKs are either customer-managed or AWS-managed. For more information about the difference, see Customer Master Keys in the AWS Key Management Service Developer Guide.
KeyManagerTypepublic KeyMetadata withKeyManager(String keyManager)
The CMK's manager. CMKs are either customer-managed or AWS-managed. For more information about the difference, see Customer Master Keys in the AWS Key Management Service Developer Guide.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: AWS, CUSTOMER
keyManager - The CMK's manager. CMKs are either customer-managed or AWS-managed. For more information about the difference, see Customer Master Keys in the AWS Key Management Service Developer Guide.
KeyManagerTypepublic void setKeyManager(KeyManagerType keyManager)
The CMK's manager. CMKs are either customer-managed or AWS-managed. For more information about the difference, see Customer Master Keys in the AWS Key Management Service Developer Guide.
Constraints:
Allowed Values: AWS, CUSTOMER
keyManager - The CMK's manager. CMKs are either customer-managed or AWS-managed. For more information about the difference, see Customer Master Keys in the AWS Key Management Service Developer Guide.
KeyManagerTypepublic KeyMetadata withKeyManager(KeyManagerType keyManager)
The CMK's manager. CMKs are either customer-managed or AWS-managed. For more information about the difference, see Customer Master Keys in the AWS Key Management Service Developer Guide.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: AWS, CUSTOMER
keyManager - The CMK's manager. CMKs are either customer-managed or AWS-managed. For more information about the difference, see Customer Master Keys in the AWS Key Management Service Developer Guide.
KeyManagerTypepublic String toString()
toString in class ObjectObject.toString()Copyright © 2018. All rights reserved.