Home | History | Annotate | Download | only in openssl

Lines Matching refs:RSA

10  * apply to all code found in this distribution, be it the RC4, RSA,
70 /* rsa.h contains functions for handling encryption and signature using RSA. */
75 /* RSA_new returns a new, empty RSA object or NULL on error. */
76 OPENSSL_EXPORT RSA *RSA_new(void);
79 OPENSSL_EXPORT RSA *RSA_new_method(const ENGINE *engine);
81 /* RSA_free decrements the reference count of |rsa| and frees it if the
83 OPENSSL_EXPORT void RSA_free(RSA *rsa);
85 /* RSA_up_ref increments the reference count of |rsa|. */
86 OPENSSL_EXPORT int RSA_up_ref(RSA *rsa);
91 /* RSA_generate_key_ex generates a new RSA key where the modulus has size
99 OPENSSL_EXPORT int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e,
112 /* RSA_encrypt encrypts |in_len| bytes from |in| to the public key from |rsa|
121 OPENSSL_EXPORT int RSA_encrypt(RSA *rsa, size_t *out_len, uint8_t *out,
126 * |rsa| and writes, at most, |max_out| bytes of plaintext to |out|. The
134 OPENSSL_EXPORT int RSA_decrypt(RSA *rsa, size_t *out_len, uint8_t *out,
139 * |rsa| and writes the encrypted data to |to|. The |to| buffer must have at
148 uint8_t *to, RSA *rsa, int padding);
151 * |rsa| and writes the plaintext to |to|. The |to| buffer must have at
160 uint8_t *to, RSA *rsa, int padding);
180 /* RSA_sign signs |in_len| bytes of digest from |in| with |rsa| and writes, at
181 * most, |RSA_size(rsa)| bytes to |out|. On successful return, the actual
191 unsigned int *out_len, RSA *rsa);
193 /* RSA_sign_raw signs |in_len| bytes from |in| with the public key from |rsa|
201 OPENSSL_EXPORT int RSA_sign_raw(RSA *rsa, size_t *out_len, uint8_t *out,
206 * signature of |msg_len| bytes at |msg| by |rsa|.
217 const uint8_t *sig, size_t sig_len, RSA *rsa);
220 * public key from |rsa| and writes, at most, |max_out| bytes of plaintext to
228 OPENSSL_EXPORT int RSA_verify_raw(RSA *rsa, size_t *out_len, uint8_t *out,
233 * |rsa| and writes the encrypted data to |to|. The |to| buffer must have at
241 uint8_t *to, RSA *rsa, int padding);
244 * public key in |rsa| and writes the plaintext to |to|. The |to| buffer must
252 uint8_t *to, RSA *rsa, int padding);
258 * of a signature of encrypted value using |rsa|. */
259 OPENSSL_EXPORT unsigned RSA_size(const RSA *rsa);
261 /* RSA_is_opaque returns one if |rsa| is opaque and doesn't expose its key
263 OPENSSL_EXPORT int RSA_is_opaque(const RSA *rsa);
265 /* RSAPublicKey_dup allocates a fresh |RSA| and copies the private key from
266 * |rsa| into it. It returns the fresh |RSA| object, or NULL on error. */
267 OPENSSL_EXPORT RSA *RSAPublicKey_dup(const RSA *rsa);
269 /* RSAPrivateKey_dup allocates a fresh |RSA| and copies the private key from
270 * |rsa| into it. It returns the fresh |RSA| object, or NULL on error. */
271 OPENSSL_EXPORT RSA *RSAPrivateKey_dup(const RSA *rsa);
273 /* RSA_check_key performs basic validatity tests on |rsa|. It returns one if
276 OPENSSL_EXPORT int RSA_check_key(const RSA *rsa);
278 /* RSA_recover_crt_params uses |rsa->n|, |rsa->d| and |rsa->e| in order to
280 * values are set in the |p|, |q|, |dmp1|, |dmq1| and |iqmp| members of |rsa|,
283 OPENSSL_EXPORT int RSA_recover_crt_params(RSA *rsa);
288 /* d2i_RSAPublicKey parses an ASN.1, DER-encoded, RSA public key from |len|
291 * written directly into |*out|, otherwise a fresh |RSA| is allocated. On
294 OPENSSL_EXPORT RSA *d2i_RSAPublicKey(RSA **out, const uint8_t **inp, long len);
300 OPENSSL_EXPORT int i2d_RSAPublicKey(const RSA *in, uint8_t **outp);
302 /* d2i_RSAPrivateKey parses an ASN.1, DER-encoded, RSA private key from |len|
305 * written directly into |*out|, otherwise a fresh |RSA| is allocated. On
308 OPENSSL_EXPORT RSA *d2i_RSAPrivateKey(RSA **out, const uint8_t **inp, long len);
314 OPENSSL_EXPORT int i2d_RSAPrivateKey(const RSA *in, uint8_t **outp);
325 OPENSSL_EXPORT int RSA_set_ex_data(RSA *r, int idx, void *arg);
326 OPENSSL_EXPORT void *RSA_get_ex_data(const RSA *r, int idx);
354 /* RSA public exponent values. */
365 int (*init)(RSA *rsa);
366 int (*finish)(RSA *rsa);
368 /* size returns the size of the RSA modulus in bytes. */
369 size_t (*size)(const RSA *rsa);
372 uint8_t *sigret, unsigned int *siglen, const RSA *rsa);
375 const uint8_t *sigbuf, unsigned int siglen, const RSA *rsa);
379 int (*encrypt)(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out,
381 int (*sign_raw)(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out,
384 int (*decrypt)(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out,
386 int (*verify_raw)(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out,
390 * d'th power of it, modulo the RSA modulus and writes the result as a
392 * |len| is always equal to |RSA_size(rsa)|. If the result of the transform
398 * RSA decrypt and sign operations will call this, thus an ENGINE might wish
401 int (*private_transform)(RSA *rsa, uint8_t *out, const uint8_t *in,
404 int (*mod_exp)(BIGNUM *r0, const BIGNUM *I, RSA *rsa,
412 int (*keygen)(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
433 /* be careful using this if the RSA structure is shared */