#[non_exhaustive]
pub struct KeyMetadataBuilder { /* private fields */ }
Expand description

A builder for KeyMetadata.

Implementations§

source§

impl KeyMetadataBuilder

source

pub fn aws_account_id(self, input: impl Into<String>) -> Self

The twelve-digit account ID of the Amazon Web Services account that owns the KMS key.

source

pub fn set_aws_account_id(self, input: Option<String>) -> Self

The twelve-digit account ID of the Amazon Web Services account that owns the KMS key.

source

pub fn get_aws_account_id(&self) -> &Option<String>

The twelve-digit account ID of the Amazon Web Services account that owns the KMS key.

source

pub fn key_id(self, input: impl Into<String>) -> Self

The globally unique identifier for the KMS key.

This field is required.
source

pub fn set_key_id(self, input: Option<String>) -> Self

The globally unique identifier for the KMS key.

source

pub fn get_key_id(&self) -> &Option<String>

The globally unique identifier for the KMS key.

source

pub fn arn(self, input: impl Into<String>) -> Self

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.

source

pub fn set_arn(self, input: Option<String>) -> Self

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.

source

pub fn get_arn(&self) -> &Option<String>

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.

source

pub fn creation_date(self, input: DateTime) -> Self

The date and time when the KMS key was created.

source

pub fn set_creation_date(self, input: Option<DateTime>) -> Self

The date and time when the KMS key was created.

source

pub fn get_creation_date(&self) -> &Option<DateTime>

The date and time when the KMS key was created.

source

pub fn enabled(self, input: bool) -> Self

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

source

pub fn set_enabled(self, input: Option<bool>) -> Self

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

source

pub fn get_enabled(&self) -> &Option<bool>

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

source

pub fn description(self, input: impl Into<String>) -> Self

The description of the KMS key.

source

pub fn set_description(self, input: Option<String>) -> Self

The description of the KMS key.

source

pub fn get_description(&self) -> &Option<String>

The description of the KMS key.

source

pub fn key_usage(self, input: KeyUsageType) -> Self

The cryptographic operations for which you can use the KMS key.

source

pub fn set_key_usage(self, input: Option<KeyUsageType>) -> Self

The cryptographic operations for which you can use the KMS key.

source

pub fn get_key_usage(&self) -> &Option<KeyUsageType>

The cryptographic operations for which you can use the KMS key.

source

pub fn key_state(self, input: KeyState) -> Self

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.

source

pub fn set_key_state(self, input: Option<KeyState>) -> Self

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.

source

pub fn get_key_state(&self) -> &Option<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.

source

pub fn deletion_date(self, input: DateTime) -> Self

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.

source

pub fn set_deletion_date(self, input: Option<DateTime>) -> Self

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.

source

pub fn get_deletion_date(&self) -> &Option<DateTime>

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.

source

pub fn valid_to(self, input: DateTime) -> Self

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.

source

pub fn set_valid_to(self, input: Option<DateTime>) -> Self

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.

source

pub fn get_valid_to(&self) -> &Option<DateTime>

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.

source

pub fn origin(self, input: OriginType) -> Self

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.

source

pub fn set_origin(self, input: Option<OriginType>) -> Self

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.

source

pub fn get_origin(&self) -> &Option<OriginType>

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.

source

pub fn custom_key_store_id(self, input: impl Into<String>) -> Self

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.

source

pub fn set_custom_key_store_id(self, input: Option<String>) -> Self

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.

source

pub fn get_custom_key_store_id(&self) -> &Option<String>

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.

source

pub fn cloud_hsm_cluster_id(self, input: impl Into<String>) -> Self

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.

source

pub fn set_cloud_hsm_cluster_id(self, input: Option<String>) -> Self

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.

source

pub fn get_cloud_hsm_cluster_id(&self) -> &Option<String>

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.

source

pub fn expiration_model(self, input: ExpirationModelType) -> Self

Specifies whether the KMS key's key material expires. This value is present only when Origin is EXTERNAL, otherwise this value is omitted.

source

pub fn set_expiration_model(self, input: Option<ExpirationModelType>) -> Self

Specifies whether the KMS key's key material expires. This value is present only when Origin is EXTERNAL, otherwise this value is omitted.

source

pub fn get_expiration_model(&self) -> &Option<ExpirationModelType>

Specifies whether the KMS key's key material expires. This value is present only when Origin is EXTERNAL, otherwise this value is omitted.

source

pub fn key_manager(self, input: KeyManagerType) -> Self

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.

source

pub fn set_key_manager(self, input: Option<KeyManagerType>) -> Self

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.

source

pub fn get_key_manager(&self) -> &Option<KeyManagerType>

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.

source

pub fn customer_master_key_spec(self, input: CustomerMasterKeySpec) -> Self

👎Deprecated: This field has been deprecated. Instead, use the KeySpec field.

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.

source

pub fn set_customer_master_key_spec( self, input: Option<CustomerMasterKeySpec> ) -> Self

👎Deprecated: This field has been deprecated. Instead, use the KeySpec field.

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.

source

pub fn get_customer_master_key_spec(&self) -> &Option<CustomerMasterKeySpec>

👎Deprecated: This field has been deprecated. Instead, use the KeySpec field.

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.

source

pub fn key_spec(self, input: KeySpec) -> Self

Describes the type of key material in the KMS key.

source

pub fn set_key_spec(self, input: Option<KeySpec>) -> Self

Describes the type of key material in the KMS key.

source

pub fn get_key_spec(&self) -> &Option<KeySpec>

Describes the type of key material in the KMS key.

source

pub fn encryption_algorithms(self, input: EncryptionAlgorithmSpec) -> Self

Appends an item to encryption_algorithms.

To override the contents of this collection use set_encryption_algorithms.

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.

source

pub fn set_encryption_algorithms( self, input: Option<Vec<EncryptionAlgorithmSpec>> ) -> Self

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.

source

pub fn get_encryption_algorithms(&self) -> &Option<Vec<EncryptionAlgorithmSpec>>

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.

source

pub fn signing_algorithms(self, input: SigningAlgorithmSpec) -> Self

Appends an item to signing_algorithms.

To override the contents of this collection use set_signing_algorithms.

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.

source

pub fn set_signing_algorithms( self, input: Option<Vec<SigningAlgorithmSpec>> ) -> Self

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.

source

pub fn get_signing_algorithms(&self) -> &Option<Vec<SigningAlgorithmSpec>>

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.

source

pub fn multi_region(self, input: bool) -> Self

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.

source

pub fn set_multi_region(self, input: Option<bool>) -> Self

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.

source

pub fn get_multi_region(&self) -> &Option<bool>

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.

source

pub fn multi_region_configuration(self, input: MultiRegionConfiguration) -> Self

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.

source

pub fn set_multi_region_configuration( self, input: Option<MultiRegionConfiguration> ) -> Self

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.

source

pub fn get_multi_region_configuration( &self ) -> &Option<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.

source

pub fn pending_deletion_window_in_days(self, input: i32) -> Self

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.

source

pub fn set_pending_deletion_window_in_days(self, input: Option<i32>) -> Self

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.

source

pub fn get_pending_deletion_window_in_days(&self) -> &Option<i32>

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.

source

pub fn mac_algorithms(self, input: MacAlgorithmSpec) -> Self

Appends an item to mac_algorithms.

To override the contents of this collection use set_mac_algorithms.

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.

source

pub fn set_mac_algorithms(self, input: Option<Vec<MacAlgorithmSpec>>) -> Self

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.

source

pub fn get_mac_algorithms(&self) -> &Option<Vec<MacAlgorithmSpec>>

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.

source

pub fn xks_key_configuration(self, input: XksKeyConfigurationType) -> Self

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.

source

pub fn set_xks_key_configuration( self, input: Option<XksKeyConfigurationType> ) -> Self

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.

source

pub fn get_xks_key_configuration(&self) -> &Option<XksKeyConfigurationType>

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.

source

pub fn build(self) -> Result<KeyMetadata, BuildError>

Consumes the builder and constructs a KeyMetadata. This method will fail if any of the following fields are not set:

Trait Implementations§

source§

impl Clone for KeyMetadataBuilder

source§

fn clone(&self) -> KeyMetadataBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for KeyMetadataBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for KeyMetadataBuilder

source§

fn default() -> KeyMetadataBuilder

Returns the “default value” for a type. Read more
source§

impl PartialEq for KeyMetadataBuilder

source§

fn eq(&self, other: &KeyMetadataBuilder) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for KeyMetadataBuilder

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more