[][src]Struct biscuit_auth::format::SerializedBiscuit

pub struct SerializedBiscuit {
    pub authority: Vec<u8>,
    pub blocks: Vec<Vec<u8>>,
    pub keys: Vec<PublicKey>,
    pub signature: TokenSignature,
}

Intermediate structure for token serialization

This structure contains the blocks serialized to byte arrays. Those arrays will be used for the signature

Fields

authority: Vec<u8>blocks: Vec<Vec<u8>>keys: Vec<PublicKey>signature: TokenSignature

Methods

impl SerializedBiscuit[src]

pub fn from_slice(slice: &[u8]) -> Result<Self, Format>[src]

pub fn to_proto(&self) -> Biscuit[src]

serializes the token

pub fn to_vec(&self) -> Result<Vec<u8>, Format>[src]

serializes the token

pub fn new<T: RngCore + CryptoRng>(
    rng: &mut T,
    keypair: &KeyPair,
    authority: &Block
) -> Result<Self, Format>
[src]

creates a new token

pub fn append<T: RngCore + CryptoRng>(
    &self,
    rng: &mut T,
    keypair: &KeyPair,
    block: &Block
) -> Result<Self, Format>
[src]

adds a new block, serializes it and sign a new token

pub fn verify(&self) -> Result<(), Format>[src]

checks the signature on a deserialized token

pub fn check_root_key(&self, root: PublicKey) -> Result<(), Format>[src]

Trait Implementations

impl Clone for SerializedBiscuit[src]

impl Debug for SerializedBiscuit[src]

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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]

impl<T> Same<T> for T

type Output = T

Should always be Self