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/create_keystore_key.rs (line 48)
25pub async fn keystore_create_key() -> Result<String, crate::BoxError> {
26 let key_store_table_name = test_utils::TEST_KEYSTORE_NAME;
27 let logical_key_store_name = test_utils::TEST_LOGICAL_KEYSTORE_NAME;
28 let kms_key_arn = test_utils::TEST_KEYSTORE_KMS_KEY_ID;
29
30 // 1. Configure your KeyStore resource.
31 // This SHOULD be the same configuration that was used to create the DDB table
32 // in the "Create KeyStore Table Example".
33 let sdk_config = aws_config::load_defaults(aws_config::BehaviorVersion::latest()).await;
34 let key_store_config = KeyStoreConfig::builder()
35 .kms_client(aws_sdk_kms::Client::new(&sdk_config))
36 .ddb_client(aws_sdk_dynamodb::Client::new(&sdk_config))
37 .ddb_table_name(key_store_table_name)
38 .logical_key_store_name(logical_key_store_name)
39 .kms_configuration(KmsConfiguration::KmsKeyArn(kms_key_arn.to_string()))
40 .build()?;
41
42 let keystore = keystore_client::Client::from_conf(key_store_config)?;
43
44 // 2. Create a new branch key and beacon key in our KeyStore.
45 // Both the branch key and the beacon key will share an Id.
46 // This creation is eventually consistent.
47
48 let new_key = keystore.create_key().send().await?;
49 Ok(new_key.branch_key_identifier.unwrap())
50}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.