Ruby  2.5.0dev(2017-10-22revision60238)
Data Structures | Macros | Enumerations | Functions | Variables
ossl_asn1.c File Reference
#include "ossl.h"

Go to the source code of this file.

Data Structures

struct  ossl_asn1_info_t
 

Macros

#define ossl_asn1_get_value(o)   rb_attr_get((o),sivVALUE)
 
#define ossl_asn1_get_tag(o)   rb_attr_get((o),sivTAG)
 
#define ossl_asn1_get_tagging(o)   rb_attr_get((o),sivTAGGING)
 
#define ossl_asn1_get_tag_class(o)   rb_attr_get((o),sivTAG_CLASS)
 
#define ossl_asn1_get_indefinite_length(o)   rb_attr_get((o),sivINDEFINITE_LENGTH)
 
#define ossl_asn1_set_value(o, v)   rb_ivar_set((o),sivVALUE,(v))
 
#define ossl_asn1_set_tag(o, v)   rb_ivar_set((o),sivTAG,(v))
 
#define ossl_asn1_set_tagging(o, v)   rb_ivar_set((o),sivTAGGING,(v))
 
#define ossl_asn1_set_tag_class(o, v)   rb_ivar_set((o),sivTAG_CLASS,(v))
 
#define ossl_asn1_set_indefinite_length(o, v)   rb_ivar_set((o),sivINDEFINITE_LENGTH,(v))
 
#define OSSL_ASN1_IMPL_FACTORY_METHOD(klass)
 
#define OSSL_ASN1_DEFINE_CLASS(name, super)
 

Enumerations

enum  { ossl_asn1_info_size = (sizeof(ossl_asn1_info)/sizeof(ossl_asn1_info[0])) }
 

Functions

VALUE asn1time_to_time (const ASN1_TIME *time)
 
void ossl_time_split (VALUE time, time_t *sec, int *days)
 
VALUE asn1str_to_str (const ASN1_STRING *str)
 
VALUE asn1integer_to_num (const ASN1_INTEGER *ai)
 
ASN1_INTEGER * num_to_asn1integer (VALUE obj, ASN1_INTEGER *ai)
 
ASN1_TYPE * ossl_asn1_get_asn1type (VALUE obj)
 
void Init_ossl_asn1 (void)
 

Variables

VALUE mASN1
 
VALUE eASN1Error
 
VALUE cASN1Data
 
VALUE cASN1Primitive
 
VALUE cASN1Constructive
 
VALUE cASN1EndOfContent
 
VALUE cASN1Boolean
 
VALUE cASN1Integer
 
VALUE cASN1Enumerated
 
VALUE cASN1BitString
 
VALUE cASN1OctetString
 
VALUE cASN1UTF8String
 
VALUE cASN1NumericString
 
VALUE cASN1PrintableString
 
VALUE cASN1T61String
 
VALUE cASN1VideotexString
 
VALUE cASN1IA5String
 
VALUE cASN1GraphicString
 
VALUE cASN1ISO64String
 
VALUE cASN1GeneralString
 
VALUE cASN1UniversalString
 
VALUE cASN1BMPString
 
VALUE cASN1Null
 
VALUE cASN1ObjectId
 
VALUE cASN1UTCTime
 
VALUE cASN1GeneralizedTime
 
VALUE cASN1Sequence
 
VALUE cASN1Set
 

Macro Definition Documentation

◆ OSSL_ASN1_DEFINE_CLASS

#define OSSL_ASN1_DEFINE_CLASS (   name,
  super 
)
Value:
do{\
cASN1##name = rb_define_class_under(mASN1, #name, cASN1##super);\
rb_define_module_function(mASN1, #name, ossl_asn1_##name, -1);\
}while(0)
VALUE mASN1
Definition: ossl_asn1.c:155
VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
Defines a class under the namespace of outer.
Definition: class.c:693
const char * name
Definition: nkf.c:208

◆ ossl_asn1_get_indefinite_length

#define ossl_asn1_get_indefinite_length (   o)    rb_attr_get((o),sivINDEFINITE_LENGTH)

Definition at line 147 of file ossl_asn1.c.

◆ ossl_asn1_get_tag

#define ossl_asn1_get_tag (   o)    rb_attr_get((o),sivTAG)

Definition at line 144 of file ossl_asn1.c.

◆ ossl_asn1_get_tag_class

#define ossl_asn1_get_tag_class (   o)    rb_attr_get((o),sivTAG_CLASS)

Definition at line 146 of file ossl_asn1.c.

◆ ossl_asn1_get_tagging

#define ossl_asn1_get_tagging (   o)    rb_attr_get((o),sivTAGGING)

Definition at line 145 of file ossl_asn1.c.

◆ ossl_asn1_get_value

#define ossl_asn1_get_value (   o)    rb_attr_get((o),sivVALUE)

Definition at line 143 of file ossl_asn1.c.

◆ OSSL_ASN1_IMPL_FACTORY_METHOD

#define OSSL_ASN1_IMPL_FACTORY_METHOD (   klass)
Value:
static VALUE ossl_asn1_##klass(int argc, VALUE *argv, VALUE self)\
{ return rb_funcall3(cASN1##klass, rb_intern("new"), argc, argv); }
int argc
Definition: ruby.c:187
unsigned long VALUE
Definition: ruby.h:85
#define rb_funcall3
Definition: ruby.h:1792
#define rb_intern(str)
char ** argv
Definition: ruby.c:188

Definition at line 1332 of file ossl_asn1.c.

◆ ossl_asn1_set_indefinite_length

#define ossl_asn1_set_indefinite_length (   o,
 
)    rb_ivar_set((o),sivINDEFINITE_LENGTH,(v))

Definition at line 153 of file ossl_asn1.c.

◆ ossl_asn1_set_tag

#define ossl_asn1_set_tag (   o,
 
)    rb_ivar_set((o),sivTAG,(v))

Definition at line 150 of file ossl_asn1.c.

◆ ossl_asn1_set_tag_class

#define ossl_asn1_set_tag_class (   o,
 
)    rb_ivar_set((o),sivTAG_CLASS,(v))

Definition at line 152 of file ossl_asn1.c.

◆ ossl_asn1_set_tagging

#define ossl_asn1_set_tagging (   o,
 
)    rb_ivar_set((o),sivTAGGING,(v))

Definition at line 151 of file ossl_asn1.c.

◆ ossl_asn1_set_value

#define ossl_asn1_set_value (   o,
 
)    rb_ivar_set((o),sivVALUE,(v))

Definition at line 149 of file ossl_asn1.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ossl_asn1_info_size 

Definition at line 488 of file ossl_asn1.c.

Function Documentation

◆ asn1integer_to_num()

VALUE asn1integer_to_num ( const ASN1_INTEGER *  ai)

Definition at line 101 of file ossl_asn1.c.

References eOSSLError, NULL, ossl_bn_new(), ossl_raise(), and rb_eTypeError.

◆ asn1str_to_str()

VALUE asn1str_to_str ( const ASN1_STRING *  str)

Definition at line 92 of file ossl_asn1.c.

References rb_str_new().

◆ asn1time_to_time()

VALUE asn1time_to_time ( const ASN1_TIME *  time)

Definition at line 20 of file ossl_asn1.c.

References argv, count, INT2NUM, ossl_raise(), Qnil, rb_cTime, rb_eTypeError, rb_funcall2, rb_intern, and rb_warning().

◆ Init_ossl_asn1()

void Init_ossl_asn1 ( void  )

◆ num_to_asn1integer()

ASN1_INTEGER* num_to_asn1integer ( VALUE  obj,
ASN1_INTEGER *  ai 
)

Definition at line 124 of file ossl_asn1.c.

References eOSSLError, GetBNPtr, NIL_P, NULL, ossl_raise(), and rb_eTypeError.

◆ ossl_asn1_get_asn1type()

ASN1_TYPE* ossl_asn1_get_asn1type ( VALUE  obj)

Definition at line 495 of file ossl_asn1.c.

◆ ossl_time_split()

void ossl_time_split ( VALUE  time,
time_t *  sec,
int *  days 
)

Definition at line 73 of file ossl_asn1.c.

References FIX2LONG, FIXNUM_P, INT2FIX, NUM2INT, rb_funcall(), rb_Integer(), rb_intern, and rb_long2int.

Referenced by ossl_x509_time_adjust().

Variable Documentation

◆ cASN1BitString

VALUE cASN1BitString

Definition at line 165 of file ossl_asn1.c.

◆ cASN1BMPString

VALUE cASN1BMPString

Definition at line 171 of file ossl_asn1.c.

◆ cASN1Boolean

VALUE cASN1Boolean

Definition at line 163 of file ossl_asn1.c.

◆ cASN1Constructive

VALUE cASN1Constructive

Definition at line 160 of file ossl_asn1.c.

◆ cASN1Data

VALUE cASN1Data

Definition at line 158 of file ossl_asn1.c.

◆ cASN1EndOfContent

VALUE cASN1EndOfContent

Definition at line 162 of file ossl_asn1.c.

◆ cASN1Enumerated

VALUE cASN1Enumerated

Definition at line 164 of file ossl_asn1.c.

◆ cASN1GeneralizedTime

VALUE cASN1GeneralizedTime

Definition at line 174 of file ossl_asn1.c.

◆ cASN1GeneralString

VALUE cASN1GeneralString

Definition at line 170 of file ossl_asn1.c.

◆ cASN1GraphicString

VALUE cASN1GraphicString

Definition at line 169 of file ossl_asn1.c.

◆ cASN1IA5String

VALUE cASN1IA5String

Definition at line 169 of file ossl_asn1.c.

◆ cASN1Integer

VALUE cASN1Integer

Definition at line 164 of file ossl_asn1.c.

◆ cASN1ISO64String

VALUE cASN1ISO64String

Definition at line 170 of file ossl_asn1.c.

◆ cASN1Null

VALUE cASN1Null

Definition at line 172 of file ossl_asn1.c.

◆ cASN1NumericString

VALUE cASN1NumericString

Definition at line 167 of file ossl_asn1.c.

◆ cASN1ObjectId

VALUE cASN1ObjectId

Definition at line 173 of file ossl_asn1.c.

◆ cASN1OctetString

VALUE cASN1OctetString

Definition at line 166 of file ossl_asn1.c.

◆ cASN1Primitive

VALUE cASN1Primitive

Definition at line 159 of file ossl_asn1.c.

◆ cASN1PrintableString

VALUE cASN1PrintableString

Definition at line 167 of file ossl_asn1.c.

◆ cASN1Sequence

VALUE cASN1Sequence

Definition at line 175 of file ossl_asn1.c.

◆ cASN1Set

VALUE cASN1Set

Definition at line 175 of file ossl_asn1.c.

◆ cASN1T61String

VALUE cASN1T61String

Definition at line 168 of file ossl_asn1.c.

◆ cASN1UniversalString

VALUE cASN1UniversalString

Definition at line 171 of file ossl_asn1.c.

◆ cASN1UTCTime

VALUE cASN1UTCTime

Definition at line 174 of file ossl_asn1.c.

◆ cASN1UTF8String

VALUE cASN1UTF8String

Definition at line 166 of file ossl_asn1.c.

◆ cASN1VideotexString

VALUE cASN1VideotexString

Definition at line 168 of file ossl_asn1.c.

◆ eASN1Error

VALUE eASN1Error

Definition at line 156 of file ossl_asn1.c.

◆ mASN1

VALUE mASN1

Definition at line 155 of file ossl_asn1.c.