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

A client session with SDKMS.

REST APIs are exposed as methods on this type. Communication with SDKMS API endpoint is protected with TLS and this type uses simple_hyper_client::blocking::Client along with tokio_native_tls::TlsConnector for HTTP/TLS.

When making crypto API calls using an API key, it is possible to pass the API key as an HTTP Basic Authorization header along with each request. This can be achieved by setting the API key using SdkmsClientBuilder::with_api_key(). Note that some features, e.g. transient keys, may not be available when using this authentication method. To be able to use such features, you can establish a session using any of the following methods:

Note that certain non-cryptographic APIs require a user session, which can be established using authenticate_user(). This includes many APIs such as:

Also note that a user session is generally not permitted to call crypto APIs. In case your current authorization is not appropriate for a particular API call, you’ll get an error to that effect from SDKMS.

Certain APIs are “approvable”, i.e. they can be subject to an approval policy. In such cases there are two methods on SdkmsClient, e.g. encrypt() / request_approval_to_encrypt(). Whether or not you need to call request_approval_to_encrypt() depends on the approval policy that is applicable to the security object being used in your request. You can find out if a particular request is subject to an approval policy by first calling the regular API, e.g. encrypt() and checking if the response indicates that an approval request is needed at which point you can call request_approval_to_encrypt(). There is an example of how to do this in the repository.

Implementations

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

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

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

Calls U::from(self).

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

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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