CRYPT_ECC_PrivateImport Function

C

int CRYPT_ECC_PrivateImport(
    CRYPT_ECC_CTX* ecc, 
    const unsigned char* priv, 
    unsigned int privSz, 
    const unsigned char* pub, 
    unsigned int pubSz
);

Description

This function imports a public/private key pair in X9.63 format.

Preconditions

The context must have been initialized with a call to CRYPT_ECC_Initialize.

Parameters

Parameters Description
ecc Pointer to context which saves state between calls.
priv Pointer to the private key.
privSz Size of the private key, in bytes.
pub Pointer to the public key.
pubSz Size of the public key, in bytes.

Returns

Example

CRYPT_ECC_CTX ecc;

CRYPT_ECC_Initialize(&ecc);
...
CRYPT_ECC_PrivateImport(&ecc, priv_key, sizeof(priv_key), pub_key, sizeof(pub_key));