pub struct CreateKeyFluentBuilder { /* private fields */ }Expand description
Fluent builder constructing a request to CreateKey.
Create a new Branch Key in the Key Store. Additionally create a Beacon Key that is tied to this Branch Key.
Implementations§
Source§impl CreateKeyFluentBuilder
impl CreateKeyFluentBuilder
Sourcepub fn as_input(&self) -> &CreateKeyInputBuilder
pub fn as_input(&self) -> &CreateKeyInputBuilder
Access the CreateKey as a reference.
Sourcepub async fn send(self) -> Result<CreateKeyOutput, Error>
pub async fn send(self) -> Result<CreateKeyOutput, Error>
Sends the request and returns the response.
Examples found in repository?
examples/keyring/aws_kms_hierarchical/create_branch_key_id.rs (line 35)
16pub async fn create_branch_key_id(
17 key_store_table_name: &str,
18 logical_key_store_name: &str,
19 kms_key_arn: &str,
20) -> Result<String, crate::BoxError> {
21 // Create a Key Store
22 // The KMS Configuration you use in the KeyStore MUST have the right access to the resources in the KeyStore.
23 let sdk_config = aws_config::load_defaults(aws_config::BehaviorVersion::latest()).await;
24 let key_store_config = KeyStoreConfig::builder()
25 .kms_client(aws_sdk_kms::Client::new(&sdk_config))
26 .ddb_client(aws_sdk_dynamodb::Client::new(&sdk_config))
27 .ddb_table_name(key_store_table_name)
28 .logical_key_store_name(logical_key_store_name)
29 .kms_configuration(KmsConfiguration::KmsKeyArn(kms_key_arn.to_string()))
30 .build()?;
31
32 let keystore = keystore_client::Client::from_conf(key_store_config)?;
33
34 // Create a branch key identifier with the AWS KMS Key configured in the KeyStore Configuration.
35 let new_key = keystore.create_key().send().await?;
36 Ok(new_key.branch_key_identifier.unwrap())
37}Sourcepub fn branch_key_identifier(self, input: impl Into<String>) -> Self
pub fn branch_key_identifier(self, input: impl Into<String>) -> Self
The identifier for the created Branch Key.
Sourcepub fn set_branch_key_identifier(self, input: Option<String>) -> Self
pub fn set_branch_key_identifier(self, input: Option<String>) -> Self
The identifier for the created Branch Key.
Sourcepub fn get_branch_key_identifier(&self) -> &Option<String>
pub fn get_branch_key_identifier(&self) -> &Option<String>
The identifier for the created Branch Key.
Sourcepub fn encryption_context(
self,
input: impl Into<HashMap<String, String>>,
) -> Self
pub fn encryption_context( self, input: impl Into<HashMap<String, String>>, ) -> Self
Custom encryption context for the Branch Key. Required if branchKeyIdentifier is set.
Trait Implementations§
Source§impl Clone for CreateKeyFluentBuilder
impl Clone for CreateKeyFluentBuilder
Source§fn clone(&self) -> CreateKeyFluentBuilder
fn clone(&self) -> CreateKeyFluentBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CreateKeyFluentBuilder
impl !RefUnwindSafe for CreateKeyFluentBuilder
impl Send for CreateKeyFluentBuilder
impl Sync for CreateKeyFluentBuilder
impl Unpin for CreateKeyFluentBuilder
impl !UnwindSafe for CreateKeyFluentBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.