pub fn unwrap_key<T: Serialize + DeserializeOwned>(
        self,
        encrypted: &EncryptionResult,
        content_alg: ContentEncryptionAlgorithm,
        key: &jwk::JWK<T>,
    ) -> Result<jwk::JWK<Empty>, Error> {
        use self::KeyManagementAlgorithm::*;

        match self {
            A128GCMKW | A192GCMKW | A256GCMKW => self.aes_gcm_decrypt(encrypted, content_alg, key),
            DirectSymmetricKey => Ok(key.clone_without_additional()),
            _ => Err(Error::UnsupportedOperation),
        }
    }
/// Decrypt or unwrap a CEK with the provided algorithm
Decrypt or unwrap a CEK with the provided algorithm
Decrypt or unwrap a CEK with the provided algorithm
pub fn unwrap_key<T: Serialize + DeserializeOwned>(
        self,
        encrypted: &EncryptionResult,
        content_alg: ContentEncryptionAlgorithm,
        key: &jwk::JWK<T>,
    ) -> Result<jwk::JWK<Empty>, Error> {
        use self::KeyManagementAlgorithm::*;
        match self {
            A128GCMKW | A192GCMKW | A256GCMKW => self.aes_gcm_decrypt(encrypted, content_alg, key),
            DirectSymmetricKey => Ok(key.clone_without_additional()),
            _ => Err(Error::UnsupportedOperation),
        }
    }
pub fn unwrap_key < T : Serialize + DeserializeOwned > ( self , encrypted : & EncryptionResult , content_alg : ContentEncryptionAlgorithm , key : & jwk :: JWK < T > , ) -> Result < jwk :: JWK < Empty > , Error > { use self :: KeyManagementAlgorithm :: * ; match self { A128GCMKW | A192GCMKW | A256GCMKW => self . aes_gcm_decrypt ( encrypted , content_alg , key ) , DirectSymmetricKey => Ok ( key . clone_without_additional ( ) ) , _ => Err ( Error :: UnsupportedOperation ) , } }
Decrypt or unwrap a CEK with the provided algorithm
Decrypt or unwrap a CEK with the provided algorithm
self
encrypted
&EncryptionResult
content_alg
ContentEncryptionAlgorithm
key
&jwk::JWK<T>
self
encrypted
&EncryptionResult
content_alg
ContentEncryptionAlgorithm
key
&jwk::JWK<T>