@Generated(value="software.amazon.awssdk:codegen") public final class KeyMetadata extends Object implements SdkPojo, Serializable, ToCopyableBuilder<KeyMetadata.Builder,KeyMetadata>
Contains metadata about a KMS key.
This data type is used as a response element for the CreateKey, DescribeKey, and ReplicateKey operations.
| Modifier and Type | Class and Description |
|---|---|
static interface |
KeyMetadata.Builder |
| Modifier and Type | Method and Description |
|---|---|
String |
arn()
The Amazon Resource Name (ARN) of the KMS key.
|
String |
awsAccountId()
The twelve-digit account ID of the Amazon Web Services account that owns the KMS key.
|
static KeyMetadata.Builder |
builder() |
String |
cloudHsmClusterId()
The cluster ID of the CloudHSM cluster that contains the key material for the KMS key.
|
Instant |
creationDate()
The date and time when the KMS key was created.
|
CustomerMasterKeySpec |
customerMasterKeySpec()
Deprecated.
This field has been deprecated. Instead, use the KeySpec field.
|
String |
customerMasterKeySpecAsString()
Deprecated.
This field has been deprecated. Instead, use the KeySpec field.
|
String |
customKeyStoreId()
A unique identifier for the custom key store
that contains the KMS key.
|
Instant |
deletionDate()
The date and time after which KMS deletes this KMS key.
|
String |
description()
The description of the KMS key.
|
Boolean |
enabled()
Specifies whether the KMS key is enabled.
|
List<EncryptionAlgorithmSpec> |
encryptionAlgorithms()
The encryption algorithms that the KMS key supports.
|
List<String> |
encryptionAlgorithmsAsStrings()
The encryption algorithms that the KMS key supports.
|
boolean |
equals(Object obj) |
boolean |
equalsBySdkFields(Object obj) |
ExpirationModelType |
expirationModel()
Specifies whether the KMS key's key material expires.
|
String |
expirationModelAsString()
Specifies whether the KMS key's key material expires.
|
<T> Optional<T> |
getValueForField(String fieldName,
Class<T> clazz) |
boolean |
hasEncryptionAlgorithms()
For responses, this returns true if the service returned a value for the EncryptionAlgorithms property.
|
int |
hashCode() |
boolean |
hasMacAlgorithms()
For responses, this returns true if the service returned a value for the MacAlgorithms property.
|
boolean |
hasSigningAlgorithms()
For responses, this returns true if the service returned a value for the SigningAlgorithms property.
|
String |
keyId()
The globally unique identifier for the KMS key.
|
KeyManagerType |
keyManager()
The manager of the KMS key.
|
String |
keyManagerAsString()
The manager of the KMS key.
|
KeySpec |
keySpec()
Describes the type of key material in the KMS key.
|
String |
keySpecAsString()
Describes the type of key material in the KMS key.
|
KeyState |
keyState()
The current status of the KMS key.
|
String |
keyStateAsString()
The current status of the KMS key.
|
KeyUsageType |
keyUsage()
The
cryptographic operations for which you can use the KMS key.
|
String |
keyUsageAsString()
The
cryptographic operations for which you can use the KMS key.
|
List<MacAlgorithmSpec> |
macAlgorithms()
The message authentication code (MAC) algorithm that the HMAC KMS key supports.
|
List<String> |
macAlgorithmsAsStrings()
The message authentication code (MAC) algorithm that the HMAC KMS key supports.
|
Boolean |
multiRegion()
Indicates whether the KMS key is a multi-Region (
True) or regional (False) key. |
MultiRegionConfiguration |
multiRegionConfiguration()
Lists the primary and replica keys in same multi-Region key.
|
OriginType |
origin()
The source of the key material for the KMS key.
|
String |
originAsString()
The source of the key material for the KMS key.
|
Integer |
pendingDeletionWindowInDays()
The waiting period before the primary key in a multi-Region key is deleted.
|
List<SdkField<?>> |
sdkFields() |
static Class<? extends KeyMetadata.Builder> |
serializableBuilderClass() |
List<SigningAlgorithmSpec> |
signingAlgorithms()
The signing algorithms that the KMS key supports.
|
List<String> |
signingAlgorithmsAsStrings()
The signing algorithms that the KMS key supports.
|
KeyMetadata.Builder |
toBuilder() |
String |
toString()
Returns a string representation of this object.
|
Instant |
validTo()
The time at which the imported key material expires.
|
XksKeyConfigurationType |
xksKeyConfiguration()
Information about the external key that is associated with a KMS key in an external key store.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcopypublic final String awsAccountId()
The twelve-digit account ID of the Amazon Web Services account that owns the KMS key.
public final String keyId()
The globally unique identifier for the KMS key.
public final String arn()
The Amazon Resource Name (ARN) of the KMS key. For examples, see Key Management Service (KMS) in the Example ARNs section of the Amazon Web Services General Reference.
public final Instant creationDate()
The date and time when the KMS key was created.
public final Boolean enabled()
Specifies whether the KMS key is enabled. When KeyState is Enabled this value is true,
otherwise it is false.
KeyState is Enabled this value
is true, otherwise it is false.public final String description()
The description of the KMS key.
public final KeyUsageType keyUsage()
The cryptographic operations for which you can use the KMS key.
If the service returns an enum value that is not available in the current SDK version, keyUsage will
return KeyUsageType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from
keyUsageAsString().
KeyUsageTypepublic final String keyUsageAsString()
The cryptographic operations for which you can use the KMS key.
If the service returns an enum value that is not available in the current SDK version, keyUsage will
return KeyUsageType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from
keyUsageAsString().
KeyUsageTypepublic final KeyState keyState()
The current status of the KMS key.
For more information about how key state affects the use of a KMS key, see Key states of KMS keys in the Key Management Service Developer Guide.
If the service returns an enum value that is not available in the current SDK version, keyState will
return KeyState.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from
keyStateAsString().
For more information about how key state affects the use of a KMS key, see Key states of KMS keys in the Key Management Service Developer Guide.
KeyStatepublic final String keyStateAsString()
The current status of the KMS key.
For more information about how key state affects the use of a KMS key, see Key states of KMS keys in the Key Management Service Developer Guide.
If the service returns an enum value that is not available in the current SDK version, keyState will
return KeyState.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from
keyStateAsString().
For more information about how key state affects the use of a KMS key, see Key states of KMS keys in the Key Management Service Developer Guide.
KeyStatepublic final Instant deletionDate()
The date and time after which KMS deletes this KMS key. This value is present only when the KMS key is scheduled
for deletion, that is, when its KeyState is PendingDeletion.
When the primary key in a multi-Region key is scheduled for deletion but still has replica keys, its key state is
PendingReplicaDeletion and the length of its waiting period is displayed in the
PendingDeletionWindowInDays field.
KeyState is PendingDeletion.
When the primary key in a multi-Region key is scheduled for deletion but still has replica keys, its key
state is PendingReplicaDeletion and the length of its waiting period is displayed in the
PendingDeletionWindowInDays field.
public final Instant validTo()
The time at which the imported key material expires. When the key material expires, KMS deletes the key material
and the KMS key becomes unusable. This value is present only for KMS keys whose Origin is
EXTERNAL and whose ExpirationModel is KEY_MATERIAL_EXPIRES, otherwise this
value is omitted.
Origin is EXTERNAL and whose ExpirationModel is
KEY_MATERIAL_EXPIRES, otherwise this value is omitted.public final OriginType origin()
The source of the key material for the KMS key. When this value is AWS_KMS, KMS created the key
material. When this value is EXTERNAL, the key material was imported or the KMS key doesn't have any
key material. When this value is AWS_CLOUDHSM, the key material was created in the CloudHSM cluster
associated with a custom key store.
If the service returns an enum value that is not available in the current SDK version, origin will
return OriginType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from
originAsString().
AWS_KMS, KMS created the
key material. When this value is EXTERNAL, the key material was imported or the KMS key
doesn't have any key material. When this value is AWS_CLOUDHSM, the key material was created
in the CloudHSM cluster associated with a custom key store.OriginTypepublic final String originAsString()
The source of the key material for the KMS key. When this value is AWS_KMS, KMS created the key
material. When this value is EXTERNAL, the key material was imported or the KMS key doesn't have any
key material. When this value is AWS_CLOUDHSM, the key material was created in the CloudHSM cluster
associated with a custom key store.
If the service returns an enum value that is not available in the current SDK version, origin will
return OriginType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from
originAsString().
AWS_KMS, KMS created the
key material. When this value is EXTERNAL, the key material was imported or the KMS key
doesn't have any key material. When this value is AWS_CLOUDHSM, the key material was created
in the CloudHSM cluster associated with a custom key store.OriginTypepublic final String customKeyStoreId()
A unique identifier for the custom key store that contains the KMS key. This field is present only when the KMS key is created in a custom key store.
public final String cloudHsmClusterId()
The cluster ID of the CloudHSM cluster that contains the key material for the KMS key. When you create a KMS key in an CloudHSM custom key store, KMS creates the key material for the KMS key in the associated CloudHSM cluster. This field is present only when the KMS key is created in an CloudHSM key store.
public final ExpirationModelType expirationModel()
Specifies whether the KMS key's key material expires. This value is present only when Origin is
EXTERNAL, otherwise this value is omitted.
If the service returns an enum value that is not available in the current SDK version, expirationModel
will return ExpirationModelType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is
available from expirationModelAsString().
Origin
is EXTERNAL, otherwise this value is omitted.ExpirationModelTypepublic final String expirationModelAsString()
Specifies whether the KMS key's key material expires. This value is present only when Origin is
EXTERNAL, otherwise this value is omitted.
If the service returns an enum value that is not available in the current SDK version, expirationModel
will return ExpirationModelType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is
available from expirationModelAsString().
Origin
is EXTERNAL, otherwise this value is omitted.ExpirationModelTypepublic final KeyManagerType keyManager()
The manager of the KMS key. KMS keys in your Amazon Web Services account are either customer managed or Amazon Web Services managed. For more information about the difference, see KMS keys in the Key Management Service Developer Guide.
If the service returns an enum value that is not available in the current SDK version, keyManager will
return KeyManagerType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from
keyManagerAsString().
KeyManagerTypepublic final String keyManagerAsString()
The manager of the KMS key. KMS keys in your Amazon Web Services account are either customer managed or Amazon Web Services managed. For more information about the difference, see KMS keys in the Key Management Service Developer Guide.
If the service returns an enum value that is not available in the current SDK version, keyManager will
return KeyManagerType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from
keyManagerAsString().
KeyManagerType@Deprecated public final CustomerMasterKeySpec customerMasterKeySpec()
Instead, use the KeySpec field.
The KeySpec and CustomerMasterKeySpec fields have the same value. We recommend that you
use the KeySpec field in your code. However, to avoid breaking changes, KMS supports both fields.
If the service returns an enum value that is not available in the current SDK version,
customerMasterKeySpec will return CustomerMasterKeySpec.UNKNOWN_TO_SDK_VERSION. The raw value
returned by the service is available from customerMasterKeySpecAsString().
KeySpec field.
The KeySpec and CustomerMasterKeySpec fields have the same value. We recommend
that you use the KeySpec field in your code. However, to avoid breaking changes, KMS
supports both fields.
CustomerMasterKeySpec@Deprecated public final String customerMasterKeySpecAsString()
Instead, use the KeySpec field.
The KeySpec and CustomerMasterKeySpec fields have the same value. We recommend that you
use the KeySpec field in your code. However, to avoid breaking changes, KMS supports both fields.
If the service returns an enum value that is not available in the current SDK version,
customerMasterKeySpec will return CustomerMasterKeySpec.UNKNOWN_TO_SDK_VERSION. The raw value
returned by the service is available from customerMasterKeySpecAsString().
KeySpec field.
The KeySpec and CustomerMasterKeySpec fields have the same value. We recommend
that you use the KeySpec field in your code. However, to avoid breaking changes, KMS
supports both fields.
CustomerMasterKeySpecpublic final KeySpec keySpec()
Describes the type of key material in the KMS key.
If the service returns an enum value that is not available in the current SDK version, keySpec will
return KeySpec.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from
keySpecAsString().
KeySpecpublic final String keySpecAsString()
Describes the type of key material in the KMS key.
If the service returns an enum value that is not available in the current SDK version, keySpec will
return KeySpec.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from
keySpecAsString().
KeySpecpublic final List<EncryptionAlgorithmSpec> encryptionAlgorithms()
The encryption algorithms that the KMS key supports. You cannot use the KMS key with other encryption algorithms within KMS.
This value is present only when the KeyUsage of the KMS key is ENCRYPT_DECRYPT.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that
you can differentiate between null and empty), you can use the hasEncryptionAlgorithms() method.
This value is present only when the KeyUsage of the KMS key is ENCRYPT_DECRYPT.
public final boolean hasEncryptionAlgorithms()
isEmpty() method on the property).
This is useful because the SDK will never return a null collection or map, but you may need to differentiate
between the service returning nothing (or null) and the service returning an empty collection or map. For
requests, this returns true if a value for the property was specified in the request builder, and false if a
value was not specified.public final List<String> encryptionAlgorithmsAsStrings()
The encryption algorithms that the KMS key supports. You cannot use the KMS key with other encryption algorithms within KMS.
This value is present only when the KeyUsage of the KMS key is ENCRYPT_DECRYPT.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that
you can differentiate between null and empty), you can use the hasEncryptionAlgorithms() method.
This value is present only when the KeyUsage of the KMS key is ENCRYPT_DECRYPT.
public final List<SigningAlgorithmSpec> signingAlgorithms()
The signing algorithms that the KMS key supports. You cannot use the KMS key with other signing algorithms within KMS.
This field appears only when the KeyUsage of the KMS key is SIGN_VERIFY.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that
you can differentiate between null and empty), you can use the hasSigningAlgorithms() method.
This field appears only when the KeyUsage of the KMS key is SIGN_VERIFY.
public final boolean hasSigningAlgorithms()
isEmpty() method on the property).
This is useful because the SDK will never return a null collection or map, but you may need to differentiate
between the service returning nothing (or null) and the service returning an empty collection or map. For
requests, this returns true if a value for the property was specified in the request builder, and false if a
value was not specified.public final List<String> signingAlgorithmsAsStrings()
The signing algorithms that the KMS key supports. You cannot use the KMS key with other signing algorithms within KMS.
This field appears only when the KeyUsage of the KMS key is SIGN_VERIFY.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that
you can differentiate between null and empty), you can use the hasSigningAlgorithms() method.
This field appears only when the KeyUsage of the KMS key is SIGN_VERIFY.
public final Boolean multiRegion()
Indicates whether the KMS key is a multi-Region (True) or regional (False) key. This
value is True for multi-Region primary and replica keys and False for regional KMS
keys.
For more information about multi-Region keys, see Multi-Region keys in KMS in the Key Management Service Developer Guide.
True) or regional (False) key.
This value is True for multi-Region primary and replica keys and False for
regional KMS keys.
For more information about multi-Region keys, see Multi-Region keys in KMS in the Key Management Service Developer Guide.
public final MultiRegionConfiguration multiRegionConfiguration()
Lists the primary and replica keys in same multi-Region key. This field is present only when the value of the
MultiRegion field is True.
For more information about any listed KMS key, use the DescribeKey operation.
MultiRegionKeyType indicates whether the KMS key is a PRIMARY or REPLICA
key.
PrimaryKey displays the key ARN and Region of the primary key. This field displays the current KMS
key if it is the primary key.
ReplicaKeys displays the key ARNs and Regions of all replica keys. This field includes the current
KMS key if it is a replica key.
MultiRegion field is True.
For more information about any listed KMS key, use the DescribeKey operation.
MultiRegionKeyType indicates whether the KMS key is a PRIMARY or
REPLICA key.
PrimaryKey displays the key ARN and Region of the primary key. This field displays the
current KMS key if it is the primary key.
ReplicaKeys displays the key ARNs and Regions of all replica keys. This field includes the
current KMS key if it is a replica key.
public final Integer pendingDeletionWindowInDays()
The waiting period before the primary key in a multi-Region key is deleted. This waiting period begins when the
last of its replica keys is deleted. This value is present only when the KeyState of the KMS key is
PendingReplicaDeletion. That indicates that the KMS key is the primary key in a multi-Region key, it
is scheduled for deletion, and it still has existing replica keys.
When a single-Region KMS key or a multi-Region replica key is scheduled for deletion, its deletion date is
displayed in the DeletionDate field. However, when the primary key in a multi-Region key is
scheduled for deletion, its waiting period doesn't begin until all of its replica keys are deleted. This value
displays that waiting period. When the last replica key in the multi-Region key is deleted, the
KeyState of the scheduled primary key changes from PendingReplicaDeletion to
PendingDeletion and the deletion date appears in the DeletionDate field.
KeyState
of the KMS key is PendingReplicaDeletion. That indicates that the KMS key is the primary key
in a multi-Region key, it is scheduled for deletion, and it still has existing replica keys.
When a single-Region KMS key or a multi-Region replica key is scheduled for deletion, its deletion date
is displayed in the DeletionDate field. However, when the primary key in a multi-Region key
is scheduled for deletion, its waiting period doesn't begin until all of its replica keys are deleted.
This value displays that waiting period. When the last replica key in the multi-Region key is deleted,
the KeyState of the scheduled primary key changes from PendingReplicaDeletion
to PendingDeletion and the deletion date appears in the DeletionDate field.
public final List<MacAlgorithmSpec> macAlgorithms()
The message authentication code (MAC) algorithm that the HMAC KMS key supports.
This value is present only when the KeyUsage of the KMS key is GENERATE_VERIFY_MAC.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that
you can differentiate between null and empty), you can use the hasMacAlgorithms() method.
This value is present only when the KeyUsage of the KMS key is
GENERATE_VERIFY_MAC.
public final boolean hasMacAlgorithms()
isEmpty() method on the property).
This is useful because the SDK will never return a null collection or map, but you may need to differentiate
between the service returning nothing (or null) and the service returning an empty collection or map. For
requests, this returns true if a value for the property was specified in the request builder, and false if a
value was not specified.public final List<String> macAlgorithmsAsStrings()
The message authentication code (MAC) algorithm that the HMAC KMS key supports.
This value is present only when the KeyUsage of the KMS key is GENERATE_VERIFY_MAC.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that
you can differentiate between null and empty), you can use the hasMacAlgorithms() method.
This value is present only when the KeyUsage of the KMS key is
GENERATE_VERIFY_MAC.
public final XksKeyConfigurationType xksKeyConfiguration()
Information about the external key that is associated with a KMS key in an external key store.
For more information, see External key in the Key Management Service Developer Guide.
For more information, see External key in the Key Management Service Developer Guide.
public KeyMetadata.Builder toBuilder()
toBuilder in interface ToCopyableBuilder<KeyMetadata.Builder,KeyMetadata>public static KeyMetadata.Builder builder()
public static Class<? extends KeyMetadata.Builder> serializableBuilderClass()
public final boolean equalsBySdkFields(Object obj)
equalsBySdkFields in interface SdkPojopublic final String toString()
Copyright © 2023. All rights reserved.