public class KeyMetadata
extends java.lang.Object
implements java.io.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(java.lang.Object obj) |
java.lang.String |
getArn()
The Amazon Resource Name (ARN) of the CMK.
|
java.lang.String |
getAWSAccountId()
The twelve-digit account ID of the AWS account that owns the CMK.
|
java.util.Date |
getCreationDate()
The date and time when the CMK was created.
|
java.util.Date |
getDeletionDate()
The date and time after which AWS KMS deletes the CMK.
|
java.lang.String |
getDescription()
The description of the CMK.
|
java.lang.Boolean |
getEnabled()
Specifies whether the CMK is enabled.
|
java.lang.String |
getExpirationModel()
Specifies whether the CMK's key material expires.
|
java.lang.String |
getKeyId()
The globally unique identifier for the CMK.
|
java.lang.String |
getKeyState()
The state of the CMK.
|
java.lang.String |
getKeyUsage()
The cryptographic operations for which you can use the CMK.
|
java.lang.String |
getOrigin()
The source of the CMK's key material.
|
java.util.Date |
getValidTo()
The time at which the imported key material expires.
|
int |
hashCode() |
java.lang.Boolean |
isEnabled()
Specifies whether the CMK is enabled.
|
void |
setArn(java.lang.String arn)
The Amazon Resource Name (ARN) of the CMK.
|
void |
setAWSAccountId(java.lang.String aWSAccountId)
The twelve-digit account ID of the AWS account that owns the CMK.
|
void |
setCreationDate(java.util.Date creationDate)
The date and time when the CMK was created.
|
void |
setDeletionDate(java.util.Date deletionDate)
The date and time after which AWS KMS deletes the CMK.
|
void |
setDescription(java.lang.String description)
The description of the CMK.
|
void |
setEnabled(java.lang.Boolean enabled)
Specifies whether the CMK is enabled.
|
void |
setExpirationModel(ExpirationModelType expirationModel)
Specifies whether the CMK's key material expires.
|
void |
setExpirationModel(java.lang.String expirationModel)
Specifies whether the CMK's key material expires.
|
void |
setKeyId(java.lang.String keyId)
The globally unique identifier for the CMK.
|
void |
setKeyState(KeyState keyState)
The state of the CMK.
|
void |
setKeyState(java.lang.String keyState)
The state of the CMK.
|
void |
setKeyUsage(KeyUsageType keyUsage)
The cryptographic operations for which you can use the CMK.
|
void |
setKeyUsage(java.lang.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(java.lang.String origin)
The source of the CMK's key material.
|
void |
setValidTo(java.util.Date validTo)
The time at which the imported key material expires.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
KeyMetadata |
withArn(java.lang.String arn)
The Amazon Resource Name (ARN) of the CMK.
|
KeyMetadata |
withAWSAccountId(java.lang.String aWSAccountId)
The twelve-digit account ID of the AWS account that owns the CMK.
|
KeyMetadata |
withCreationDate(java.util.Date creationDate)
The date and time when the CMK was created.
|
KeyMetadata |
withDeletionDate(java.util.Date deletionDate)
The date and time after which AWS KMS deletes the CMK.
|
KeyMetadata |
withDescription(java.lang.String description)
The description of the CMK.
|
KeyMetadata |
withEnabled(java.lang.Boolean enabled)
Specifies whether the CMK is enabled.
|
KeyMetadata |
withExpirationModel(ExpirationModelType expirationModel)
Specifies whether the CMK's key material expires.
|
KeyMetadata |
withExpirationModel(java.lang.String expirationModel)
Specifies whether the CMK's key material expires.
|
KeyMetadata |
withKeyId(java.lang.String keyId)
The globally unique identifier for the CMK.
|
KeyMetadata |
withKeyState(KeyState keyState)
The state of the CMK.
|
KeyMetadata |
withKeyState(java.lang.String keyState)
The state of the CMK.
|
KeyMetadata |
withKeyUsage(KeyUsageType keyUsage)
The cryptographic operations for which you can use the CMK.
|
KeyMetadata |
withKeyUsage(java.lang.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(java.lang.String origin)
The source of the CMK's key material.
|
KeyMetadata |
withValidTo(java.util.Date validTo)
The time at which the imported key material expires.
|
public java.lang.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(java.lang.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(java.lang.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 java.lang.String getKeyId()
The globally unique identifier for the CMK.
Constraints:
Length: 1 - 256
The globally unique identifier for the CMK.
public void setKeyId(java.lang.String keyId)
The globally unique identifier for the CMK.
Constraints:
Length: 1 - 256
keyId
- The globally unique identifier for the CMK.
public KeyMetadata withKeyId(java.lang.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 - 256
keyId
- The globally unique identifier for the CMK.
public java.lang.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(java.lang.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(java.lang.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 java.util.Date getCreationDate()
The date and time when the CMK was created.
The date and time when the CMK was created.
public void setCreationDate(java.util.Date creationDate)
The date and time when the CMK was created.
creationDate
- The date and time when the CMK was created.
public KeyMetadata withCreationDate(java.util.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 java.lang.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 java.lang.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(java.lang.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(java.lang.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 java.lang.String getDescription()
The description of the CMK.
Constraints:
Length: 0 - 8192
The description of the CMK.
public void setDescription(java.lang.String description)
The description of the CMK.
Constraints:
Length: 0 - 8192
description
- The description of the CMK.
public KeyMetadata withDescription(java.lang.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 java.lang.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.
KeyUsageType
public void setKeyUsage(java.lang.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.
KeyUsageType
public KeyMetadata withKeyUsage(java.lang.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.
KeyUsageType
public 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.
KeyUsageType
public 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.
KeyUsageType
public java.lang.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.
KeyState
public void setKeyState(java.lang.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.
KeyState
public KeyMetadata withKeyState(java.lang.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.
KeyState
public 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.
KeyState
public 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.
KeyState
public java.util.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(java.util.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(java.util.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 java.util.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(java.util.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(java.util.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 java.lang.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.
OriginType
public void setOrigin(java.lang.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.
OriginType
public KeyMetadata withOrigin(java.lang.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.
OriginType
public 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.
OriginType
public 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.
OriginType
public java.lang.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.
ExpirationModelType
public void setExpirationModel(java.lang.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.
ExpirationModelType
public KeyMetadata withExpirationModel(java.lang.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.
ExpirationModelType
public 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.
ExpirationModelType
public 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.
ExpirationModelType
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.