ecdhGetPublicKey()

The function stores the public key of the key pair for the ECDH key exchange.

Synopsis

int ecdhGetPublicKey(int keyPairId, blob &publicKey)

Parameters

Parameter Meaning
keyPairId The key pair Id, generated with ecdhReleaseKeyPair().
peerPublicKey Stores the public key.

Return value

The function returns 0 on success.

Error

In case of an error, an exception is thrown.

Description

The function stores the public key of the key pair with the given ID in "publicKey". For a key exchange, this public key must be transferred to the peer. The peer then uses it as the second argument in ecdhDeriveSharedSecret().

Note: The name of the ECDH curve to use can be configured with the already existing config entry [allSections] ECDHCurve.

Assignment

Communication functions

Availability

CTRL