ossl_pkcs7.c File Reference
`#include "ossl.h"`

Go to the source code of this file.

## Macros

#define | WrapPKCS7(klass, obj, pkcs7)
#define | GetPKCS7(obj, pkcs7)
#define | SafeGetPKCS7(obj, pkcs7)
#define | WrapPKCS7si(klass, obj, p7si)
#define | GetPKCS7si(obj, p7si)
#define | SafeGetPKCS7si(obj, p7si)
#define | WrapPKCS7ri(klass, obj, p7ri)
#define | GetPKCS7ri(obj, p7ri)
#define | SafeGetPKCS7ri(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

static VALUE | ossl_pkcs7si_new (PKCS7_SIGNER_INFO *p7si)
static PKCS7_SIGNER_INFO * | DupPKCS7SignerPtr (VALUE obj)
static VALUE | ossl_pkcs7ri_new (PKCS7_RECIP_INFO *p7ri)
static PKCS7_RECIP_INFO * | DupPKCS7RecipientPtr (VALUE obj)
static VALUE | ossl_pkcs7_s_read_smime (VALUE klass, VALUE arg)
static VALUE | ossl_pkcs7_s_write_smime (int argc, VALUE *argv, VALUE klass)
static VALUE | ossl_pkcs7_s_sign (int argc, VALUE *argv, VALUE klass)
static VALUE | ossl_pkcs7_s_encrypt (int argc, VALUE *argv, VALUE klass)
static VALUE | ossl_pkcs7_alloc (VALUE klass)
static VALUE | ossl_pkcs7_initialize (int argc, VALUE *argv, VALUE self)
static VALUE | ossl_pkcs7_copy (VALUE self, VALUE other)
static int | ossl_pkcs7_sym2typeid (VALUE sym)
static VALUE | ossl_pkcs7_set_type (VALUE self, VALUE type)
static VALUE | ossl_pkcs7_get_type (VALUE self)
static VALUE | ossl_pkcs7_set_detached (VALUE self, VALUE flag)
static VALUE | ossl_pkcs7_get_detached (VALUE self)
static VALUE | ossl_pkcs7_detached_p (VALUE self)
static VALUE | ossl_pkcs7_set_cipher (VALUE self, VALUE cipher)
static VALUE | ossl_pkcs7_add_signer (VALUE self, VALUE signer)
static VALUE | ossl_pkcs7_get_signer (VALUE self)
static VALUE | ossl_pkcs7_add_recipient (VALUE self, VALUE recip)
static VALUE | ossl_pkcs7_get_recipient (VALUE self)
static VALUE | ossl_pkcs7_add_certificate (VALUE self, VALUE cert)
static | STACK_OF (X509)
static | STACK_OF (X509_CRL)
static VALUE | ossl_pkcs7_set_certs_i (VALUE i, VALUE arg)
static VALUE | ossl_pkcs7_set_certificates (VALUE self, VALUE ary)
static VALUE | ossl_pkcs7_get_certificates (VALUE self)
static VALUE | ossl_pkcs7_add_crl (VALUE self, VALUE crl)
static VALUE | ossl_pkcs7_set_crls_i (VALUE i, VALUE arg)
static VALUE | ossl_pkcs7_set_crls (VALUE self, VALUE ary)
static VALUE | ossl_pkcs7_get_crls (VALUE self)
static VALUE | ossl_pkcs7_verify (int argc, VALUE *argv, VALUE self)
static VALUE | ossl_pkcs7_decrypt (int argc, VALUE *argv, VALUE self)
static VALUE | ossl_pkcs7_add_data (VALUE self, VALUE data)
static VALUE | ossl_pkcs7_to_der (VALUE self)
static VALUE | ossl_pkcs7_to_pem (VALUE self)
static VALUE | ossl_pkcs7si_alloc (VALUE klass)
static VALUE | ossl_pkcs7si_initialize (VALUE self, VALUE cert, VALUE key, VALUE digest)
static VALUE | ossl_pkcs7si_get_issuer (VALUE self)
static VALUE | ossl_pkcs7si_get_serial (VALUE self)
static VALUE | ossl_pkcs7si_get_signed_time (VALUE self)
static VALUE | ossl_pkcs7ri_alloc (VALUE klass)
static VALUE | ossl_pkcs7ri_initialize (VALUE self, VALUE cert)
static VALUE | ossl_pkcs7ri_get_issuer (VALUE self)
static VALUE | ossl_pkcs7ri_get_serial (VALUE self)
static VALUE | ossl_pkcs7ri_get_enc_key (VALUE self)
void | Init_ossl_pkcs7 ()

## Variables

VALUE | cPKCS7
VALUE | cPKCS7Signer
VALUE | cPKCS7Recipient
VALUE | ePKCS7Error

## Macro Definition Documentation

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

Referenced by Init_ossl_pkcs7().

#define GetPKCS7 | ( |  | obj,
|  |  | pkcs7
| ) |  |

Value:
do { \
Data_Get_Struct((obj), PKCS7, (pkcs7)); \
if (!(pkcs7)) { \
ossl_raise(rb_eRuntimeError, "PKCS7 wasn't initialized."); \
} \
} while (0)

Definition at line 19 of file ossl_pkcs7.c.

Referenced by ossl_pkcs7_add_certificate(), ossl_pkcs7_add_crl(), ossl_pkcs7_add_data(), ossl_pkcs7_add_recipient(), ossl_pkcs7_add_signer(), ossl_pkcs7_copy(), ossl_pkcs7_decrypt(), ossl_pkcs7_detached_p(), ossl_pkcs7_get_detached(), ossl_pkcs7_get_recipient(), ossl_pkcs7_get_signer(), ossl_pkcs7_get_type(), ossl_pkcs7_set_cipher(), ossl_pkcs7_set_detached(), ossl_pkcs7_set_type(), ossl_pkcs7_to_der(), ossl_pkcs7_to_pem(), ossl_pkcs7_verify(), and STACK_OF().

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

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

Definition at line 53 of file ossl_pkcs7.c.

Referenced by ossl_pkcs7ri_get_enc_key(), ossl_pkcs7ri_get_issuer(), ossl_pkcs7ri_get_serial(), and ossl_pkcs7ri_initialize().

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

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

Definition at line 36 of file ossl_pkcs7.c.

Referenced by ossl_pkcs7si_get_issuer(), ossl_pkcs7si_get_serial(), ossl_pkcs7si_get_signed_time(), and ossl_pkcs7si_initialize().

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

Definition at line 64 of file ossl_pkcs7.c.

Referenced by ossl_pkcs7_sym2typeid().

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

Definition at line 67 of file ossl_pkcs7.c.

Referenced by ossl_pkcs7_s_write_smime(), and ossl_pkcs7_verify().

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

Definition at line 69 of file ossl_pkcs7.c.

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

Definition at line 66 of file ossl_pkcs7.c.

Referenced by ossl_pkcs7_add_data(), ossl_pkcs7_initialize(), ossl_pkcs7_s_encrypt(), ossl_pkcs7_s_read_smime(), ossl_pkcs7_s_sign(), and ossl_pkcs7_verify().

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

Definition at line 68 of file ossl_pkcs7.c.

Referenced by ossl_pkcs7_initialize(), ossl_pkcs7_s_read_smime(), ossl_pkcs7_s_sign(), and ossl_pkcs7_verify().

#define SafeGetPKCS7 | ( |  | obj,
|  |  | pkcs7
| ) |  |

Value:
do { \
OSSL_Check_Kind((obj), cPKCS7); \
GetPKCS7((obj), (pkcs7)); \
} while (0)

Definition at line 25 of file ossl_pkcs7.c.

Referenced by ossl_pkcs7_copy(), and ossl_pkcs7_s_write_smime().

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

Value:
do { \
OSSL_Check_Kind((obj), cPKCS7Recipient); \
GetPKCS7ri((obj), (p7ri)); \
} while (0)

Definition at line 59 of file ossl_pkcs7.c.

Referenced by DupPKCS7RecipientPtr().

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

Value:
do { \
OSSL_Check_Kind((obj), cPKCS7Signer); \
GetPKCS7si((obj), (p7si)); \
} while (0)

Definition at line 42 of file ossl_pkcs7.c.

Referenced by DupPKCS7SignerPtr().

#define WrapPKCS7 | ( |  | klass,
|  |  | obj,
|  |  | pkcs7
| ) |  |

Value:
do { \
if (!(pkcs7)) { \
ossl_raise(rb_eRuntimeError, "PKCS7 wasn't initialized."); \
} \
(obj) = Data_Wrap_Struct((klass), 0, PKCS7_free, (pkcs7)); \
} while (0)

Definition at line 13 of file ossl_pkcs7.c.

Referenced by ossl_pkcs7_alloc(), ossl_pkcs7_s_encrypt(), ossl_pkcs7_s_read_smime(), and ossl_pkcs7_s_sign().

#define WrapPKCS7ri | ( |  | klass,
|  |  | obj,
|  |  | p7ri
| ) |  |

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

Definition at line 47 of file ossl_pkcs7.c.

Referenced by ossl_pkcs7ri_alloc(), and ossl_pkcs7ri_new().

#define WrapPKCS7si | ( |  | klass,
|  |  | obj,
|  |  | p7si
| ) |  |

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

Definition at line 30 of file ossl_pkcs7.c.

Referenced by ossl_pkcs7si_alloc(), and ossl_pkcs7si_new().

## Function Documentation

static PKCS7_RECIP_INFO* DupPKCS7RecipientPtr | ( | VALUE | obj | ) |

static

Definition at line 123 of file ossl_pkcs7.c.

References ePKCS7Error, NULL, ossl_raise(), PKCS7_RECIP_INFO_dup, and SafeGetPKCS7ri.

Referenced by ossl_pkcs7_add_recipient().

static PKCS7_SIGNER_INFO* DupPKCS7SignerPtr | ( | VALUE | obj | ) |

static

Definition at line 97 of file ossl_pkcs7.c.

References ePKCS7Error, NULL, ossl_raise(), PKCS7_SIGNER_INFO_dup, and SafeGetPKCS7si.

Referenced by ossl_pkcs7_add_signer().

void Init_ossl_pkcs7 | ( | void |  | ) |

Definition at line 981 of file ossl_pkcs7.c.

References BINARY, cPKCS7, cPKCS7Recipient, cPKCS7Signer, DefPKCS7Const, eOSSLError, ePKCS7Error, mOSSL, ossl_pkcs7_add_certificate(), ossl_pkcs7_add_crl(), ossl_pkcs7_add_data(), ossl_pkcs7_add_recipient(), ossl_pkcs7_add_signer(), ossl_pkcs7_alloc(), ossl_pkcs7_copy(), ossl_pkcs7_decrypt(), ossl_pkcs7_detached_p(), ossl_pkcs7_get_certificates(), ossl_pkcs7_get_crls(), ossl_pkcs7_get_detached(), ossl_pkcs7_get_recipient(), ossl_pkcs7_get_signer(), ossl_pkcs7_get_type(), ossl_pkcs7_initialize(), ossl_pkcs7_s_encrypt(), ossl_pkcs7_s_read_smime(), ossl_pkcs7_s_sign(), ossl_pkcs7_s_write_smime(), ossl_pkcs7_set_certificates(), ossl_pkcs7_set_cipher(), ossl_pkcs7_set_crls(), ossl_pkcs7_set_detached(), ossl_pkcs7_set_type(), ossl_pkcs7_to_der(), ossl_pkcs7_to_pem(), ossl_pkcs7_verify(), ossl_pkcs7ri_alloc(), ossl_pkcs7ri_get_enc_key(), ossl_pkcs7ri_get_issuer(), ossl_pkcs7ri_get_serial(), ossl_pkcs7ri_initialize(), ossl_pkcs7si_alloc(), ossl_pkcs7si_get_issuer(), ossl_pkcs7si_get_serial(), ossl_pkcs7si_get_signed_time(), ossl_pkcs7si_initialize(), Qfalse, rb_attr(), rb_cObject, rb_define_alias(), rb_define_alloc_func(), rb_define_class_under(), rb_define_const(), rb_define_copy_func, rb_define_method(), rb_define_singleton_method(), and rb_intern.

Referenced by Init_openssl().

static VALUE ossl_pkcs7_add_certificate | ( | VALUE | self,
|  | VALUE | cert
| ) |  |

static

Definition at line 566 of file ossl_pkcs7.c.

References ePKCS7Error, GetPKCS7, GetX509CertPtr(), NULL, and ossl_raise().

Referenced by Init_ossl_pkcs7(), and ossl_pkcs7_set_certs_i().

static VALUE ossl_pkcs7_add_crl | ( | VALUE | self,
|  | VALUE | crl
| ) |  |

static

Definition at line 652 of file ossl_pkcs7.c.

References ePKCS7Error, GetPKCS7, GetX509CRLPtr(), NULL, and ossl_raise().

Referenced by Init_ossl_pkcs7(), and ossl_pkcs7_set_crls_i().

static VALUE ossl_pkcs7_add_data | ( | VALUE | self,
|  | VALUE | data
| ) |  |

static

Definition at line 763 of file ossl_pkcs7.c.

References buf, ePKCS7Error, err, GetPKCS7, len, NULL, ossl_obj2bio(), ossl_pkcs7_set_data, ossl_raise(), and Qnil.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_add_recipient | ( | VALUE | self,
|  | VALUE | recip
| ) |  |

static

Definition at line 522 of file ossl_pkcs7.c.

References DupPKCS7RecipientPtr(), ePKCS7Error, GetPKCS7, and ossl_raise().

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_add_signer | ( | VALUE | self,
|  | VALUE | signer
| ) |  |

static

Definition at line 476 of file ossl_pkcs7.c.

References DupPKCS7SignerPtr(), ePKCS7Error, GetPKCS7, and ossl_raise().

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_alloc | ( | VALUE | klass | ) |

static

Definition at line 289 of file ossl_pkcs7.c.

References ePKCS7Error, NULL, ossl_raise(), and WrapPKCS7.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_copy | ( | VALUE | self,
|  | VALUE | other
| ) |  |

static

Definition at line 340 of file ossl_pkcs7.c.

References DATA_PTR, ePKCS7Error, GetPKCS7, NULL, ossl_raise(), rb_check_frozen, and SafeGetPKCS7.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_decrypt | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |

static

Definition at line 736 of file ossl_pkcs7.c.

References ePKCS7Error, GetPKCS7, GetPrivPKeyPtr(), GetX509CertPtr(), NIL_P, NULL, NUM2INT, ossl_membio2str(), ossl_raise(), and rb_scan_args().

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_detached_p | ( | VALUE | self | ) |

static

Definition at line 455 of file ossl_pkcs7.c.

References GetPKCS7, PKCS7_is_detached, Qfalse, and Qtrue.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_get_certificates | ( | VALUE | self | ) |

static

Definition at line 646 of file ossl_pkcs7.c.

References ossl_x509_sk2ary().

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_get_crls | ( | VALUE | self | ) |

static

Definition at line 686 of file ossl_pkcs7.c.

References ossl_x509crl_sk2ary().

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_get_detached | ( | VALUE | self | ) |

static

Definition at line 447 of file ossl_pkcs7.c.

References GetPKCS7, Qfalse, and Qtrue.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_get_recipient | ( | VALUE | self | ) |

static

Definition at line 538 of file ossl_pkcs7.c.

References ePKCS7Error, GetPKCS7, i, NULL, ossl_pkcs7ri_new(), ossl_raise(), rb_ary_new(), rb_ary_new2(), rb_ary_push(), and STACK_OF().

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_get_signer | ( | VALUE | self | ) |

static

Definition at line 496 of file ossl_pkcs7.c.

References ePKCS7Error, GetPKCS7, i, OSSL_Debug, ossl_pkcs7si_new(), ossl_raise(), rb_ary_new(), rb_ary_new2(), rb_ary_push(), and STACK_OF().

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_get_type | ( | VALUE | self | ) |

static

Definition at line 414 of file ossl_pkcs7.c.

References GetPKCS7, ID2SYM, PKCS7_type_is_encrypted, Qnil, and rb_intern.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_initialize | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |

static

Definition at line 310 of file ossl_pkcs7.c.

References arg, DATA_PTR, NULL, OSSL_BIO_reset, ossl_obj2bio(), ossl_pkcs7_set_data, ossl_pkcs7_set_err_string, ossl_raise(), ossl_to_der_if_possible(), Qnil, rb_eArgError, and rb_scan_args().

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_s_encrypt | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 242 of file ossl_pkcs7.c.

References cPKCS7, ePKCS7Error, GetCipherPtr(), NIL_P, NULL, NUM2INT, ossl_obj2bio(), ossl_pkcs7_set_data, ossl_raise(), rb_jump_tag(), rb_scan_args(), STACK_OF(), and WrapPKCS7.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_s_read_smime | ( | VALUE | klass,
|  | VALUE | arg
| ) |  |

static

Definition at line 140 of file ossl_pkcs7.c.

References cPKCS7, ePKCS7Error, NULL, ossl_membio2str(), ossl_obj2bio(), ossl_pkcs7_set_data, ossl_pkcs7_set_err_string, ossl_raise(), Qnil, and WrapPKCS7.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_s_sign | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 199 of file ossl_pkcs7.c.

References cPKCS7, ePKCS7Error, GetPrivPKeyPtr(), GetX509CertPtr(), NIL_P, NULL, NUM2INT, ossl_obj2bio(), ossl_pkcs7_set_data, ossl_pkcs7_set_err_string, ossl_raise(), Qnil, rb_jump_tag(), rb_scan_args(), STACK_OF(), and WrapPKCS7.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_s_write_smime | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |

static

Definition at line 164 of file ossl_pkcs7.c.

References ePKCS7Error, NIL_P, NULL, NUM2INT, ossl_membio2str(), ossl_obj2bio(), ossl_pkcs7_get_data, ossl_raise(), PKCS7_is_detached, rb_scan_args(), and SafeGetPKCS7.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_set_certificates | ( | VALUE | self,
|  | VALUE | ary
| ) |  |

static

Definition at line 633 of file ossl_pkcs7.c.

References ossl_pkcs7_set_certs_i(), rb_block_call, rb_intern, and STACK_OF().

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_set_certs_i | ( | VALUE | i,
|  | VALUE | arg
| ) |  |

static

Definition at line 627 of file ossl_pkcs7.c.

References ossl_pkcs7_add_certificate().

Referenced by ossl_pkcs7_set_certificates().

static VALUE ossl_pkcs7_set_cipher | ( | VALUE | self,
|  | VALUE | cipher
| ) |  |

static

Definition at line 463 of file ossl_pkcs7.c.

References ePKCS7Error, GetCipherPtr(), GetPKCS7, NULL, and ossl_raise().

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_set_crls | ( | VALUE | self,
|  | VALUE | ary
| ) |  |

static

Definition at line 673 of file ossl_pkcs7.c.

References ossl_pkcs7_set_crls_i(), rb_block_call, rb_intern, and STACK_OF().

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_set_crls_i | ( | VALUE | i,
|  | VALUE | arg
| ) |  |

static

Definition at line 667 of file ossl_pkcs7.c.

References ossl_pkcs7_add_crl().

Referenced by ossl_pkcs7_set_crls().

static VALUE ossl_pkcs7_set_detached | ( | VALUE | self,
|  | VALUE | flag
| ) |  |

static

Definition at line 433 of file ossl_pkcs7.c.

References ePKCS7Error, GetPKCS7, NULL, ossl_raise(), Qfalse, and Qtrue.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_set_type | ( | VALUE | self,
|  | VALUE | type
| ) |  |

static

Definition at line 398 of file ossl_pkcs7.c.

References ePKCS7Error, GetPKCS7, NULL, ossl_pkcs7_sym2typeid(), ossl_raise(), and type.

Referenced by Init_ossl_pkcs7().

static int ossl_pkcs7_sym2typeid | ( | VALUE | sym | ) |

static

Definition at line 361 of file ossl_pkcs7.c.

References ePKCS7Error, i, name, NULL, numberof, ossl_raise(), Qnil, rb_id2name(), StringValuePtr, SYM2ID, T_SYMBOL, and TYPE.

Referenced by ossl_pkcs7_set_type().

static VALUE ossl_pkcs7_to_der | ( | VALUE | self | ) |

static

Definition at line 797 of file ossl_pkcs7.c.

References ePKCS7Error, GetPKCS7, len, NULL, ossl_raise(), ossl_str_adjust, p, rb_str_new(), and RSTRING_PTR.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_to_pem | ( | VALUE | self | ) |

static

Definition at line 817 of file ossl_pkcs7.c.

References ePKCS7Error, GetPKCS7, NULL, ossl_membio2str(), and ossl_raise().

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7_verify | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |

static

Definition at line 692 of file ossl_pkcs7.c.

References ePKCS7Error, GetPKCS7, GetX509StorePtr(), msg, NIL_P, NULL, NUM2INT, ossl_membio2str(), ossl_obj2bio(), ossl_pkcs7_get_data, ossl_pkcs7_set_data, ossl_pkcs7_set_err_string, ossl_raise(), Qfalse, Qnil, Qtrue, rb_jump_tag(), rb_scan_args(), rb_str_new2(), and STACK_OF().

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7ri_alloc | ( | VALUE | klass | ) |

static

Definition at line 919 of file ossl_pkcs7.c.

References ePKCS7Error, NULL, ossl_raise(), and WrapPKCS7ri.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7ri_get_enc_key | ( | VALUE | self | ) |

static

Definition at line 968 of file ossl_pkcs7.c.

References asn1str_to_str(), and GetPKCS7ri.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7ri_get_issuer | ( | VALUE | self | ) |

static

Definition at line 948 of file ossl_pkcs7.c.

References GetPKCS7ri, and ossl_x509name_new().

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7ri_get_serial | ( | VALUE | self | ) |

static

Definition at line 958 of file ossl_pkcs7.c.

References asn1integer_to_num(), and GetPKCS7ri.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7ri_initialize | ( | VALUE | self,
|  | VALUE | cert
| ) |  |

static

Definition at line 933 of file ossl_pkcs7.c.

References ePKCS7Error, GetPKCS7ri, GetX509CertPtr(), NULL, and ossl_raise().

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7ri_new | ( | PKCS7_RECIP_INFO * | p7ri | ) |

static

Definition at line 110 of file ossl_pkcs7.c.

References cPKCS7Recipient, ePKCS7Error, NULL, ossl_raise(), PKCS7_RECIP_INFO_dup, and WrapPKCS7ri.

Referenced by ossl_pkcs7_get_recipient().

static VALUE ossl_pkcs7si_alloc | ( | VALUE | klass | ) |

static

Definition at line 840 of file ossl_pkcs7.c.

References ePKCS7Error, NULL, ossl_raise(), and WrapPKCS7si.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7si_get_issuer | ( | VALUE | self | ) |

static

Definition at line 873 of file ossl_pkcs7.c.

References GetPKCS7si, and ossl_x509name_new().

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7si_get_serial | ( | VALUE | self | ) |

static

Definition at line 883 of file ossl_pkcs7.c.

References asn1integer_to_num(), and GetPKCS7si.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7si_get_signed_time | ( | VALUE | self | ) |

static

Definition at line 893 of file ossl_pkcs7.c.

References asn1time_to_time(), ePKCS7Error, GetPKCS7si, NULL, ossl_raise(), and Qnil.

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7si_initialize | ( | VALUE | self,
|  | VALUE | cert,
|  | VALUE | key,
|  | VALUE | digest
| ) |  |

static

Definition at line 854 of file ossl_pkcs7.c.

References ePKCS7Error, GetDigestPtr(), GetPKCS7si, GetPrivPKeyPtr(), GetX509CertPtr(), NULL, and ossl_raise().

Referenced by Init_ossl_pkcs7().

static VALUE ossl_pkcs7si_new | ( | PKCS7_SIGNER_INFO * | p7si | ) |

static

Definition at line 84 of file ossl_pkcs7.c.

References cPKCS7Signer, ePKCS7Error, NULL, ossl_raise(), PKCS7_SIGNER_INFO_dup, and WrapPKCS7si.

Referenced by ossl_pkcs7_get_signer().

static STACK_OF | ( | X509 |  | ) |

static

Definition at line 580 of file ossl_pkcs7.c.

References GetPKCS7, i, NULL, and STACK_OF().

static STACK_OF | ( | X509_CRL |  | ) |

static

Definition at line 603 of file ossl_pkcs7.c.

References GetPKCS7, i, NULL, and STACK_OF().

## Variable Documentation

VALUE cPKCS7

Definition at line 74 of file ossl_pkcs7.c.

Referenced by Init_ossl_pkcs7(), ossl_pkcs7_s_encrypt(), ossl_pkcs7_s_read_smime(), and ossl_pkcs7_s_sign().

VALUE cPKCS7Recipient

Definition at line 76 of file ossl_pkcs7.c.

Referenced by Init_ossl_pkcs7(), and ossl_pkcs7ri_new().

VALUE cPKCS7Signer

Definition at line 75 of file ossl_pkcs7.c.

Referenced by Init_ossl_pkcs7(), and ossl_pkcs7si_new().

VALUE ePKCS7Error

Definition at line 77 of file ossl_pkcs7.c.

Referenced by DupPKCS7RecipientPtr(), DupPKCS7SignerPtr(), Init_ossl_pkcs7(), ossl_pkcs7_add_certificate(), ossl_pkcs7_add_crl(), ossl_pkcs7_add_data(), ossl_pkcs7_add_recipient(), ossl_pkcs7_add_signer(), ossl_pkcs7_alloc(), ossl_pkcs7_copy(), ossl_pkcs7_decrypt(), ossl_pkcs7_get_recipient(), ossl_pkcs7_get_signer(), ossl_pkcs7_s_encrypt(), ossl_pkcs7_s_read_smime(), ossl_pkcs7_s_sign(), ossl_pkcs7_s_write_smime(), ossl_pkcs7_set_cipher(), ossl_pkcs7_set_detached(), ossl_pkcs7_set_type(), ossl_pkcs7_sym2typeid(), ossl_pkcs7_to_der(), ossl_pkcs7_to_pem(), ossl_pkcs7_verify(), ossl_pkcs7ri_alloc(), ossl_pkcs7ri_initialize(), ossl_pkcs7ri_new(), ossl_pkcs7si_alloc(), ossl_pkcs7si_get_signed_time(), ossl_pkcs7si_initialize(), and ossl_pkcs7si_new().