[][src]Struct paseto::tokens::builder::PasetoBuilder

pub struct PasetoBuilder { /* fields omitted */ }

A paseto builder.

Methods

impl PasetoBuilder[src]

pub fn new() -> PasetoBuilder[src]

Creates a new Paseto builder.

pub fn build(self) -> Result<String, Error>[src]

Builds a token.

impl PasetoBuilder[src]

pub fn set_rsa_key(self, private_key_der: Vec<u8>) -> Self[src]

Sets the RSA Key on a Paseto builder.

NOTE: This will not be used if you set a symmetric encryption key, or if you specify an Ed25519 key pair.

impl PasetoBuilder[src]

pub fn set_ed25519_key(self, key_pair: Ed25519KeyPair) -> Self[src]

Sets the ED25519 Key pair.

NOTE: This will not be used if you set a symmetric encryption key.

impl PasetoBuilder[src]

pub fn set_encryption_key(self, encryption_key: Vec<u8>) -> Self[src]

Sets the encryption key to use for the paseto token.

NOTE: If you set this we will use a local token.

pub fn set_claim(self, key: String, value: Value) -> Self[src]

Sets an arbitrary claim (a key inside the json token).

pub fn set_audience(self, audience: String) -> Self[src]

Sets the audience for this token.

pub fn set_expiration(self, expiration: DateTime<Utc>) -> Self[src]

Sets the expiration date for this token.

pub fn set_issued_at(self, issued_at: Option<DateTime<Utc>>) -> Self[src]

Sets the time this token was issued at.

issued_at defaults to: Utc::now();

pub fn set_issuer(self, issuer: String) -> Self[src]

Sets the issuer for this token.

pub fn set_jti(self, id: String) -> Self[src]

Sets the JTI ID for this token.

pub fn set_not_before(self, not_before: DateTime<Utc>) -> Self[src]

Sets the not before time.

pub fn set_subject(self, subject: String) -> Self[src]

Sets the subject for this token.

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]