Ruby: ext/openssl/ossl_pkcs7.c File Reference

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

Macros | Functions | Variables
ossl_pkcs7.c File Reference
`#include "ossl.h"`

Go to the source code of this file.

## Macros
#define | NewPKCS7si(klass) TypedData_Wrap_Struct((klass), &ossl_pkcs7_signer_info_type, 0)
#define | SetPKCS7si(obj, p7si)
#define | GetPKCS7si(obj, p7si)
#define | NewPKCS7ri(klass) TypedData_Wrap_Struct((klass), &ossl_pkcs7_recip_info_type, 0)
#define | SetPKCS7ri(obj, p7ri)
#define | GetPKCS7ri(obj, p7ri)
#define | numberof(ary) (int)(sizeof(ary)/sizeof((ary)[0]))
#define | ossl_pkcs7_set_data(o, v) rb_iv_set((o), "@data", (v))
#define | ossl_pkcs7_get_data(o) rb_iv_get((o), "@data")
#define | ossl_pkcs7_set_err_string(o, v) rb_iv_set((o), "@error_string", (v))
#define | ossl_pkcs7_get_err_string(o) rb_iv_get((o), "@error_string")
#define | DefPKCS7Const(x) rb_define_const(cPKCS7, #x, INT2NUM(PKCS7_##x))

## Functions
void | Init_ossl_pkcs7 (void)

## Variables
VALUE | cPKCS7
VALUE | cPKCS7Signer
VALUE | cPKCS7Recipient
VALUE | ePKCS7Error
const rb_data_type_t | ossl_pkcs7_type

## Macro Definition Documentation

## ◆ DefPKCS7Const

#define DefPKCS7Const | ( |  | x | ) | rb_define_const(cPKCS7, #x, INT2NUM(PKCS7_##x))

## ◆ GetPKCS7ri

#define GetPKCS7ri | ( |  | obj,
|  |  | p7ri
| ) |  |

Value:
do { \
TypedData_Get_Struct((obj), PKCS7_RECIP_INFO, &ossl_pkcs7_recip_info_type, (p7ri)); \
if (!(p7ri)) { \
ossl_raise(rb_eRuntimeError, "PKCS7ri wasn't initialized."); \
} \
} while (0)
rb_eRuntimeError
VALUE rb_eRuntimeError
Definition: error.c:1055

Definition at line 35 of file ossl_pkcs7.c.

## ◆ GetPKCS7si

#define GetPKCS7si | ( |  | obj,
|  |  | p7si
| ) |  |

Value:
do { \
TypedData_Get_Struct((obj), PKCS7_SIGNER_INFO, &ossl_pkcs7_signer_info_type, (p7si)); \
if (!(p7si)) { \
ossl_raise(rb_eRuntimeError, "PKCS7si wasn't initialized."); \
} \
} while (0)

Definition at line 20 of file ossl_pkcs7.c.

## ◆ NewPKCS7ri

#define NewPKCS7ri | ( |  | klass | ) | TypedData_Wrap_Struct((klass), &ossl_pkcs7_recip_info_type, 0)

Definition at line 27 of file ossl_pkcs7.c.

## ◆ NewPKCS7si

#define NewPKCS7si | ( |  | klass | ) | TypedData_Wrap_Struct((klass), &ossl_pkcs7_signer_info_type, 0)

Definition at line 12 of file ossl_pkcs7.c.

## ◆ numberof

#define numberof | ( |  | ary | ) | (int)(sizeof(ary)/sizeof((ary)[0]))

Definition at line 42 of file ossl_pkcs7.c.

## ◆ ossl_pkcs7_get_data

#define ossl_pkcs7_get_data | ( |  | o | ) | rb_iv_get((o), "@data")

Definition at line 45 of file ossl_pkcs7.c.

## ◆ ossl_pkcs7_get_err_string

#define ossl_pkcs7_get_err_string | ( |  | o | ) | rb_iv_get((o), "@error_string")

Definition at line 47 of file ossl_pkcs7.c.

## ◆ ossl_pkcs7_set_data

#define ossl_pkcs7_set_data | ( |  | o,
|  |  | v
| ) |  | rb_iv_set((o), "@data", (v))

Definition at line 44 of file ossl_pkcs7.c.

## ◆ ossl_pkcs7_set_err_string

#define ossl_pkcs7_set_err_string | ( |  | o,
|  |  | v
| ) |  | rb_iv_set((o), "@error_string", (v))

Definition at line 46 of file ossl_pkcs7.c.

## ◆ SetPKCS7ri

#define SetPKCS7ri | ( |  | obj,
|  |  | p7ri
| ) |  |

Value:
do { \
if (!(p7ri)) { \
ossl_raise(rb_eRuntimeError, "PKCS7ri wasn't initialized."); \
} \
RTYPEDDATA_DATA(obj) = (p7ri); \
} while (0)

Definition at line 29 of file ossl_pkcs7.c.

## ◆ SetPKCS7si

#define SetPKCS7si | ( |  | obj,
|  |  | p7si
| ) |  |

Value:
do { \
if (!(p7si)) { \
ossl_raise(rb_eRuntimeError, "PKCS7si wasn't initialized."); \
} \
RTYPEDDATA_DATA(obj) = (p7si); \
} while (0)

Definition at line 14 of file ossl_pkcs7.c.

## Function Documentation

## ◆ Init_ossl_pkcs7()

void Init_ossl_pkcs7 | ( | void |  | ) |

Definition at line 1028 of file ossl_pkcs7.c.

References BINARY, cPKCS7, cPKCS7Recipient, cPKCS7Signer, DefPKCS7Const, eOSSLError, ePKCS7Error, mOSSL, Qfalse, rb_attr(), rb_cObject, rb_define_alias(), rb_define_alloc_func(), rb_define_class_under(), rb_define_const(), rb_define_method, rb_define_module(), rb_define_singleton_method, rb_eStandardError, and rb_intern().

Referenced by Init_openssl().

## Variable Documentation

## ◆ cPKCS7

VALUE cPKCS7

Definition at line 52 of file ossl_pkcs7.c.

Referenced by Init_ossl_pkcs7().

## ◆ cPKCS7Recipient

VALUE cPKCS7Recipient

Definition at line 54 of file ossl_pkcs7.c.

Referenced by Init_ossl_pkcs7().

## ◆ cPKCS7Signer

VALUE cPKCS7Signer

Definition at line 53 of file ossl_pkcs7.c.

Referenced by Init_ossl_pkcs7().

## ◆ ePKCS7Error

VALUE ePKCS7Error

Definition at line 55 of file ossl_pkcs7.c.

Referenced by Init_ossl_pkcs7().

## ◆ ossl_pkcs7_type

const rb_data_type_t ossl_pkcs7_type

Initial value:
= {
"OpenSSL/PKCS7",
{
0, ossl_pkcs7_free,
},
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
}
RUBY_TYPED_FREE_IMMEDIATELY
@ RUBY_TYPED_FREE_IMMEDIATELY
Definition: rtypeddata.h:62

Definition at line 63 of file ossl_pkcs7.c.