Skip to main content

HostWithStore

Trait HostWithStore 

Source
pub trait HostWithStore<T>: HasData + Send {
    // Required methods
    fn import_key_raw(
        accessor: &Accessor<T, Self>,
        variant: AesVariant,
        raw: Vec<u8>,
        options: Resource<CipherKeyOptions>,
    ) -> impl Future<Output = Result<Result<Resource<CipherKey>, Error>>> + Send;
    fn import_key_jwk(
        accessor: &Accessor<T, Self>,
        variant: AesVariant,
        jwk: String,
        options: Resource<CipherKeyOptions>,
    ) -> impl Future<Output = Result<Result<Resource<CipherKey>, Error>>> + Send;
    fn generate_key(
        accessor: &Accessor<T, Self>,
        variant: AesVariant,
        options: Resource<CipherKeyOptions>,
    ) -> impl Future<Output = Result<Result<Resource<CipherKey>, Error>>> + Send;
    fn derive_key(
        accessor: &Accessor<T, Self>,
        variant: AesVariant,
        input: Resource<DeriveInput>,
        options: Resource<CipherKeyOptions>,
    ) -> impl Future<Output = Result<Result<Resource<CipherKey>, Error>>> + Send;
    fn unwrap_key_raw(
        accessor: &Accessor<T, Self>,
        variant: AesVariant,
        input: Resource<UnwrapInput>,
        options: Resource<CipherKeyOptions>,
    ) -> impl Future<Output = Result<Result<Resource<CipherKey>, Error>>> + Send;
    fn unwrap_key_jwk(
        accessor: &Accessor<T, Self>,
        variant: AesVariant,
        input: Resource<UnwrapInput>,
        options: Resource<CipherKeyOptions>,
    ) -> impl Future<Output = Result<Result<Resource<CipherKey>, Error>>> + Send;
}

Required Methods§

Source

fn import_key_raw( accessor: &Accessor<T, Self>, variant: AesVariant, raw: Vec<u8>, options: Resource<CipherKeyOptions>, ) -> impl Future<Output = Result<Result<Resource<CipherKey>, Error>>> + Send

Import raw key material as the declared AES variant (see aes-gcm.import-key-raw for the variant-redundancy contract).

Source

fn import_key_jwk( accessor: &Accessor<T, Self>, variant: AesVariant, jwk: String, options: Resource<CipherKeyOptions>, ) -> impl Future<Output = Result<Result<Resource<CipherKey>, Error>>> + Send

Import an RFC 7517 JSON Web Key as an AES-CTR key of the declared variant. The key must be an oct key whose alg, if present, names the declared variant ("A128CTR"/"A192CTR"/"A256CTR"); otherwise as aes-gcm.import-key-jwk.

Source

fn generate_key( accessor: &Accessor<T, Self>, variant: AesVariant, options: Resource<CipherKeyOptions>, ) -> impl Future<Output = Result<Result<Resource<CipherKey>, Error>>> + Send

Generate a fresh random key of the given AES variant. Fails with error.unsupported if this implementation does not serve the variant.

Source

fn derive_key( accessor: &Accessor<T, Self>, variant: AesVariant, input: Resource<DeriveInput>, options: Resource<CipherKeyOptions>, ) -> impl Future<Output = Result<Result<Resource<CipherKey>, Error>>> + Send

Mint a key from a parameterized derivation (the aes-gcm.derive-key contract, minting a cipher-key).

Source

fn unwrap_key_raw( accessor: &Accessor<T, Self>, variant: AesVariant, input: Resource<UnwrapInput>, options: Resource<CipherKeyOptions>, ) -> impl Future<Output = Result<Result<Resource<CipherKey>, Error>>> + Send

Mint a key from unwrapped key material read as raw bytes, subject to import-key-raw’s contract. input is consumed; see aes-gcm.unwrap-key-raw for the options model.

Source

fn unwrap_key_jwk( accessor: &Accessor<T, Self>, variant: AesVariant, input: Resource<UnwrapInput>, options: Resource<CipherKeyOptions>, ) -> impl Future<Output = Result<Result<Resource<CipherKey>, Error>>> + Send

Mint a key from unwrapped key material read as an oct JWK, subject to import-key-jwk’s contract. input is consumed.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§