pub struct UnverifiedBiscuit { /* private fields */ }Expand description
A token that was parsed without cryptographic signature verification
Use this if you want to attenuate or print the content of a token without verifying it.
It can be converted to a Biscuit using UnverifiedBiscuit::verify, and then used for authorization
Implementations§
Source§impl UnverifiedBiscuit
impl UnverifiedBiscuit
Sourcepub fn from_base64<T>(slice: T) -> Result<Self, Token>
pub fn from_base64<T>(slice: T) -> Result<Self, Token>
deserializes a token from base64
Sourcepub fn check_signature<F>(self, f: F) -> Result<Biscuit, Format>
👎Deprecated since 4.1.0: please use verify instead
pub fn check_signature<F>(self, f: F) -> Result<Biscuit, Format>
verify insteadchecks the signature of the token and convert it to a Biscuit for authorization
Sourcepub fn verify<KP>(self, key_provider: KP) -> Result<Biscuit, Format>where
KP: RootKeyProvider,
pub fn verify<KP>(self, key_provider: KP) -> Result<Biscuit, Format>where
KP: RootKeyProvider,
checks the signature of the token and convert it to a Biscuit for authorization
Sourcepub fn append(&self, block_builder: BlockBuilder) -> Result<Self, Token>
pub fn append(&self, block_builder: BlockBuilder) -> Result<Self, Token>
adds a new block to the token
since the public key is integrated into the token, the keypair can be discarded right after calling this function
Sourcepub fn to_base64(&self) -> Result<String, Token>
pub fn to_base64(&self) -> Result<String, Token>
serializes the token and encode it to a (URL safe) base64 string
Sourcepub fn from_with_symbols(
slice: &[u8],
symbols: SymbolTable,
) -> Result<Self, Token>
pub fn from_with_symbols( slice: &[u8], symbols: SymbolTable, ) -> Result<Self, Token>
deserializes from raw bytes with a custom symbol table
Sourcepub fn from_base64_with_symbols<T>(
slice: T,
symbols: SymbolTable,
) -> Result<Self, Token>
pub fn from_base64_with_symbols<T>( slice: T, symbols: SymbolTable, ) -> Result<Self, Token>
deserializes a token from base64 with a custom symbol table
Sourcepub fn append_with_keypair(
&self,
keypair: &KeyPair,
block_builder: BlockBuilder,
) -> Result<Self, Token>
pub fn append_with_keypair( &self, keypair: &KeyPair, block_builder: BlockBuilder, ) -> Result<Self, Token>
adds a new block to the token
since the public key is integrated into the token, the keypair can be discarded right after calling this function
Sourcepub fn root_key_id(&self) -> Option<u32>
pub fn root_key_id(&self) -> Option<u32>
returns an (optional) root key identifier. It provides a hint for public key selection during verification
Sourcepub fn revocation_identifiers(&self) -> Vec<Vec<u8>>
pub fn revocation_identifiers(&self) -> Vec<Vec<u8>>
returns a list of revocation identifiers for each block, in order
revocation identifiers are unique: tokens generated separately with the same contents will have different revocation ids
Sourcepub fn external_public_keys(&self) -> Vec<Option<Vec<u8>>>
pub fn external_public_keys(&self) -> Vec<Option<Vec<u8>>>
returns a list of external key for each block, in order
Blocks carrying an external public key are third-party blocks and their contents can be trusted as coming from the holder of the corresponding private key
Sourcepub fn block_count(&self) -> usize
pub fn block_count(&self) -> usize
returns the number of blocks (at least 1)
Sourcepub fn print_block_source(&self, index: usize) -> Result<String, Token>
pub fn print_block_source(&self, index: usize) -> Result<String, Token>
prints the content of a block as Datalog source code
Sourcepub fn seal(&self) -> Result<UnverifiedBiscuit, Token>
pub fn seal(&self) -> Result<UnverifiedBiscuit, Token>
creates a sealed version of the token
sealed tokens cannot be attenuated
pub fn third_party_request(&self) -> Result<ThirdPartyRequest, Token>
pub fn append_third_party(&self, slice: &[u8]) -> Result<Self, Token>
pub fn append_third_party_base64<T>(&self, slice: T) -> Result<Self, Token>
Trait Implementations§
Source§impl Clone for UnverifiedBiscuit
impl Clone for UnverifiedBiscuit
Source§fn clone(&self) -> UnverifiedBiscuit
fn clone(&self) -> UnverifiedBiscuit
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more