Lines Matching defs:rsa
37 #include "mincrypt/rsa.h"
45 #include <openssl/rsa.h>
56 RSA *rsa;
63 static int RSA_to_RSAPublicKey(RSA *rsa, RSAPublicKey *pkey)
76 if (RSA_size(rsa) != RSANUMBYTES) {
82 BN_copy(n, rsa->n);
96 pkey->exponent = BN_get_word(rsa->e);
178 RSA* rsa = RSA_new();
185 if (!pkey || !exponent || !rsa) {
191 RSA_generate_key_ex(rsa, 2048, exponent, NULL);
192 EVP_PKEY_set1_RSA(pkey, rsa);
210 if (!write_public_keyfile(rsa, file)) {
221 RSA_free(rsa);
245 key->rsa = RSA_new();
247 if (!PEM_read_RSAPrivateKey(f, &key->rsa, NULL, NULL)) {
250 RSA_free(key->rsa);
351 if (!RSA_sign(NID_sha1, token, token_size, sig, &len, key->rsa)) {