This method retrieves a RSA private or public key in the PKCS#1 format (unencrypted format).
This format is defined in rfc3447. If the error 'eTooSmall' is returned then one of the buffers is too small to hold the key.
- Parameters
-
pBuffer | [ in ] Block of memory to write the key into, when NULL the required size of this buffer is returned in pWritten |
cBuffer | [ in ] Number of bytes in the buffer pointed to by pBuffer. |
wantPEM | [ in ] if true then output is in PEM text format, otherwise binary data is returned |
pWritten | [ out ] Optional can be NULL, returns the number of bytes written into pBuffer. This parameter cannot be NULL when pBuffer is also NULL. |
- Returns
Success | P6R::eOk | |
Failure | P6R::eNotInitialized | Object is in an incorrect state. |
P6R::eInvalidArg | pBuffer and pWritten are NULL. |
P6R::eWrongKeyClass | The class of this key is not CKC_SYMMETRIC. |
P6R::eTooSmall | The buffers is too small to hold the requested value. |