Skip to main content

KeyRecoveryKey

Trait KeyRecoveryKey 

Source
pub trait KeyRecoveryKey: Send + Sync {
    // Required methods
    fn ciphertext_len(&self) -> usize;
    fn recover_with_provider(
        &self,
        provider: &dyn CryptoProvider,
        parameters: &RsaOaepParameters,
        ciphertext: &[u8],
    ) -> Result<Vec<u8>, ProviderError>;
}
Expand description

Opaque private-key handle used to recover transported key bytes.

Private key material never crosses this boundary. The ciphertext size is public metadata required to reject malformed RSA inputs before dispatch.

Required Methods§

Source

fn ciphertext_len(&self) -> usize

Exact RSA ciphertext width in bytes for the key used by Self::recover_with_provider.

Source

fn recover_with_provider( &self, provider: &dyn CryptoProvider, parameters: &RsaOaepParameters, ciphertext: &[u8], ) -> Result<Vec<u8>, ProviderError>

Execute OAEP recovery using the selected provider’s randomness.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl KeyRecoveryKey for RsaPrivateKey

Available on crate feature xmlenc only.
Source§

fn ciphertext_len(&self) -> usize

Source§

fn recover_with_provider( &self, provider: &dyn CryptoProvider, parameters: &RsaOaepParameters, ciphertext: &[u8], ) -> Result<Vec<u8>, ProviderError>

Implementors§

Source§

impl KeyRecoveryKey for RustCryptoRsaPrivateKey

Available on crate feature xmlenc only.