Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

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

Go to the source code of this file.

## Macros
#define | WrapX509Attr(klass, obj, attr)
#define | GetX509Attr(obj, attr)
#define | SafeGetX509Attr(obj, attr)
#define | OSSL_X509ATTR_IS_SINGLE(attr) (!(attr)->set)
#define | OSSL_X509ATTR_SET_SINGLE(attr) ((attr)->set = 0)

## Functions
VALUE | ossl_x509attr_new (X509_ATTRIBUTE *attr)
X509_ATTRIBUTE * | DupX509AttrPtr (VALUE obj)
static VALUE | ossl_x509attr_alloc (VALUE klass)
static VALUE | ossl_x509attr_initialize (int argc, VALUE *argv, VALUE self)
static VALUE | ossl_x509attr_set_oid (VALUE self, VALUE oid)
static VALUE | ossl_x509attr_get_oid (VALUE self)
static VALUE | ossl_x509attr_set_value (VALUE self, VALUE value)
static VALUE | ossl_x509attr_get_value (VALUE self)
static VALUE | ossl_x509attr_to_der (VALUE self)
void | Init_ossl_x509attr ()

## Variables
VALUE | cX509Attr
VALUE | eX509AttrError

## Macro Definition Documentation

#define GetX509Attr | ( |  | obj,
|  |  | attr
| ) |  |

Value:
do { \
Data_Get_Struct((obj), X509_ATTRIBUTE, (attr)); \
if (!(attr)) { \
ossl_raise(rb_eRuntimeError, "ATTR wasn't initialized!"); \
} \
} while (0)
rb_eRuntimeError
VALUE rb_eRuntimeError
Definition: error.c:510
obj
static VALUE VALUE obj
Definition: tcltklib.c:3158
if
if(RB_TYPE_P(r, T_FLOAT))
Definition: bigdecimal.c:1186
Data_Get_Struct
#define Data_Get_Struct(obj, type, sval)
ossl_raise
void ossl_raise(VALUE exc, const char *fmt,...)
Definition: ossl.c:328

Definition at line 19 of file ossl_x509attr.c.

Referenced by ossl_x509attr_get_oid(), ossl_x509attr_get_value(), ossl_x509attr_initialize(), ossl_x509attr_set_oid(), ossl_x509attr_set_value(), and ossl_x509attr_to_der().

#define OSSL_X509ATTR_IS_SINGLE | ( |  | attr | ) | (!(attr)->set)

Definition at line 168 of file ossl_x509attr.c.

Referenced by ossl_x509attr_get_value(), and ossl_x509attr_set_value().

#define OSSL_X509ATTR_SET_SINGLE | ( |  | attr | ) | ((attr)->set = 0)

Definition at line 169 of file ossl_x509attr.c.

Referenced by ossl_x509attr_set_value().

#define SafeGetX509Attr | ( |  | obj,
|  |  | attr
| ) |  |

Value:
do { \
OSSL_Check_Kind((obj), cX509Attr); \
GetX509Attr((obj), (attr)); \
} while (0)
obj
static VALUE VALUE obj
Definition: tcltklib.c:3158
OSSL_Check_Kind
#define OSSL_Check_Kind(obj, klass)
Definition: ossl.h:96
cX509Attr
VALUE cX509Attr
Definition: ossl_x509attr.c:33
GetX509Attr
#define GetX509Attr(obj, attr)
Definition: ossl_x509attr.c:19

Definition at line 25 of file ossl_x509attr.c.

Referenced by DupX509AttrPtr().

#define WrapX509Attr | ( |  | klass,
|  |  | obj,
|  |  | attr
| ) |  |

Value:
do { \
if (!(attr)) { \
ossl_raise(rb_eRuntimeError, "ATTR wasn't initialized!"); \
} \
(obj) = Data_Wrap_Struct((klass), 0, X509_ATTRIBUTE_free, (attr)); \
} while (0)
Data_Wrap_Struct
return Data_Wrap_Struct(CLASS_OF(interp), 0, ip_free, slave)
rb_eRuntimeError
VALUE rb_eRuntimeError
Definition: error.c:510
obj
static VALUE VALUE obj
Definition: tcltklib.c:3158
if
if(RB_TYPE_P(r, T_FLOAT))
Definition: bigdecimal.c:1186
klass
klass
Definition: tcltklib.c:3504
ossl_raise
void ossl_raise(VALUE exc, const char *fmt,...)
Definition: ossl.c:328

Definition at line 13 of file ossl_x509attr.c.

Referenced by ossl_x509attr_alloc(), and ossl_x509attr_new().

## Function Documentation

X509_ATTRIBUTE* DupX509AttrPtr | ( | VALUE | obj | ) |

Definition at line 59 of file ossl_x509attr.c.

References eX509AttrError, NULL, ossl_raise(), and SafeGetX509Attr.

Referenced by ossl_x509req_add_attribute(), and ossl_x509req_set_attributes().

void Init_ossl_x509attr | ( | void |  | ) |

Definition at line 263 of file ossl_x509attr.c.

References cX509Attr, eOSSLError, eX509AttrError, mX509, ossl_x509attr_alloc(), ossl_x509attr_get_oid(), ossl_x509attr_get_value(), ossl_x509attr_initialize(), ossl_x509attr_set_oid(), ossl_x509attr_set_value(), ossl_x509attr_to_der(), rb_cObject, rb_define_alloc_func(), rb_define_class_under(), and rb_define_method().

Referenced by Init_ossl_x509().

static VALUE ossl_x509attr_alloc | ( | VALUE | klass | ) |
| static

Definition at line 75 of file ossl_x509attr.c.

References eX509AttrError, NULL, obj, ossl_raise(), and WrapX509Attr.

Referenced by Init_ossl_x509attr().

static VALUE ossl_x509attr_get_oid | ( | VALUE | self | ) |
| static

Definition at line 142 of file ossl_x509attr.c.

References eX509AttrError, GetX509Attr, NULL, ossl_membio2str(), ossl_raise(), out, rb_str_new2, and ret.

Referenced by Init_ossl_x509attr().

static VALUE ossl_x509attr_get_value | ( | VALUE | self | ) |
| static

Definition at line 204 of file ossl_x509attr.c.

References GetX509Attr, length, mASN1, NULL, ossl_str_adjust, OSSL_X509ATTR_IS_SINGLE, p, Qnil, rb_funcall(), rb_intern, rb_str_new(), RSTRING_PTR, and str.

Referenced by Init_ossl_x509attr().

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

Definition at line 92 of file ossl_x509attr.c.

References DATA_PTR(), eX509AttrError, GetX509Attr, NULL, ossl_raise(), ossl_to_der_if_possible(), p, rb_funcall(), rb_intern, rb_scan_args(), RSTRING_LEN, RSTRING_PTR, StringValue, and value.

Referenced by Init_ossl_x509attr().

VALUE ossl_x509attr_new | ( | X509_ATTRIBUTE * | attr | ) |

Definition at line 40 of file ossl_x509attr.c.

References cX509Attr, eX509AttrError, NULL, obj, ossl_raise(), and WrapX509Attr.

Referenced by ossl_x509req_get_attributes().

static VALUE ossl_x509attr_set_oid | ( | VALUE | self,
|  | VALUE | oid
| ) |  |
| static

Definition at line 121 of file ossl_x509attr.c.

References eX509AttrError, GetX509Attr, NULL, obj, ossl_raise(), s, and StringValuePtr.

Referenced by Init_ossl_x509attr().

static VALUE ossl_x509attr_set_value | ( | VALUE | self,
|  | VALUE | value
| ) |  |
| static

Definition at line 177 of file ossl_x509attr.c.

References eASN1Error, GetX509Attr, ossl_asn1_get_asn1type(), ossl_raise(), OSSL_X509ATTR_IS_SINGLE, OSSL_X509ATTR_SET_SINGLE, and value.

Referenced by Init_ossl_x509attr().

static VALUE ossl_x509attr_to_der | ( | VALUE | self | ) |
| static

Definition at line 240 of file ossl_x509attr.c.

References eX509AttrError, GetX509Attr, len, NULL, ossl_raise(), p, rb_str_new(), rb_str_set_len(), RSTRING_PTR, and str.

Referenced by Init_ossl_x509attr().

## Variable Documentation

VALUE cX509Attr

Definition at line 33 of file ossl_x509attr.c.

Referenced by Init_ossl_x509attr(), ossl_x509attr_new(), and ossl_x509req_set_attributes().

VALUE eX509AttrError

Definition at line 34 of file ossl_x509attr.c.

Referenced by DupX509AttrPtr(), Init_ossl_x509attr(), ossl_x509attr_alloc(), ossl_x509attr_get_oid(), ossl_x509attr_initialize(), ossl_x509attr_new(), ossl_x509attr_set_oid(), and ossl_x509attr_to_der().