Trait macaroons::token::Token [] [src]

pub trait Token {
    fn new(key: &[u8], identifier: Vec<u8>, location: Option<Vec<u8>>) -> Self;
    fn deserialize(macaroon: Vec<u8>) -> Result<Self> where Self: Sized;
    fn serialize(&self) -> Result<Vec<u8>>;
    fn add_caveat(&self, caveat: &Caveat) -> Self;
    fn verify(&self, key: &[u8]) -> Result<()>;
}

Required Methods

fn new(key: &[u8], identifier: Vec<u8>, location: Option<Vec<u8>>) -> Self

fn deserialize(macaroon: Vec<u8>) -> Result<Self> where Self: Sized

fn serialize(&self) -> Result<Vec<u8>>

fn add_caveat(&self, caveat: &Caveat) -> Self

fn verify(&self, key: &[u8]) -> Result<()>

Implementors