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:
  • Constructor Details

    • KeyMetadata

      public KeyMetadata()
  • Method Details

    • 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 is Enabled this value is true, otherwise it is false.

      Parameters:
      enabled - Specifies whether the key is enabled. When KeyState is Enabled this value is true, otherwise it is false.
    • getEnabled

      public Boolean getEnabled()

      Specifies whether the key is enabled. When KeyState is Enabled this value is true, otherwise it is false.

      Returns:
      Specifies whether the key is enabled. When KeyState is Enabled this value is true, otherwise it is false.
    • withEnabled

      public KeyMetadata withEnabled(Boolean enabled)

      Specifies whether the key is enabled. When KeyState is Enabled this value is true, otherwise it is false.

      Parameters:
      enabled - Specifies whether the key is enabled. When KeyState is Enabled 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 is Enabled this value is true, otherwise it is false.

      Returns:
      Specifies whether the key is enabled. When KeyState is Enabled 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 is ENCRYPT_DECRYPT, which means you can use the key for the Encrypt and Decrypt operations.
      See Also:
    • 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:
    • 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 is ENCRYPT_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:
    • 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 is ENCRYPT_DECRYPT, which means you can use the key for the Encrypt and Decrypt operations.
      See Also:
    • 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 is ENCRYPT_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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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 is PendingDeletion, 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 when KeyState is PendingDeletion, 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 is PendingDeletion, 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 is PendingDeletion, 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 is PendingDeletion, 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 when KeyState is PendingDeletion, 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 class Object
      Returns:
      A string representation of this object.
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public KeyMetadata clone()
      Overrides:
      clone in class Object