Skip to main content

HostVerifyingKeyWithStore

Trait HostVerifyingKeyWithStore 

Source
pub trait HostVerifyingKeyWithStore<T>: HasData + Send {
    // Required methods
    fn drop(
        accessor: &Accessor<T, Self>,
        rep: Resource<VerifyingKey>,
    ) -> impl Future<Output = Result<()>> + Send
       where Self: Sized;
    fn verify(
        accessor: &Accessor<T, Self>,
        self_: Resource<VerifyingKey>,
        data: StreamReader<u8>,
        sig: Vec<u8>,
    ) -> impl Future<Output = Result<Result<(), Error>>> + Send;
    fn export_key_raw(
        accessor: &Accessor<T, Self>,
        self_: Resource<VerifyingKey>,
    ) -> impl Future<Output = Result<Result<Vec<u8>, Error>>> + Send;
    fn export_key_spki(
        accessor: &Accessor<T, Self>,
        self_: Resource<VerifyingKey>,
    ) -> impl Future<Output = Result<Result<Vec<u8>, Error>>> + Send;
    fn export_key_jwk(
        accessor: &Accessor<T, Self>,
        self_: Resource<VerifyingKey>,
    ) -> impl Future<Output = Result<Result<String, Error>>> + Send;
}

Required Methods§

Source

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

Source

fn verify( accessor: &Accessor<T, Self>, self_: Resource<VerifyingKey>, data: StreamReader<u8>, sig: Vec<u8>, ) -> impl Future<Output = Result<Result<(), Error>>> + Send

Verify sig over an entire byte stream. Like mac-key.verify, both verdicts are computed over the entire stream and resolve only after it is fully drained, and it fails closed with error.authentication-failed (a result, not a bool: an ignored boolean fails open).

Security:

  • Signature verification is a policy, not a bit-exact predicate: the key’s minting interface defines the precise criterion — which degenerate keys and signatures must be rejected — exactly as it defines the wire format.
Source

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

The public key material, in the minting interface’s documented public format. Algorithms without a raw public form (the RSA family — the platform serves spki and jwk only) fail error.unsupported.

There is no extractability gate on this resource, so error.not-extractable never occurs here. Export is still fallible: a provider may hold the key as a handle it can use but not read — verifying with it succeeds while recovering its encoding fails with error.other (see README.md, “Extractability”).

Source

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

The public key as an X.509 SubjectPublicKeyInfo (DER), with the same fallibility as export-key-raw.

Source

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

The public key as a JWK (an RFC 8037 OKP public key for Ed25519, an EC public key for ECDSA). See mac-key.export-key-jwk for the package-wide JWK contract; the same fallibility as export-key-raw applies.

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§