Perform a key agreement and return the raw shared secret. Opcode: 19 (
|RawKeyAgreement||The key agreement algorithm to compute|
|String||Name of the private key to use|
|Vector of unsigned bytes||Public key of the peer|
private_key_namemust allow the usage flag
peer_keymust be in the same format that PsaImportKey accepts.
|Vector of unsigned bytes||The raw shared secret|
Specific response status codes
PsaErrorNotPermitted: The key does not have the
deriveusage flag, or does not permit the requested algorithm.
private_key_nameis not compatible with
peer_key_nameis not valid for
algor not compatible with
algis not a supported key agreement algorithm.
Warning: The raw result of a key agreement algorithm such as finite-field Diffie-Hellman or elliptic curve Diffie-Hellman has biases, and is not suitable for use as key material. Instead it is recommended that the result is used as input to a key derivation algorithm. To chain a key agreement with a key derivation, use psa_key_derivation_key_agreement() and other functions from the key derivation interface.
Copyright 2020 Contributors to the Parsec project.