Ruby  2.0.0p645(2015-04-13revision50299)
Macros | Functions | Variables
ossl_pkcs12.c File Reference
#include "ossl.h"

Go to the source code of this file.

Macros

#define WrapPKCS12(klass, obj, p12)
 
#define GetPKCS12(obj, p12)
 
#define SafeGetPKCS12(obj, p12)
 
#define ossl_pkcs12_set_key(o, v)   rb_iv_set((o), "@key", (v))
 
#define ossl_pkcs12_set_cert(o, v)   rb_iv_set((o), "@certificate", (v))
 
#define ossl_pkcs12_set_ca_certs(o, v)   rb_iv_set((o), "@ca_certs", (v))
 
#define ossl_pkcs12_get_key(o)   rb_iv_get((o), "@key")
 
#define ossl_pkcs12_get_cert(o)   rb_iv_get((o), "@certificate")
 
#define ossl_pkcs12_get_ca_certs(o)   rb_iv_get((o), "@ca_certs")
 

Functions

static VALUE ossl_pkcs12_s_allocate (VALUE klass)
 
static VALUE ossl_pkcs12_s_create (int argc, VALUE *argv, VALUE self)
 
static VALUE ossl_pkcs12_initialize (int argc, VALUE *argv, VALUE self)
 
static VALUE ossl_pkcs12_to_der (VALUE self)
 
void Init_ossl_pkcs12 ()
 

Variables

VALUE cPKCS12
 
VALUE ePKCS12Error
 

Macro Definition Documentation

#define GetPKCS12 (   obj,
  p12 
)
Value:
do { \
Data_Get_Struct((obj), PKCS12, (p12)); \
if(!(p12)) ossl_raise(rb_eRuntimeError, "PKCS12 wasn't initialized."); \
} while (0)
#define Data_Get_Struct(obj, type, sval)
Definition: ruby.h:1025
if(dispIdMember==DISPID_VALUE)
Definition: win32ole.c:791
VALUE rb_eRuntimeError
Definition: error.c:515
void ossl_raise(VALUE exc, const char *fmt,...)
Definition: ossl.c:333

Definition at line 13 of file ossl_pkcs12.c.

Referenced by ossl_pkcs12_to_der().

#define ossl_pkcs12_get_ca_certs (   o)    rb_iv_get((o), "@ca_certs")

Definition at line 28 of file ossl_pkcs12.c.

#define ossl_pkcs12_get_cert (   o)    rb_iv_get((o), "@certificate")

Definition at line 27 of file ossl_pkcs12.c.

#define ossl_pkcs12_get_key (   o)    rb_iv_get((o), "@key")

Definition at line 26 of file ossl_pkcs12.c.

#define ossl_pkcs12_set_ca_certs (   o,
  v 
)    rb_iv_set((o), "@ca_certs", (v))

Definition at line 25 of file ossl_pkcs12.c.

Referenced by ossl_pkcs12_initialize(), and ossl_pkcs12_s_create().

#define ossl_pkcs12_set_cert (   o,
  v 
)    rb_iv_set((o), "@certificate", (v))

Definition at line 24 of file ossl_pkcs12.c.

Referenced by ossl_pkcs12_initialize(), and ossl_pkcs12_s_create().

#define ossl_pkcs12_set_key (   o,
  v 
)    rb_iv_set((o), "@key", (v))

Definition at line 23 of file ossl_pkcs12.c.

Referenced by ossl_pkcs12_initialize(), and ossl_pkcs12_s_create().

#define SafeGetPKCS12 (   obj,
  p12 
)
Value:
do { \
GetPKCS12((obj), (p12)); \
} while (0)
VALUE cPKCS12
Definition: ossl_pkcs12.c:33
#define GetPKCS12(obj, p12)
Definition: ossl_pkcs12.c:13
#define OSSL_Check_Kind(obj, klass)
Definition: ossl.h:96

Definition at line 18 of file ossl_pkcs12.c.

#define WrapPKCS12 (   klass,
  obj,
  p12 
)
Value:
do { \
if(!(p12)) ossl_raise(rb_eRuntimeError, "PKCS12 wasn't initialized."); \
(obj) = Data_Wrap_Struct((klass), 0, PKCS12_free, (p12)); \
} while (0)
if(dispIdMember==DISPID_VALUE)
Definition: win32ole.c:791
#define Data_Wrap_Struct(klass, mark, free, sval)
Definition: ruby.h:1007
VALUE rb_eRuntimeError
Definition: error.c:515
void ossl_raise(VALUE exc, const char *fmt,...)
Definition: ossl.c:333

Definition at line 8 of file ossl_pkcs12.c.

Referenced by ossl_pkcs12_s_allocate(), and ossl_pkcs12_s_create().

Function Documentation

void Init_ossl_pkcs12 ( void  )
static VALUE ossl_pkcs12_initialize ( int  argc,
VALUE argv,
VALUE  self 
)
static
static VALUE ossl_pkcs12_s_allocate ( VALUE  klass)
static

Definition at line 40 of file ossl_pkcs12.c.

References ePKCS12Error, NULL, ossl_raise(), and WrapPKCS12.

Referenced by Init_ossl_pkcs12().

static VALUE ossl_pkcs12_s_create ( int  argc,
VALUE argv,
VALUE  self 
)
static
static VALUE ossl_pkcs12_to_der ( VALUE  self)
static

Definition at line 175 of file ossl_pkcs12.c.

References ePKCS12Error, GetPKCS12, NULL, ossl_raise(), ossl_str_adjust, p, rb_str_new(), and RSTRING_PTR.

Referenced by Init_ossl_pkcs12().

Variable Documentation

VALUE cPKCS12

Definition at line 33 of file ossl_pkcs12.c.

Referenced by Init_ossl_pkcs12(), and ossl_pkcs12_s_create().

VALUE ePKCS12Error