Export more public key parameters.

This commit is contained in:
Alessio Di Mauro
2015-09-17 16:31:21 +02:00
parent b597374498
commit 2ea35bbd18
3 changed files with 96 additions and 1 deletions
+17
View File
@@ -288,6 +288,23 @@ CK_ULONG do_get_rsa_modulus_length(EVP_PKEY *key) {
}
CK_ULONG do_get_public_exponent(EVP_PKEY *key) {
CK_ULONG e = 0;
RSA *rsa;
rsa = EVP_PKEY_get1_RSA(key);
if (rsa == NULL)
return 0;
BN_bn2bin(rsa->e, (unsigned char *)&e);
RSA_free(rsa);
rsa = NULL;
return e;
}
/* #include <stdio.h> */
/* #include <openssl/err.h> */
/* ERR_load_crypto_strings(); */