This method retrieves the Eliptical Curve (EC) private key along with its parameters (i.e., named curve) in an ASN.1 (DER) format (see RFC5915).
If the error 'eTooSmall' is returned then one of the pASN1 buffer is too small to hold part of the EC key. In this case the length parameters (i.e., pASN1->length) is assigned the required length.
- Parameters
-
bWithParams | [ in ] Generate the ASN.1 with or without the EC key's parameters (e.g., curve name) |
pASN1 | [ inout ] The private key represented in an ASN.1 structure. If pASN1->pString is NULL or too small to hold the key, then the required buffer length to hold the key will be returned in the pASN1->length field and the error eTooSmall is returned. |
- Returns
Success | P6R::eOk | |
Failure | P6R::eNotInitialized | Object is in an incorrect state. |
P6R::eInvalidArg | pASN1 is NULL. |
P6R::eWrongKeyClass | The class of this key is not CKC_PRIVATE. |
P6R::eWrongKeyType | Must be EC |
P6R::eTooSmall | One of the buffers is too small to hold the requested value. |