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§
fn drop(
accessor: &Accessor<T, Self>,
rep: Resource<KwKey>,
) -> impl Future<Output = Result<()>> + Sendwhere
Self: Sized,
Sourcefn wrap(
accessor: &Accessor<T, Self>,
self_: Resource<KwKey>,
input: Resource<WrapInput>,
) -> impl Future<Output = Result<Result<Vec<u8>, Error>>> + Send
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.
Sourcefn unwrap(
accessor: &Accessor<T, Self>,
self_: Resource<KwKey>,
wrapped: Vec<u8>,
) -> impl Future<Output = Result<Result<Resource<UnwrapInput>, Error>>> + Send
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-failedwith no detail.
Requires can-unwrap, else error.not-permitted.
Sourcefn export_key_raw(
accessor: &Accessor<T, Self>,
self_: Resource<KwKey>,
) -> impl Future<Output = Result<Result<Vec<u8>, Error>>> + Send
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.
Sourcefn export_key_jwk(
accessor: &Accessor<T, Self>,
self_: Resource<KwKey>,
) -> impl Future<Output = Result<Result<String, Error>>> + Send
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”.
Sourcefn to_wrap_input_raw(
accessor: &Accessor<T, Self>,
self_: Resource<KwKey>,
) -> impl Future<Output = Result<Result<Resource<WrapInput>, Error>>> + Send
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.
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.