pub fn encrypt<T: Serialize + DeserializeOwned>(
        self,
        payload: &[u8],
        aad: &[u8],
        key: &jwk::JWK<T>,
        options: &EncryptionOptions,
    ) -> Result<EncryptionResult, Error> {
        use self::ContentEncryptionAlgorithm::*;

        match self {
            A128GCM | A192GCM | A256GCM => self.aes_gcm_encrypt(payload, aad, key, options),
            _ => Err(Error::UnsupportedOperation),
        }
    }
/// Encrypt some payload with the provided algorith
Encrypt some payload with the provided algorith
Encrypt some payload with the provided algorith
pub fn encrypt<T: Serialize + DeserializeOwned>(
        self,
        payload: &[u8],
        aad: &[u8],
        key: &jwk::JWK<T>,
        options: &EncryptionOptions,
    ) -> Result<EncryptionResult, Error> {
        use self::ContentEncryptionAlgorithm::*;
        match self {
            A128GCM | A192GCM | A256GCM => self.aes_gcm_encrypt(payload, aad, key, options),
            _ => Err(Error::UnsupportedOperation),
        }
    }
pub fn encrypt < T : Serialize + DeserializeOwned > ( self , payload : & [ u8 ] , aad : & [ u8 ] , key : & jwk :: JWK < T > , options : & EncryptionOptions , ) -> Result < EncryptionResult , Error > { use self :: ContentEncryptionAlgorithm :: * ; match self { A128GCM | A192GCM | A256GCM => self . aes_gcm_encrypt ( payload , aad , key , options ) , _ => Err ( Error :: UnsupportedOperation ) , } }
Encrypt some payload with the provided algorith
Encrypt some payload with the provided algorith
self
payload
&[u8]
aad
&[u8]
key
&jwk::JWK<T>
options
&EncryptionOptions
self
payload
&[u8]
aad
&[u8]
key
&jwk::JWK<T>
options
&EncryptionOptions