fn key_token_pair(&self, data: &[u8]) -> (String, String) {
            // make nonce and ciphertext
            let nonce = box_::gen_nonce();
            let ciphertext = box_::seal_precomputed(data, &nonce, &self.our_p);

            // combine nonce and ciphertext together
            let token_bytes = [&nonce[..NONCE_SIZE], &ciphertext].concat();

            // return base64 encoded data
            (
                base64::encode(&self.their_p, base64::Variant::Original),
                base64::encode(&token_bytes, base64::Variant::UrlSafeNoPadding),
            )
        }
/// Generate a valid base64 Precomputed Key and base64-url Token that can be deciphered
/// using the [`TokenVerifier`]. Internally uses [`PCryptoData`] to generate key/token
/// pair.
Generate a valid base64 Precomputed Key and base64-url Token that can be deciphered
using the [`TokenVerifier`]. Internally uses [`PCryptoData`] to generate key/token
pair.
Generate a valid base64 Precomputed Key and base64 - url Token that can be deciphered using the [ ` TokenVerifier ` ] . Internally uses [ ` PCryptoData ` ] to generate key / token pair .
fn key_token_pair(&self, data: &[u8]) -> (String, String) {
            // make nonce and ciphertext
            let nonce = box_::gen_nonce();
            let ciphertext = box_::seal_precomputed(data, &nonce, &self.our_p);
            // combine nonce and ciphertext together
            let token_bytes = [&nonce[..NONCE_SIZE], &ciphertext].concat();
            // return base64 encoded data
            (
                base64::encode(&self.their_p, base64::Variant::Original),
                base64::encode(&token_bytes, base64::Variant::UrlSafeNoPadding),
            )
        }
fn key_token_pair ( & self , data : & [ u8 ] ) -> ( String , String ) { // make nonce and ciphertext let nonce = box_ :: gen_nonce ( ) ; let ciphertext = box_ :: seal_precomputed ( data , & nonce , & self . our_p ) ; // combine nonce and ciphertext together let token_bytes = [ & nonce [ .. NONCE_SIZE ] , & ciphertext ] . concat ( ) ; // return base64 encoded data ( base64 :: encode ( & self . their_p , base64 :: Variant :: Original ) , base64 :: encode ( & token_bytes , base64 :: Variant :: UrlSafeNoPadding ) , ) }
Generate a valid base64 Precomputed Key and base64-url Token that can be deciphered
using the [`TokenVerifier`].
Generate a valid base64 Precomputed Key and base64 - url Token that can be deciphered using the [ ` TokenVerifier ` ] .
&self
data
&[u8]