pub fn unwrap<KA: AbstractKey, KB: AbstractKey>(&self, wrapped_with: &KB) -> Result<KA> {
        if wrapped_with.get_digest() != self.wrapping_digest {
            return Err(Error::InvalidArgument(format!(
                "the specified key is not the correct wrapping key"
            )));
        }

        let data = match wrapped_with.decrypt(self.nonce.as_ref(), self.data.as_slice()) {
            Err(e) => return Err(Error::Crypto(format!("unwrapping key failed: {}", e))),
            Ok(d) => d,
        };

        match KA::deserialize(data) {
            Err(e) => return Err(Error::Crypto(format!("deserializing key failed: {}", e))),
            Ok(k) => Ok(k),
        }
    }
/// Unwrap the previously wrapped key this structure represents. This basically decrypts and
/// then deserializes the underlying key data, returning the newly constructed key.
Unwrap the previously wrapped key this structure represents. This basically decrypts and
then deserializes the underlying key data, returning the newly constructed key.
Unwrap the previously wrapped key this structure represents . This basically decrypts and then deserializes the underlying key data returning the newly constructed key .
pub fn unwrap<KA: AbstractKey, KB: AbstractKey>(&self, wrapped_with: &KB) -> Result<KA> {
        if wrapped_with.get_digest() != self.wrapping_digest {
            return Err(Error::InvalidArgument(format!(
                "the specified key is not the correct wrapping key"
            )));
        }
        let data = match wrapped_with.decrypt(self.nonce.as_ref(), self.data.as_slice()) {
            Err(e) => return Err(Error::Crypto(format!("unwrapping key failed: {}", e))),
            Ok(d) => d,
        };
        match KA::deserialize(data) {
            Err(e) => return Err(Error::Crypto(format!("deserializing key failed: {}", e))),
            Ok(k) => Ok(k),
        }
    }
pub fn unwrap < KA : AbstractKey , KB : AbstractKey > ( & self , wrapped_with : & KB ) -> Result < KA > { if wrapped_with . get_digest ( ) != self . wrapping_digest { return Err ( Error :: InvalidArgument ( format ! ( " " ) ) ) ; } let data = match wrapped_with . decrypt ( self . nonce . as_ref ( ) , self . data . as_slice ( ) ) { Err ( e ) => return Err ( Error :: Crypto ( format ! ( " " e ) ) ) , Ok ( d ) => d , } ; match KA :: deserialize ( data ) { Err ( e ) => return Err ( Error :: Crypto ( format ! ( " " e ) ) ) , Ok ( k ) => Ok ( k ) , } }
Unwrap the previously wrapped key this structure represents.
Unwrap the previously wrapped key this structure represents .
&self
wrapped_with
&KB
&self
wrapped_with
&KB