pub(crate) fn new_with_rng<T: RngCore + CryptoRng>(
        rng: &mut T,
        root_key_id: Option<u32>,
        root: &KeyPair,
        mut symbols: SymbolTable,
        authority: Block,
    ) -> Result<Biscuit, error::Token> {
        let h1 = symbols.symbols.iter().collect::<HashSet<_>>();
        let h2 = authority.symbols.symbols.iter().collect::<HashSet<_>>();

        if !h1.is_disjoint(&h2) {
            return Err(error::Token::SymbolTableOverlap);
        }

        symbols
            .symbols
            .extend(authority.symbols.symbols.iter().cloned());

        let blocks = vec![];

        let next_keypair = KeyPair::new_with_rng(rng);
        let container = SerializedBiscuit::new(root_key_id, root, &next_keypair, &authority)?;

        Ok(Biscuit {
            root_key_id,
            authority,
            blocks,
            symbols,
            container: Some(container),
        })
    }
/// creates a new token, using a provided CSPRNG
///
/// the public part of the root keypair must be used for verification
creates a new token, using a provided CSPRNG
the public part of the root keypair must be used for verification
creates a new token using a provided CSPRNG the public part of the root keypair must be used for verification
pub(crate) fn new_with_rng<T: RngCore + CryptoRng>(
        rng: &mut T,
        root_key_id: Option<u32>,
        root: &KeyPair,
        mut symbols: SymbolTable,
        authority: Block,
    ) -> Result<Biscuit, error::Token> {
        let h1 = symbols.symbols.iter().collect::<HashSet<_>>();
        let h2 = authority.symbols.symbols.iter().collect::<HashSet<_>>();
        if !h1.is_disjoint(&h2) {
            return Err(error::Token::SymbolTableOverlap);
        }
        symbols
            .symbols
            .extend(authority.symbols.symbols.iter().cloned());
        let blocks = vec![];
        let next_keypair = KeyPair::new_with_rng(rng);
        let container = SerializedBiscuit::new(root_key_id, root, &next_keypair, &authority)?;
        Ok(Biscuit {
            root_key_id,
            authority,
            blocks,
            symbols,
            container: Some(container),
        })
    }
pub ( crate ) fn new_with_rng < T : RngCore + CryptoRng > ( rng : & mut T , root_key_id : Option < u32 > , root : & KeyPair , mut symbols : SymbolTable , authority : Block , ) -> Result < Biscuit , error :: Token > { let h1 = symbols . symbols . iter ( ) . collect :: < HashSet < _ > > ( ) ; let h2 = authority . symbols . symbols . iter ( ) . collect :: < HashSet < _ > > ( ) ; if ! h1 . is_disjoint ( & h2 ) { return Err ( error :: Token :: SymbolTableOverlap ) ; } symbols . symbols . extend ( authority . symbols . symbols . iter ( ) . cloned ( ) ) ; let blocks = vec ! [ ] ; let next_keypair = KeyPair :: new_with_rng ( rng ) ; let container = SerializedBiscuit :: new ( root_key_id , root , & next_keypair , & authority ) ? ; Ok ( Biscuit { root_key_id , authority , blocks , symbols , container : Some ( container ) , } ) }
creates a new token, using a provided CSPRNG
the public part of the root keypair must be used for verification
creates a new token using a provided CSPRNG the public part of the root keypair must be used for verification
rng
&mut T
root_key_id
Option<u32>
root
&KeyPair
symbols
SymbolTable
authority
Block
rng
&mut T
root_key_id
Option<u32>
root
&KeyPair
symbols
SymbolTable
authority
Block