LocalKey

Type Alias LocalKey 

Source
pub type LocalKey<V> = Key<V, Local>;
Expand description

Private key used for encryption and decryptiom

Aliased Type§

pub struct LocalKey<V>(/* private fields */);

Implementations§

Source§

impl<V: SealingVersion<Local>> LocalKey<V>

Source

pub fn random() -> Result<Self, PasetoError>

Generate a random local key

Source§

impl<V: PkeSealingVersion> LocalKey<V>

Source

pub fn seal(self, with: &Key<V, PkePublic>) -> Result<SealedKey<V>, PasetoError>

Encrypt the key such that it can only be decrypted by the resspective secret key.

Trait Implementations§

Source§

impl<V: SealingVersion<Local>> From<[u8; 32]> for LocalKey<V>

Source§

fn from(value: [u8; 32]) -> Self

Converts to this type from the input type.