Ruby 2.0.0p247(2013-06-27revision41674)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions | Variables
ossl_x509name.c File Reference
`#include "ossl.h"`
Include dependency graph for ossl_x509name.c:

Go to the source code of this file.

## Macros
#define | WrapX509Name(klass, obj, name)
#define | GetX509Name(obj, name)
#define | SafeGetX509Name(obj, name)
#define | OBJECT_TYPE_TEMPLATE rb_const_get(cX509Name, rb_intern("OBJECT_TYPE_TEMPLATE"))
#define | DEFAULT_OBJECT_TYPE rb_const_get(cX509Name, rb_intern("DEFAULT_OBJECT_TYPE"))
#define | rb_aref(obj, key) rb_funcall((obj), id_aref, 1, (key))

## Functions
VALUE | ossl_x509name_new (X509_NAME *name)
X509_NAME * | GetX509NamePtr (VALUE obj)
static VALUE | ossl_x509name_alloc (VALUE klass)
static VALUE | ossl_x509name_add_entry (int, VALUE *, VALUE)
static VALUE | ossl_x509name_init_i (VALUE i, VALUE args)
static VALUE | ossl_x509name_initialize (int argc, VALUE *argv, VALUE self)
static VALUE | ossl_x509name_to_s_old (VALUE self)
static VALUE | ossl_x509name_to_s (int argc, VALUE *argv, VALUE self)
static VALUE | ossl_x509name_to_a (VALUE self)
static int | ossl_x509name_cmp0 (VALUE self, VALUE other)
static VALUE | ossl_x509name_cmp (VALUE self, VALUE other)
static VALUE | ossl_x509name_eql (VALUE self, VALUE other)
static VALUE | ossl_x509name_hash (VALUE self)
static VALUE | ossl_x509name_to_der (VALUE self)
void | Init_ossl_x509name ()

## Variables
VALUE | cX509Name
VALUE | eX509NameError
static ID | id_aref

## Macro Definition Documentation

#define DEFAULT_OBJECT_TYPE rb_const_get(cX509Name, rb_intern("DEFAULT_OBJECT_TYPE"))

Definition at line 32 of file ossl_x509name.c.

Referenced by ossl_x509name_init_i().

#define GetX509Name | ( |  | obj,
|  |  | name
| ) |  |

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

Definition at line 19 of file ossl_x509name.c.

Referenced by ossl_x509name_add_entry(), ossl_x509name_cmp0(), ossl_x509name_hash(), ossl_x509name_initialize(), ossl_x509name_to_a(), ossl_x509name_to_der(), ossl_x509name_to_s(), and ossl_x509name_to_s_old().

#define OBJECT_TYPE_TEMPLATE rb_const_get(cX509Name, rb_intern("OBJECT_TYPE_TEMPLATE"))

Definition at line 30 of file ossl_x509name.c.

Referenced by ossl_x509name_add_entry(), and ossl_x509name_initialize().

#define rb_aref | ( |  | obj,
|  |  | key
| ) |  | rb_funcall((obj), id_aref, 1, (key))

Definition at line 92 of file ossl_x509name.c.

Referenced by ossl_x509name_add_entry(), and ossl_x509name_init_i().

#define SafeGetX509Name | ( |  | obj,
|  |  | name
| ) |  |

Value:
do { \
OSSL_Check_Kind((obj), cX509Name); \
GetX509Name((obj), (name)); \
} while (0)

Definition at line 25 of file ossl_x509name.c.

Referenced by GetX509NamePtr(), and ossl_x509name_cmp0().

#define WrapX509Name | ( |  | klass,
|  |  | obj,
|  |  | name
| ) |  |

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

Definition at line 13 of file ossl_x509name.c.

Referenced by ossl_x509name_alloc(), and ossl_x509name_new().

## Function Documentation

X509_NAME* GetX509NamePtr | ( | VALUE | obj) |  |

Definition at line 64 of file ossl_x509name.c.

References name, and SafeGetX509Name.

Referenced by ossl_x509_set_issuer(), ossl_x509_set_subject(), ossl_x509crl_set_issuer(), and ossl_x509req_set_subject().

void Init_ossl_x509name | ( | void | ) |  |

Definition at line 428 of file ossl_x509name.c.

References cX509Name, eOSSLError, eX509NameError, hash(), id_aref, INT2NUM, mX509, ossl_x509name_add_entry(), ossl_x509name_alloc(), ossl_x509name_cmp(), ossl_x509name_eql(), ossl_x509name_hash(), ossl_x509name_initialize(), ossl_x509name_to_a(), ossl_x509name_to_der(), ossl_x509name_to_s(), rb_cObject, rb_define_alias(), rb_define_alloc_func(), rb_define_class_under(), rb_define_const(), rb_define_method(), rb_hash_aset(), rb_hash_new(), rb_include_module(), rb_intern, rb_mComparable, rb_str_new2, RHASH, and ULONG2NUM.

Referenced by Init_ossl_x509().

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

Definition at line 182 of file ossl_x509name.c.

References eX509NameError, GetX509Name, name, NIL_P, NULL, NUM2INT, OBJECT_TYPE_TEMPLATE, ossl_raise(), rb_aref, rb_scan_args(), RSTRING_LENINT, RSTRING_PTR, StringValue, and type.

Referenced by Init_ossl_x509name(), and ossl_x509name_init_i().

static VALUE ossl_x509name_alloc | ( | VALUE | klass) |  |
| static

Definition at line 77 of file ossl_x509name.c.

References eX509NameError, name, NULL, ossl_raise(), and WrapX509Name.

Referenced by Init_ossl_x509name().

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

Definition at line 318 of file ossl_x509name.c.

References INT2FIX, ossl_x509name_cmp0(), and result.

Referenced by Init_ossl_x509name().

static int ossl_x509name_cmp0 | ( | VALUE | self,
|  | VALUE | other
| ) |  |
| static

Definition at line 299 of file ossl_x509name.c.

References GetX509Name, and SafeGetX509Name.

Referenced by ossl_x509name_cmp(), and ossl_x509name_eql().

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

Definition at line 336 of file ossl_x509name.c.

References CLASS_OF, cX509Name, ossl_x509name_cmp0(), Qfalse, Qtrue, and result.

Referenced by Init_ossl_x509name().

static VALUE ossl_x509name_hash | ( | VALUE | self) |  |
| static

Definition at line 354 of file ossl_x509name.c.

References GetX509Name, hash(), name, and ULONG2NUM.

Referenced by Init_ossl_x509name().

static VALUE ossl_x509name_init_i | ( | VALUE | i,
|  | VALUE | args
| ) |  |
| static

Definition at line 95 of file ossl_x509name.c.

References Check_Type, DEFAULT_OBJECT_TYPE, NIL_P, ossl_x509name_add_entry(), Qnil, rb_aref, rb_ary_entry(), and T_ARRAY.

Referenced by ossl_x509name_initialize().

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

Definition at line 133 of file ossl_x509name.c.

References arg, args, DATA_PTR, eX509NameError, GetX509Name, name, NIL_P, NULL, OBJECT_TYPE_TEMPLATE, ossl_raise(), ossl_to_der_if_possible(), ossl_x509name_init_i(), p, rb_ary_new3(), rb_block_call(), rb_check_array_type(), rb_intern, rb_scan_args(), RSTRING_LEN, RSTRING_PTR, and StringValue.

Referenced by Init_ossl_x509name().

VALUE ossl_x509name_new | ( | X509_NAME * | name) |  |

Definition at line 45 of file ossl_x509name.c.

References cX509Name, eX509NameError, NULL, ossl_raise(), and WrapX509Name.

Referenced by ossl_pkcs7ri_get_issuer(), ossl_pkcs7si_get_issuer(), ossl_x509_get_issuer(), ossl_x509_get_subject(), ossl_x509crl_get_issuer(), and ossl_x509req_get_subject().

static VALUE ossl_x509name_to_a | ( | VALUE | self) |  |
| static

Definition at line 259 of file ossl_x509name.c.

References eX509NameError, GetX509Name, i, INT2FIX, name, NULL, OSSL_Debug, ossl_raise(), rb_ary_new(), rb_ary_new2(), rb_ary_new3(), rb_ary_push(), rb_str_new(), and rb_str_new2.

Referenced by Init_ossl_x509name().

static VALUE ossl_x509name_to_der | ( | VALUE | self) |  |
| static

Definition at line 394 of file ossl_x509name.c.

References eX509NameError, GetX509Name, name, NULL, ossl_raise(), ossl_str_adjust, p, rb_str_new(), and RSTRING_PTR.

Referenced by Init_ossl_x509name().

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

Definition at line 228 of file ossl_x509name.c.

References eX509NameError, GetX509Name, name, NIL_P, NULL, NUM2ULONG, ossl_membio2str(), ossl_raise(), ossl_x509name_to_s_old(), and rb_scan_args().

Referenced by Init_ossl_x509name().

static VALUE ossl_x509name_to_s_old | ( | VALUE | self) |  |
| static

Definition at line 201 of file ossl_x509name.c.

References buf, GetX509Name, name, NULL, and rb_str_new2.

Referenced by ossl_x509name_to_s().

## Variable Documentation

VALUE cX509Name

Definition at line 38 of file ossl_x509name.c.

Referenced by Init_ossl_x509name(), ossl_x509name_eql(), and ossl_x509name_new().

VALUE eX509NameError

Definition at line 39 of file ossl_x509name.c.

Referenced by Init_ossl_x509name(), ossl_x509name_add_entry(), ossl_x509name_alloc(), ossl_x509name_initialize(), ossl_x509name_new(), ossl_x509name_to_a(), ossl_x509name_to_der(), and ossl_x509name_to_s().

ID id_aref
| static

Definition at line 90 of file ossl_x509name.c.

Referenced by Init_ossl_x509name().