Skip to main content

unwrap_attachment_key

Function unwrap_attachment_key 

Source
pub fn unwrap_attachment_key(
    enc: &str,
    item_key: &SymmetricCryptoKey,
    private_key: Option<&RsaPrivateKey>,
) -> Result<SymmetricCryptoKey, VaultError>
Expand description

Unwrap an attachment key by its EncString type.

Types 0/1/2 are AES-wrapped with the item key. Types 4/6 are RSA-OAEP-SHA1 wrapped with the user’s public key, so they need the private key; type 6 also carries an HMAC-SHA256 over iv | ciphertext keyed with the item key’s MAC half. The live account uses type 2 for all 19 attachments.