Skip to main content

HostKwKeyWithStore

Trait HostKwKeyWithStore 

Source
pub trait HostKwKeyWithStore<T>: HasData + Send {
    // Required methods
    fn drop(
        accessor: &Accessor<T, Self>,
        rep: Resource<KwKey>,
    ) -> impl Future<Output = Result<()>> + Send
       where Self: Sized;
    fn wrap(
        accessor: &Accessor<T, Self>,
        self_: Resource<KwKey>,
        input: Resource<WrapInput>,
    ) -> impl Future<Output = Result<Result<Vec<u8>, Error>>> + Send;
    fn unwrap(
        accessor: &Accessor<T, Self>,
        self_: Resource<KwKey>,
        wrapped: Vec<u8>,
    ) -> impl Future<Output = Result<Result<Resource<UnwrapInput>, Error>>> + Send;
    fn export_key_raw(
        accessor: &Accessor<T, Self>,
        self_: Resource<KwKey>,
    ) -> impl Future<Output = Result<Result<Vec<u8>, Error>>> + Send;
    fn export_key_jwk(
        accessor: &Accessor<T, Self>,
        self_: Resource<KwKey>,
    ) -> impl Future<Output = Result<Result<String, Error>>> + Send;
    fn to_wrap_input_raw(
        accessor: &Accessor<T, Self>,
        self_: Resource<KwKey>,
    ) -> impl Future<Output = Result<Result<Resource<WrapInput>, Error>>> + Send;
    fn to_wrap_input_jwk(
        accessor: &Accessor<T, Self>,
        self_: Resource<KwKey>,
    ) -> impl Future<Output = Result<Result<Resource<WrapInput>, Error>>> + Send;
}

Required Methods§

Source

fn drop( accessor: &Accessor<T, Self>, rep: Resource<KwKey>, ) -> impl Future<Output = Result<()>> + Send
where Self: Sized,

Source

fn wrap( accessor: &Accessor<T, Self>, self_: Resource<KwKey>, input: Resource<WrapInput>, ) -> impl Future<Output = Result<Result<Vec<u8>, Error>>> + Send

Encrypt serialized key material. The minting interface documents the wrapped wire format and the algorithm’s input domain; material whose serialization falls outside that domain fails error.invalid-key.

input is consumed.

Requires can-wrap, else error.not-permitted.

Source

fn unwrap( accessor: &Accessor<T, Self>, self_: Resource<KwKey>, wrapped: Vec<u8>, ) -> impl Future<Output = Result<Result<Resource<UnwrapInput>, Error>>> + Send

Decrypt and integrity-check wrapped key material, as produced by wrap under the same algorithm. The result awaits a typed mint (see unwrap-input, including the verification-timing latitude); the material never reaches the caller.

Security:

  • Any failure of the integrity check — including input that cannot carry the algorithm’s wrapped form (the minting interface documents the domain) — reports error.authentication-failed with no detail.

Requires can-unwrap, else error.not-permitted.

Source

fn export_key_raw( accessor: &Accessor<T, Self>, self_: Resource<KwKey>, ) -> impl Future<Output = Result<Result<Vec<u8>, Error>>> + Send

The raw key material. Fails with error.not-extractable unless the key was created with extractable true.

Source

fn export_key_jwk( accessor: &Accessor<T, Self>, self_: Resource<KwKey>, ) -> impl Future<Output = Result<Result<String, Error>>> + Send

The key as an RFC 7517 JSON Web Key, behind the same extractability gate as export-key-raw. See README.md, “JWK contract”.

Source

fn to_wrap_input_raw( accessor: &Accessor<T, Self>, self_: Resource<KwKey>, ) -> impl Future<Output = Result<Result<Resource<WrapInput>, Error>>> + Send

This key’s raw material as a wrap-input, for wrapping under another key. Behind the same extractability gate as export-key-raw; the material itself never reaches the caller.

Source

fn to_wrap_input_jwk( accessor: &Accessor<T, Self>, self_: Resource<KwKey>, ) -> impl Future<Output = Result<Result<Resource<WrapInput>, Error>>> + Send

The JWK serialization as a wrap-input, behind the same gate. See README.md, “JWK contract”.

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§