UnencryptedToken

Type Alias UnencryptedToken 

Source
pub type UnencryptedToken<V, M, F = ()> = UnsealedToken<V, Local, M, F>;
Expand description

An EncryptedToken that has been decrypted

Aliased Type§

pub struct UnencryptedToken<V, M, F = ()> {
    pub claims: M,
    pub footer: F,
    /* private fields */
}

Fields§

§claims: M

The message that was contained in the token

§footer: F

The footer that was sent with the token

Implementations§

Source§

impl<V, M, F> UnencryptedToken<V, M, F>
where V: SealingVersion<Local>, M: Payload, F: Footer,

Source

pub fn encrypt( self, key: &LocalKey<V>, ) -> Result<EncryptedToken<V, M, F>, PasetoError>

Encrypt the token

Source

pub fn encrypt_with_aad( self, key: &LocalKey<V>, aad: &[u8], ) -> Result<EncryptedToken<V, M, F>, PasetoError>

Encrypt the token, additionally authenticating the implicit assertions.