ica_ec_key_new

Purpose

Creates an ICA_EC_KEY data structure for a new elliptic curve key.

Format


ICA_EC_KEY* ica_ec_key_new(unsigned int nid, 
   unsigned int *privlen);

Required hardware support

None.

Parameters

unsigned int nid
The identifier of the elliptic curve, on which the new key (ICA_EC_KEY) shall be based. These identifiers are defined by OpenSSL.
NID value NID name (OpenSSL) Elliptic curve D length (bytes)
409 NID_X9_62_prime192v secp192r1 24
713 NID_secp224r1 secp224r1 28
415 NID_X9_62_prime256v1 secp256r1 32
715 NID_secp384r1 secp384r1 48
716 NID_secp521r1 secp521r1 66
921 NID_brainpoolP160r1 brainpoolP160r1 20
923 NID_brainpoolP192r1 brainpoolP192r1 24
925 NID_brainpoolP224r1 brainpoolP224r1 28
927 NID_brainpoolP256r1 brainpoolP256r1 32
929 NID_brainpoolP320r1 brainpoolP320r1 40
931 NID_brainpoolP384r1 brainpoolP384r1 48
933 NID_brainpoolP512r1 brainpoolP512r1 64
unsigned int *privlen
Pointer to an unsigned integer buffer where the length of the private D value of the key (ICA_EC_KEY) is returned.
Note: The lengths of X and Y are the same as the length of D. Therefore, the public key (X,Y) has twice the length of D. Also, an ECDSA signature has twice the length of D.

Return codes

Returns a pointer to the opaque ICA_EC_KEY structure if successful.

Returns NULL if no memory could be allocated.

For return codes indicating exceptions, see Return codes.