PwWrapVersion

Trait PwWrapVersion 

Source
pub trait PwWrapVersion: Version {
    type Params: Default;

    // Required methods
    fn pw_wrap_key(
        header: &'static str,
        pass: &[u8],
        params: &Self::Params,
        key_data: Vec<u8>,
    ) -> Result<Vec<u8>, PasetoError>;
    fn get_params(key_data: &[u8]) -> Result<Self::Params, PasetoError>;
    fn pw_unwrap_key<'key>(
        header: &'static str,
        pass: &[u8],
        key_data: &'key mut [u8],
    ) -> Result<&'key [u8], PasetoError>;
}
Expand description

This PASETO implementation allows encrypting keys using a password

Required Associated Types§

Required Methods§

Source

fn pw_wrap_key( header: &'static str, pass: &[u8], params: &Self::Params, key_data: Vec<u8>, ) -> Result<Vec<u8>, PasetoError>

Wrap the key using a password

Source

fn get_params(key_data: &[u8]) -> Result<Self::Params, PasetoError>

Extract the params from the

Source

fn pw_unwrap_key<'key>( header: &'static str, pass: &[u8], key_data: &'key mut [u8], ) -> Result<&'key [u8], PasetoError>

Unwrap the key using a password

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§