Skip to main content

HostWithStore

Trait HostWithStore 

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

Required Methods§

Source

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

Import raw key material as an HMAC-SHA-1 key. See hmac-sha2.import-key-raw for the key-length contract.

Source

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

Import an RFC 7517 JSON Web Key as an HMAC-SHA-1 key (alg, when present, must be "HS1"). See hmac-sha2.import-key-jwk.

Source

fn generate_key( accessor: &Accessor<T, Self>, length: Option<u32>, options: Resource<MacKeyOptions>, ) -> impl Future<Output = Result<Result<Resource<MacKey>, Error>>> + Send

Generate a fresh random HMAC-SHA-1 key. See hmac-sha2.generate-key for the length contract; none means SHA-1’s block size, 512 bits.

Source

fn derive_key( accessor: &Accessor<T, Self>, input: Resource<DeriveInput>, length: Option<u32>, options: Resource<MacKeyOptions>, ) -> impl Future<Output = Result<Result<Resource<MacKey>, Error>>> + Send

Mint a key from a parameterized derivation. See hmac-sha2.derive-key.

Source

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

Mint a key from unwrapped key material read as raw bytes. See hmac-sha2.unwrap-key-raw.

Source

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

Mint a key from unwrapped key material read as an RFC 7517 JSON Web Key. See hmac-sha2.unwrap-key-jwk.

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§