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 duplicate 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 moreAuto Trait Implementations§
impl Freeze for SerializedBiscuit
impl RefUnwindSafe for SerializedBiscuit
impl Send for SerializedBiscuit
impl Sync for SerializedBiscuit
impl Unpin for SerializedBiscuit
impl UnwindSafe for SerializedBiscuit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more