Struct biscuit_auth::format::SerializedBiscuit
source · pub struct SerializedBiscuit {
pub root_key_id: Option<u32>,
pub authority: Block,
pub blocks: Vec<Block>,
pub proof: TokenNext,
}Expand description
Intermediate structure for token serialization
This structure contains the blocks serialized to byte arrays. Those arrays will be used for the signature
Fields§
§root_key_id: Option<u32>§blocks: Vec<Block>§proof: TokenNextImplementations§
source§impl SerializedBiscuit
impl SerializedBiscuit
pub fn from_slice<KP>(slice: &[u8], key_provider: KP) -> Result<Self, Format>where KP: RootKeyProvider,
pub fn serialized_size(&self) -> usize
sourcepub fn new(
root_key_id: Option<u32>,
root_keypair: &KeyPair,
next_keypair: &KeyPair,
authority: &Block
) -> Result<Self, Token>
pub fn new( root_key_id: Option<u32>, root_keypair: &KeyPair, next_keypair: &KeyPair, authority: &Block ) -> Result<Self, Token>
creates a new token
sourcepub fn append(
&self,
next_keypair: &KeyPair,
block: &Block,
external_signature: Option<ExternalSignature>
) -> Result<Self, Token>
pub fn append( &self, next_keypair: &KeyPair, block: &Block, external_signature: Option<ExternalSignature> ) -> Result<Self, Token>
adds a new block, serializes it and sign a new token
sourcepub fn append_serialized(
&self,
next_keypair: &KeyPair,
block: Vec<u8>,
external_signature: Option<ExternalSignature>
) -> Result<Self, Token>
pub fn append_serialized( &self, next_keypair: &KeyPair, block: Vec<u8>, external_signature: Option<ExternalSignature> ) -> Result<Self, Token>
adds a new block, serializes it and sign a new token
sourcepub fn verify(&self, root: &PublicKey) -> Result<(), Format>
pub fn verify(&self, root: &PublicKey) -> Result<(), Format>
checks the signature on a deserialized token
pub fn seal(&self) -> Result<Self, Token>
Trait Implementations§
source§impl Clone for SerializedBiscuit
impl Clone for SerializedBiscuit
source§fn clone(&self) -> SerializedBiscuit
fn clone(&self) -> SerializedBiscuit
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more