Ruby: ext/openssl/ossl_pkey_rsa.c File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Data Structures | Macros | Functions | Variables
ossl_pkey_rsa.c File Reference
`#include "ossl.h"`

Go to the source code of this file.

## Data Structures
struct | rsa_blocking_gen_arg

## Macros
#define | GetPKeyRSA(obj, pkey)
#define | GetRSA(obj, rsa)
#define | DefRSAConst(x) rb_define_const(cRSA, #x, INT2NUM(RSA_##x))

## Functions
VALUE | ossl_rsa_new (EVP_PKEY *pkey)
void | Init_ossl_rsa (void)

## Variables
VALUE | cRSA
VALUE | eRSAError

## Macro Definition Documentation

## ◆ DefRSAConst

#define DefRSAConst | ( |  | x | ) | rb_define_const(cRSA, #x, INT2NUM(RSA_##x))

Definition at line 885 of file ossl_pkey_rsa.c.

## ◆ GetPKeyRSA

#define GetPKeyRSA | ( |  | obj,
|  |  | pkey
| ) |  |

Value:
do { \
GetPKey((obj), (pkey)); \
if (EVP_PKEY_base_id(pkey) != EVP_PKEY_RSA) { /* PARANOIA? */ \
ossl_raise(rb_eRuntimeError, "THIS IS NOT A RSA!") ; \
} \
} while (0)
rb_eRuntimeError
VALUE rb_eRuntimeError
Definition: error.c:1055

Definition at line 14 of file ossl_pkey_rsa.c.

## ◆ GetRSA

#define GetRSA | ( |  | obj,
|  |  | rsa
| ) |  |

Value:
do { \
EVP_PKEY *_pkey; \
GetPKeyRSA((obj), _pkey); \
(rsa) = EVP_PKEY_get0_RSA(_pkey); \
} while (0)

Definition at line 20 of file ossl_pkey_rsa.c.

## Function Documentation

## ◆ Init_ossl_rsa()

void Init_ossl_rsa | ( | void |  | ) |

Definition at line 888 of file ossl_pkey_rsa.c.

References cPKey, cRSA, DEF_OSSL_PKEY_BN, DefRSAConst, rsa_blocking_gen_arg::e, eOSSLError, ePKeyError, eRSAError, mOSSL, mPKey, rb_cObject, rb_define_alias(), rb_define_class_under(), rb_define_method, rb_define_module_under(), rb_define_singleton_method, and rsa_blocking_gen_arg::rsa.

Referenced by Init_ossl_pkey().

## ◆ ossl_rsa_new()

VALUE ossl_rsa_new | ( | EVP_PKEY * | pkey | ) |

Definition at line 73 of file ossl_pkey_rsa.c.

References cRSA, eRSAError, NewPKey, NULL, ossl_raise(), Qfalse, rb_eTypeError, and SetPKey.

## Variable Documentation

## ◆ cRSA

VALUE cRSA

Definition at line 44 of file ossl_pkey_rsa.c.

Referenced by Init_ossl_rsa(), and ossl_rsa_new().

## ◆ eRSAError

VALUE eRSAError

Definition at line 45 of file ossl_pkey_rsa.c.

Referenced by Init_ossl_rsa(), and ossl_rsa_new().