pub struct Client { /* private fields */ }
Expand description

Client for Payment Cryptography Control Plane

Client for invoking operations on Payment Cryptography Control Plane. Each operation on Payment Cryptography Control Plane is a method on this this struct. .send() MUST be invoked on the generated operations to dispatch the request to the service.

Constructing a Client

A Config is required to construct a client. For most use cases, the aws-config crate should be used to automatically resolve this config using aws_config::load_from_env(), since this will resolve an SdkConfig which can be shared across multiple different AWS SDK clients. This config resolution process can be customized by calling aws_config::from_env() instead, which returns a ConfigLoader that uses the builder pattern to customize the default config.

In the simplest case, creating a client looks as follows:

let config = aws_config::load_from_env().await;
let client = aws_sdk_paymentcryptography::Client::new(&config);

Occasionally, SDKs may have additional service-specific that can be set on the Config that is absent from SdkConfig, or slightly different settings for a specific client may be desired. The Config struct implements From<&SdkConfig>, so setting these specific settings can be done as follows:

let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_paymentcryptography::config::Builder::from(&sdk_config)
    .some_service_specific_setting("value")
    .build();

See the aws-config docs and Config for more information on customizing configuration.

Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.

Using the Client

A client has a function for every operation that can be performed by the service. For example, the CreateAlias operation has a Client::create_alias, function which returns a builder for that operation. The fluent builder ultimately has a send() function that returns an async future that returns a result, as illustrated below:

let result = client.create_alias()
    .alias_name("example")
    .send()
    .await;

The underlying HTTP requests that get made by this can be modified with the customize_operation function on the fluent builder. See the customize module for more information.

Implementations§

source§

impl Client

source

pub fn create_alias(&self) -> CreateAliasFluentBuilder

Constructs a fluent builder for the CreateAlias operation.

source§

impl Client

source

pub fn create_key(&self) -> CreateKeyFluentBuilder

Constructs a fluent builder for the CreateKey operation.

  • The fluent builder is configurable:
    • key_attributes(KeyAttributes) / set_key_attributes(Option<KeyAttributes>):

      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.

    • key_check_value_algorithm(KeyCheckValueAlgorithm) / set_key_check_value_algorithm(Option<KeyCheckValueAlgorithm>):

      The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV) for DES and AES keys.

      For DES key, the KCV is computed by encrypting 8 bytes, each with value ‘00’, with the key to be checked and retaining the 3 highest order bytes of the encrypted result. For AES key, the KCV is computed by encrypting 8 bytes, each with value ‘01’, with the key to be checked and retaining the 3 highest order bytes of the encrypted result.

    • exportable(bool) / set_exportable(Option<bool>):

      Specifies whether the key is exportable from the service.

    • enabled(bool) / set_enabled(Option<bool>):

      Specifies whether to enable the key. If the key is enabled, it is activated for use within the service. If the key not enabled, then it is created but not activated. The default value is enabled.

    • tags(Tag) / set_tags(Option<Vec<Tag>>):

      The tags to attach to the key. 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.

      To use this parameter, you must have TagResource permission.

      Don’t include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

      Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the key.

  • On success, responds with CreateKeyOutput with field(s):
  • On failure, responds with SdkError<CreateKeyError>
source§

impl Client

source

pub fn delete_alias(&self) -> DeleteAliasFluentBuilder

Constructs a fluent builder for the DeleteAlias operation.

source§

impl Client

source

pub fn delete_key(&self) -> DeleteKeyFluentBuilder

Constructs a fluent builder for the DeleteKey operation.

source§

impl Client

source

pub fn export_key(&self) -> ExportKeyFluentBuilder

Constructs a fluent builder for the ExportKey operation.

source§

impl Client

source

pub fn get_alias(&self) -> GetAliasFluentBuilder

Constructs a fluent builder for the GetAlias operation.

source§

impl Client

source

pub fn get_key(&self) -> GetKeyFluentBuilder

Constructs a fluent builder for the GetKey operation.

source§

impl Client

source

pub fn get_parameters_for_export(&self) -> GetParametersForExportFluentBuilder

Constructs a fluent builder for the GetParametersForExport operation.

source§

impl Client

source

pub fn get_parameters_for_import(&self) -> GetParametersForImportFluentBuilder

Constructs a fluent builder for the GetParametersForImport operation.

source§

impl Client

source

pub fn get_public_key_certificate(&self) -> GetPublicKeyCertificateFluentBuilder

Constructs a fluent builder for the GetPublicKeyCertificate operation.

source§

impl Client

source

pub fn import_key(&self) -> ImportKeyFluentBuilder

Constructs a fluent builder for the ImportKey operation.

  • The fluent builder is configurable:
    • key_material(ImportKeyMaterial) / set_key_material(Option<ImportKeyMaterial>):

      The key or public key certificate type to use during key material import, for example TR-34 or RootCertificatePublicKey.

    • key_check_value_algorithm(KeyCheckValueAlgorithm) / set_key_check_value_algorithm(Option<KeyCheckValueAlgorithm>):

      The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV) for DES and AES keys.

      For DES key, the KCV is computed by encrypting 8 bytes, each with value ‘00’, with the key to be checked and retaining the 3 highest order bytes of the encrypted result. For AES key, the KCV is computed by encrypting 8 bytes, each with value ‘01’, with the key to be checked and retaining the 3 highest order bytes of the encrypted result.

    • enabled(bool) / set_enabled(Option<bool>):

      Specifies whether import key is enabled.

    • tags(Tag) / set_tags(Option<Vec<Tag>>):

      The tags to attach to the key. 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.

      You can’t have more than one tag on an Amazon Web Services Payment Cryptography key with the same tag key. If you specify an existing tag key with a different tag value, Amazon Web Services Payment Cryptography replaces the current tag value with the specified one.

      To use this parameter, you must have TagResource permission.

      Don’t include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

      Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the key.

  • On success, responds with ImportKeyOutput with field(s):
    • key(Option<Key>):

      The KeyARN of the key material imported within Amazon Web Services Payment Cryptography.

  • On failure, responds with SdkError<ImportKeyError>
source§

impl Client

source

pub fn list_aliases(&self) -> ListAliasesFluentBuilder

Constructs a fluent builder for the ListAliases operation. This operation supports pagination; See into_paginator().

  • The fluent builder is configurable:
    • next_token(impl Into<String>) / set_next_token(Option<String>):

      Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of NextToken from the truncated response you just received.

    • max_results(i32) / set_max_results(Option<i32>):

      Use this parameter to specify the maximum number of items to return. When this value is present, Amazon Web Services Payment Cryptography does not return more than the specified number of items, but it might return fewer.

      This value is optional. If you include a value, it must be between 1 and 100, inclusive. If you do not include a value, it defaults to 50.

  • On success, responds with ListAliasesOutput with field(s):
  • On failure, responds with SdkError<ListAliasesError>
source§

impl Client

source

pub fn list_keys(&self) -> ListKeysFluentBuilder

Constructs a fluent builder for the ListKeys operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn list_tags_for_resource(&self) -> ListTagsForResourceFluentBuilder

Constructs a fluent builder for the ListTagsForResource operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn restore_key(&self) -> RestoreKeyFluentBuilder

Constructs a fluent builder for the RestoreKey operation.

source§

impl Client

source

pub fn start_key_usage(&self) -> StartKeyUsageFluentBuilder

Constructs a fluent builder for the StartKeyUsage operation.

source§

impl Client

source

pub fn stop_key_usage(&self) -> StopKeyUsageFluentBuilder

Constructs a fluent builder for the StopKeyUsage operation.

source§

impl Client

source

pub fn tag_resource(&self) -> TagResourceFluentBuilder

Constructs a fluent builder for the TagResource operation.

  • The fluent builder is configurable:
    • resource_arn(impl Into<String>) / set_resource_arn(Option<String>):

      The KeyARN of the key whose tags are being updated.

    • tags(Tag) / set_tags(Option<Vec<Tag>>):

      One or more tags. Each tag consists of a tag key and a tag value. 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. If you specify an existing tag key with a different tag value, Amazon Web Services Payment Cryptography replaces the current tag value with the new one.

      Don’t include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

      To use this parameter, you must have TagResource permission in an IAM policy.

      Don’t include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

  • On success, responds with TagResourceOutput
  • On failure, responds with SdkError<TagResourceError>
source§

impl Client

source

pub fn untag_resource(&self) -> UntagResourceFluentBuilder

Constructs a fluent builder for the UntagResource operation.

source§

impl Client

source

pub fn update_alias(&self) -> UpdateAliasFluentBuilder

Constructs a fluent builder for the UpdateAlias operation.

source§

impl Client

source

pub fn from_conf(conf: Config) -> Self

Creates a new client from the service Config.

Panics

This method will panic if the conf has retry or timeouts enabled without a sleep_impl. If you experience this panic, it can be fixed by setting the sleep_impl, or by disabling retries and timeouts.

source

pub fn config(&self) -> &Config

Returns the client’s configuration.

source§

impl Client

source

pub fn new(sdk_config: &SdkConfig) -> Self

Creates a new client from an SDK Config.

Panics
  • This method will panic if the sdk_config is missing an async sleep implementation. If you experience this panic, set the sleep_impl on the Config passed into this function to fix it.
  • This method will panic if the sdk_config is missing an HTTP connector. If you experience this panic, set the http_connector on the Config passed into this function to fix it.

Trait Implementations§

source§

impl Clone for Client

source§

fn clone(&self) -> Client

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 Client

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

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<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