Parent topic:MPLAB® Harmony Crypto Library
int CRYPT_RSA_EncryptSizeGet(
CRYPT_RSA_CTX* rsa
);
This function retrieves the size of the RSA key in use for the context.
The context must be initialized with a call to CRYPT_RSA_Initialize and the keys decoded either with CRYPT_RSA_PrivateKeyDecode or CRYPT_RSA_PublicKeyDecode.
Parameters | Description |
---|---|
rsa | Pointer to context which saves state between calls. |
-
BAD_FUNC_ARG - An invalid pointer was passed to the function.
-
int - Size of the key.
None.
CRYPT_RSA_CTX mcRsa;
int ret;
unsigned int keySz = (unsigned int)sizeof(client_key_der_1024);
byte out1[256];
ret = CRYPT_RSA_Initialize(&mcRsa);
ret = CRYPT_RSA_PrivateKeyDecode(&mcRsa, client_key_der_1024, keySz);
ret = CRYPT_RSA_EncryptSizeGet(&mcRsa);