Lines Matching refs:rsa
44 int AuthSign(void *rsa, const unsigned char *token, size_t tokenSize, void *sig)
68 int RSA2RSAPublicKey(RSA *rsa, RSAPublicKey *publicKey) in RSA2RSAPublicKey() argument
81 BN_copy(n, rsa->n); in RSA2RSAPublicKey()
82 publicKey->exponent = BN_get_word(rsa->e); in RSA2RSAPublicKey()
86 BIGNUM *n = (BIGNUM *)RSA_get0_n(rsa); in RSA2RSAPublicKey()
87 publicKey->exponent = BN_get_word(RSA_get0_e(rsa)); in RSA2RSAPublicKey()
90 BN_copy(n, rsa->n); in RSA2RSAPublicKey()
91 publicKey->exponent = BN_get_word(rsa->e); in RSA2RSAPublicKey()
96 if (RSA_size(rsa) != RSANUMBYTES) { in RSA2RSAPublicKey()
176 RSA *rsa = RSA_new(); in GenerateKey() local
184 if (!publicKey || !exponent || !rsa) { in GenerateKey()
190 RSA_generate_key_ex(rsa, bits, exponent, nullptr); in GenerateKey()
191 EVP_PKEY_set1_RSA(publicKey, rsa); in GenerateKey()
205 if (!WritePublicKeyfile(rsa, file)) { in GenerateKey()
233 RSA *rsa = RSA_new(); in ReadKey() local
234 if (!PEM_read_RSAPrivateKey(f, &rsa, nullptr, nullptr)) { in ReadKey()
235 RSA_free(rsa); in ReadKey()
238 listPrivateKey->push_back((void *)rsa); in ReadKey()
292 int AuthSign(void *rsa, const unsigned char *token, size_t tokenSize, void *sig) in AuthSign() argument
295 if (!RSA_sign(NID_sha256, token, tokenSize, (unsigned char *)sig, &len, (RSA *)rsa)) { in AuthSign()
414 RSA *rsa = nullptr; in AuthVerify() local
415 if (!RSAPublicKey2RSA((const uint8_t *)ptr, &rsa)) { in AuthVerify()
420 siglen, rsa); in AuthVerify()
421 RSA_free(rsa); in AuthVerify()