Skip to main content

HostWithStore

pub trait HostWithStore<T>: HasData + Send {
    // Required methods
    fn generate_key(
        accessor: &Accessor<T, Self>,
        variant: RsaVariant,
        modulus: RsaModulus,
        options: Resource<DecryptionKeyOptions>,
    ) -> impl Future<Output = Result<Result<(Resource<DecryptionKey>, Resource<EncryptionKey>), Error>>> + Send;
    fn import_decryption_key_pkcs8(
        accessor: &Accessor<T, Self>,
        variant: RsaVariant,
        pkcs8: Vec<u8>,
        options: Resource<DecryptionKeyOptions>,
    ) -> impl Future<Output = Result<Result<Resource<DecryptionKey>, Error>>> + Send;
    fn import_decryption_key_jwk(
        accessor: &Accessor<T, Self>,
        variant: RsaVariant,
        jwk: String,
        options: Resource<DecryptionKeyOptions>,
    ) -> impl Future<Output = Result<Result<Resource<DecryptionKey>, Error>>> + Send;
    fn unwrap_decryption_key_pkcs8(
        accessor: &Accessor<T, Self>,
        variant: RsaVariant,
        input: Resource<UnwrapInput>,
        options: Resource<DecryptionKeyOptions>,
    ) -> impl Future<Output = Result<Result<Resource<DecryptionKey>, Error>>> + Send;
    fn unwrap_decryption_key_jwk(
        accessor: &Accessor<T, Self>,
        variant: RsaVariant,
        input: Resource<UnwrapInput>,
        options: Resource<DecryptionKeyOptions>,
    ) -> impl Future<Output = Result<Result<Resource<DecryptionKey>, Error>>> + Send;
}

Required Methods§

Source

fn generate_key( accessor: &Accessor<T, Self>, variant: RsaVariant, modulus: RsaModulus, options: Resource<DecryptionKeyOptions>, ) -> impl Future<Output = Result<Result<(Resource<DecryptionKey>, Resource<EncryptionKey>), Error>>> + Send

Generate a fresh key pair, returning both halves — the only point at which every provider is guaranteed to have the public key on hand. The public exponent is 65537; it is not a parameter.

Source

fn import_decryption_key_pkcs8( accessor: &Accessor<T, Self>, variant: RsaVariant, pkcs8: Vec<u8>, options: Resource<DecryptionKeyOptions>, ) -> impl Future<Output = Result<Result<Resource<DecryptionKey>, Error>>> + Send

Import a decryption key as a PKCS#8 PrivateKeyInfo (DER, with CRT parameters).

Source

fn import_decryption_key_jwk( accessor: &Accessor<T, Self>, variant: RsaVariant, jwk: String, options: Resource<DecryptionKeyOptions>, ) -> impl Future<Output = Result<Result<Resource<DecryptionKey>, Error>>> + Send

Import a decryption key as a full-CRT RSA private JWK. alg, when present, follows import-encryption-key-jwk’s values.

Source

fn unwrap_decryption_key_pkcs8( accessor: &Accessor<T, Self>, variant: RsaVariant, input: Resource<UnwrapInput>, options: Resource<DecryptionKeyOptions>, ) -> impl Future<Output = Result<Result<Resource<DecryptionKey>, Error>>> + Send

Mint a decryption key from unwrapped material read as a PKCS#8 PrivateKeyInfo. input is consumed; grants and extractability come from options alone (the W3C unwrapKey model).

Source

fn unwrap_decryption_key_jwk( accessor: &Accessor<T, Self>, variant: RsaVariant, input: Resource<UnwrapInput>, options: Resource<DecryptionKeyOptions>, ) -> impl Future<Output = Result<Result<Resource<DecryptionKey>, Error>>> + Send

Mint a decryption key from unwrapped material read as an RSA private JWK, subject to the unwrap-path use/key_ops checks (see README.md, “JWK 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§