aws_sdk_paymentcryptography/client/
create_key.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`CreateKey`](crate::operation::create_key::builders::CreateKeyFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`key_attributes(KeyAttributes)`](crate::operation::create_key::builders::CreateKeyFluentBuilder::key_attributes) / [`set_key_attributes(Option<KeyAttributes>)`](crate::operation::create_key::builders::CreateKeyFluentBuilder::set_key_attributes):<br>required: **true**<br><p>The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after the key is created.</p><br>
7    ///   - [`key_check_value_algorithm(KeyCheckValueAlgorithm)`](crate::operation::create_key::builders::CreateKeyFluentBuilder::key_check_value_algorithm) / [`set_key_check_value_algorithm(Option<KeyCheckValueAlgorithm>)`](crate::operation::create_key::builders::CreateKeyFluentBuilder::set_key_check_value_algorithm):<br>required: **false**<br><p>The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV). It is used to validate the key integrity.</p> <p>For TDES keys, the KCV is computed by encrypting 8 bytes, each with value of zero, with the key to be checked and retaining the 3 highest order bytes of the encrypted result. For AES keys, the KCV is computed using a CMAC algorithm where the input data is 16 bytes of zero and retaining the 3 highest order bytes of the encrypted result.</p><br>
8    ///   - [`exportable(bool)`](crate::operation::create_key::builders::CreateKeyFluentBuilder::exportable) / [`set_exportable(Option<bool>)`](crate::operation::create_key::builders::CreateKeyFluentBuilder::set_exportable):<br>required: **true**<br><p>Specifies whether the key is exportable from the service.</p><br>
9    ///   - [`enabled(bool)`](crate::operation::create_key::builders::CreateKeyFluentBuilder::enabled) / [`set_enabled(Option<bool>)`](crate::operation::create_key::builders::CreateKeyFluentBuilder::set_enabled):<br>required: **false**<br><p>Specifies whether to enable the key. If the key is enabled, it is activated for use within the service. If the key is not enabled, then it is created but not activated. The default value is enabled.</p><br>
10    ///   - [`tags(Tag)`](crate::operation::create_key::builders::CreateKeyFluentBuilder::tags) / [`set_tags(Option<Vec::<Tag>>)`](crate::operation::create_key::builders::CreateKeyFluentBuilder::set_tags):<br>required: **false**<br><p>Assigns one or more tags to the Amazon Web Services Payment Cryptography key. Use this parameter to tag a key when it is created. To tag an existing Amazon Web Services Payment Cryptography key, use the <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_TagResource.html">TagResource</a> operation.</p> <p>Each tag consists of a tag key and a tag value. Both the tag key and the tag value are required, but the tag value can be an empty (null) string. You can't have more than one tag on an Amazon Web Services Payment Cryptography key with the same tag key.</p><important>  <p>Don't include personal, confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p> </important> <note>  <p>Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the key.</p> </note><br>
11    ///   - [`derive_key_usage(DeriveKeyUsage)`](crate::operation::create_key::builders::CreateKeyFluentBuilder::derive_key_usage) / [`set_derive_key_usage(Option<DeriveKeyUsage>)`](crate::operation::create_key::builders::CreateKeyFluentBuilder::set_derive_key_usage):<br>required: **false**<br><p>The intended cryptographic usage of keys derived from the ECC key pair to be created.</p> <p>After creating an ECC key pair, you cannot change the intended cryptographic usage of keys derived from it using ECDH.</p><br>
12    ///   - [`replication_regions(impl Into<String>)`](crate::operation::create_key::builders::CreateKeyFluentBuilder::replication_regions) / [`set_replication_regions(Option<Vec::<String>>)`](crate::operation::create_key::builders::CreateKeyFluentBuilder::set_replication_regions):<br>required: **false**<br><p>A list of Amazon Web Services Regions for key replication operations.</p> <p>Each region in the list must be a valid Amazon Web Services Region identifier where Amazon Web Services Payment Cryptography is available. This list is used to specify which regions should be added to or removed from a key's replication configuration.</p><br>
13    /// - On success, responds with [`CreateKeyOutput`](crate::operation::create_key::CreateKeyOutput) with field(s):
14    ///   - [`key(Option<Key>)`](crate::operation::create_key::CreateKeyOutput::key): <p>The key material that contains all the key attributes.</p>
15    /// - On failure, responds with [`SdkError<CreateKeyError>`](crate::operation::create_key::CreateKeyError)
16    pub fn create_key(&self) -> crate::operation::create_key::builders::CreateKeyFluentBuilder {
17        crate::operation::create_key::builders::CreateKeyFluentBuilder::new(self.handle.clone())
18    }
19}