V1

Struct V1 

Source
pub struct V1;

Trait Implementations§

Source§

impl HasKey<Local> for V1

Source§

type Key = LocalKey

Source§

fn decode(bytes: &[u8]) -> Result<LocalKey, PasetoError>

Decode the key from bytes.
Source§

fn encode(key: &LocalKey) -> Box<[u8]>

Encode the key into bytes.
Source§

impl HasKey<PkePublic> for V1

Source§

type Key = PkePublicKey

Source§

fn decode(bytes: &[u8]) -> Result<PkePublicKey, PasetoError>

Decode the key from bytes.
Source§

fn encode(key: &PkePublicKey) -> Box<[u8]>

Encode the key into bytes.
Source§

impl HasKey<PkeSecret> for V1

Source§

type Key = PkeSecretKey

Source§

fn decode(bytes: &[u8]) -> Result<PkeSecretKey, PasetoError>

Decode the key from bytes.
Source§

fn encode(key: &PkeSecretKey) -> Box<[u8]>

Encode the key into bytes.
Source§

impl HasKey<Public> for V1

Source§

type Key = PublicKey

Source§

fn decode(bytes: &[u8]) -> Result<PublicKey, PasetoError>

Decode the key from bytes.
Source§

fn encode(key: &PublicKey) -> Box<[u8]>

Encode the key into bytes.
Source§

impl HasKey<Secret> for V1

Available on crate feature signing only.
Source§

type Key = SecretKey

Source§

fn decode(bytes: &[u8]) -> Result<SecretKey, PasetoError>

Decode the key from bytes.
Source§

fn encode(key: &SecretKey) -> Box<[u8]>

Encode the key into bytes.
Source§

impl IdVersion for V1

Available on crate feature id only.
Source§

fn hash_key(key_header: &'static str, key_data: &[u8]) -> [u8; 33]

How to hash some keydata for creating KeyId
Source§

impl PieWrapVersion for V1

Source§

fn pie_wrap_key( header: &'static str, wrapping_key: &LocalKey, key_data: Vec<u8>, ) -> Result<Vec<u8>, PasetoError>

Wrap the key
Source§

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

Unwrap the key
Source§

impl PkeSealingVersion for V1

Source§

fn seal_key( sealing_key: &PkePublicKey, key: LocalKey, ) -> Result<Box<[u8]>, PasetoError>

Seal the key using the public key
Source§

impl PkeUnsealingVersion for V1

Source§

fn unseal_key( unsealing_key: &PkeSecretKey, key_data: Box<[u8]>, ) -> Result<LocalKey, PasetoError>

Unseal the key using the secret key
Source§

impl PwWrapVersion for V1

Source§

type Params = Params

Source§

fn pw_wrap_key( header: &'static str, pass: &[u8], params: &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
Source§

impl SealingVersion<Local> for V1

Available on crate feature encrypting only.
Source§

fn unsealing_key(key: &LocalKey) -> LocalKey

Generate the key that can unseal the tokens this key will seal.
Source§

fn random() -> Result<LocalKey, PasetoError>

Generate a random key
Source§

fn nonce() -> Result<Vec<u8>, PasetoError>

Do not call this method directly.
Source§

fn dangerous_seal_with_nonce( key: &LocalKey, encoding: &'static str, payload: Vec<u8>, footer: &[u8], aad: &[u8], ) -> Result<Vec<u8>, PasetoError>

Do not call this method directly. Use UnsealedToken::seal instead.
Source§

impl SealingVersion<Public> for V1

Available on crate feature signing only.
Source§

fn unsealing_key(key: &SecretKey) -> PublicKey

Generate the key that can unseal the tokens this key will seal.
Source§

fn random() -> Result<SecretKey, PasetoError>

Generate a random key
Source§

fn nonce() -> Result<Vec<u8>, PasetoError>

Do not call this method directly.
Source§

fn dangerous_seal_with_nonce( key: &SecretKey, encoding: &'static str, payload: Vec<u8>, footer: &[u8], aad: &[u8], ) -> Result<Vec<u8>, PasetoError>

Do not call this method directly. Use UnsealedToken::seal instead.
Source§

impl UnsealingVersion<Local> for V1

Available on crate feature decrypting only.
Source§

fn unseal<'a>( key: &LocalKey, encoding: &'static str, payload: &'a mut [u8], footer: &[u8], aad: &[u8], ) -> Result<&'a [u8], PasetoError>

Do not call this method directly. Use SealedToken::unseal instead.
Source§

impl UnsealingVersion<Public> for V1

Source§

fn unseal<'a>( key: &PublicKey, encoding: &'static str, payload: &'a mut [u8], footer: &[u8], aad: &[u8], ) -> Result<&'a [u8], PasetoError>

Do not call this method directly. Use SealedToken::unseal instead.
Source§

impl Version for V1

Source§

const HEADER: &'static str = "v1"

Header for PASETO
Source§

const PASERK_HEADER: &'static str = "k1"

Header for PASERK

Auto Trait Implementations§

§

impl Freeze for V1

§

impl RefUnwindSafe for V1

§

impl Send for V1

§

impl Sync for V1

§

impl Unpin for V1

§

impl UnwindSafe for V1

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V