Skip to main content

agree_key

Function agree_key 

Source
pub fn agree_key(
    suite: SecuritySuite,
    private_key: &[u8],
    peer_public_key: &[u8],
    algorithm_id: &[u8],
    party_u_info: &[u8],
    party_v_info: &[u8],
) -> Result<Vec<u8>, AgreementError>
Expand description

Performs the full DLMS key agreement: ECDH followed by the KDF, returning the derived AES encryption key (16 octets for suite 1, 32 for suite 2).

party_u_info / party_v_info are the originator and recipient system-titles as used in the KDF (Green Book Table C.2).