Skip to main content

encrypt_to

Function encrypt_to 

Source
pub fn encrypt_to(
    certificate: &Certificate,
    plaintext: &[u8],
) -> Result<(Ieee1609Dot2Data, [u8; 16]), PkiProtocolError>
Expand description

EtsiTs103097Data-Encrypted for the encryption key of certificate: one certRecipInfo (its HashedId8), ECIES (fresh ephemeral key, KDF2 with P1 = SHA-256 of the canonical certificate, MAC1) on the AES-128-CCM key, which encrypts plaintext with a fresh nonce. Returns the data and the AES key.