pub fn generate_token_secret(&mut self, ttl_seconds: u32) -> Result<String, Error> {
        // Check number of tokens encrypted under the current key. We need to
        // make sure no more than 2^32 tokens are encrypted with the same key.
        // If this number is reached, we need to reinitialize the cipher entity.
        self.check_encryption_count()?;
        // Create token structure containing the encrypted expiry value.
        let token = self.create_token(ttl_seconds)?;
        // Encode struct into base64 in order to obtain token string.
        let encoded_token = token.base64_encode()?;
        // Increase the count of encrypted tokens.
        self.num_encrypted_tokens += 1;

        Ok(encoded_token)
    }
/// Generate encoded token string using the token time to live provided.
Generate encoded token string using the token time to live provided.
Generate encoded token string using the token time to live provided .
pub fn generate_token_secret(&mut self, ttl_seconds: u32) -> Result<String, Error> {
        // Check number of tokens encrypted under the current key. We need to
        // make sure no more than 2^32 tokens are encrypted with the same key.
        // If this number is reached, we need to reinitialize the cipher entity.
        self.check_encryption_count()?;
        // Create token structure containing the encrypted expiry value.
        let token = self.create_token(ttl_seconds)?;
        // Encode struct into base64 in order to obtain token string.
        let encoded_token = token.base64_encode()?;
        // Increase the count of encrypted tokens.
        self.num_encrypted_tokens += 1;
        Ok(encoded_token)
    }
pub fn generate_token_secret ( & mut self , ttl_seconds : u32 ) -> Result < String , Error > { // Check number of tokens encrypted under the current key. We need to // make sure no more than 2^32 tokens are encrypted with the same key. // If this number is reached, we need to reinitialize the cipher entity. self . check_encryption_count ( ) ? ; // Create token structure containing the encrypted expiry value. let token = self . create_token ( ttl_seconds ) ? ; // Encode struct into base64 in order to obtain token string. let encoded_token = token . base64_encode ( ) ? ; // Increase the count of encrypted tokens. self . num_encrypted_tokens += 1 ; Ok ( encoded_token ) }
Generate encoded token string using the token time to live provided.
Generate encoded token string using the token time to live provided .
&mut self
ttl_seconds
u32
&mut self
ttl_seconds
u32