Ruby  2.4.2p198(2017-09-14revision59899)
Macros | Functions | Variables
ossl_x509req.c File Reference
#include "ossl.h"
Include dependency graph for ossl_x509req.c:

Go to the source code of this file.

Macros

#define NewX509Req(klass)   TypedData_Wrap_Struct((klass), &ossl_x509req_type, 0)
 
#define SetX509Req(obj, req)
 
#define GetX509Req(obj, req)
 
#define SafeGetX509Req(obj, req)
 

Functions

static void ossl_x509req_free (void *ptr)
 
VALUE ossl_x509req_new (X509_REQ *req)
 
X509_REQ * GetX509ReqPtr (VALUE obj)
 
X509_REQ * DupX509ReqPtr (VALUE obj)
 
static VALUE ossl_x509req_alloc (VALUE klass)
 
static VALUE ossl_x509req_initialize (int argc, VALUE *argv, VALUE self)
 
static VALUE ossl_x509req_copy (VALUE self, VALUE other)
 
static VALUE ossl_x509req_to_pem (VALUE self)
 
static VALUE ossl_x509req_to_der (VALUE self)
 
static VALUE ossl_x509req_to_text (VALUE self)
 
static VALUE ossl_x509req_get_version (VALUE self)
 
static VALUE ossl_x509req_set_version (VALUE self, VALUE version)
 
static VALUE ossl_x509req_get_subject (VALUE self)
 
static VALUE ossl_x509req_set_subject (VALUE self, VALUE subject)
 
static VALUE ossl_x509req_get_signature_algorithm (VALUE self)
 
static VALUE ossl_x509req_get_public_key (VALUE self)
 
static VALUE ossl_x509req_set_public_key (VALUE self, VALUE key)
 
static VALUE ossl_x509req_sign (VALUE self, VALUE key, VALUE digest)
 
static VALUE ossl_x509req_verify (VALUE self, VALUE key)
 
static VALUE ossl_x509req_get_attributes (VALUE self)
 
static VALUE ossl_x509req_set_attributes (VALUE self, VALUE ary)
 
static VALUE ossl_x509req_add_attribute (VALUE self, VALUE attr)
 
void Init_ossl_x509req (void)
 

Variables

VALUE cX509Req
 
VALUE eX509ReqError
 
static const rb_data_type_t ossl_x509req_type
 

Macro Definition Documentation

◆ GetX509Req

#define GetX509Req (   obj,
  req 
)

◆ NewX509Req

#define NewX509Req (   klass)    TypedData_Wrap_Struct((klass), &ossl_x509req_type, 0)

Definition at line 12 of file ossl_x509req.c.

Referenced by ossl_x509req_alloc(), and ossl_x509req_new().

◆ SafeGetX509Req

#define SafeGetX509Req (   obj,
  req 
)
Value:
do { \
OSSL_Check_Kind((obj), cX509Req); \
GetX509Req((obj), (req)); \
} while (0)
VALUE cX509Req
Definition: ossl_x509req.c:34

Definition at line 26 of file ossl_x509req.c.

Referenced by DupX509ReqPtr(), GetX509ReqPtr(), and ossl_x509req_copy().

◆ SetX509Req

#define SetX509Req (   obj,
  req 
)
Value:
do { \
if (!(req)) { \
ossl_raise(rb_eRuntimeError, "Req wasn't initialized!"); \
} \
RTYPEDDATA_DATA(obj) = (req); \
} while (0)
VALUE rb_eRuntimeError
Definition: error.c:761

Definition at line 14 of file ossl_x509req.c.

Referenced by ossl_x509req_alloc(), and ossl_x509req_new().

Function Documentation

◆ DupX509ReqPtr()

X509_REQ* DupX509ReqPtr ( VALUE  obj)

Definition at line 85 of file ossl_x509req.c.

References eX509ReqError, NULL, ossl_raise(), and SafeGetX509Req.

◆ GetX509ReqPtr()

X509_REQ* GetX509ReqPtr ( VALUE  obj)

Definition at line 75 of file ossl_x509req.c.

References SafeGetX509Req.

Referenced by ossl_x509extfactory_set_subject_req().

◆ Init_ossl_x509req()

void Init_ossl_x509req ( void  )

◆ ossl_x509req_add_attribute()

static VALUE ossl_x509req_add_attribute ( VALUE  self,
VALUE  attr 
)
static

Definition at line 430 of file ossl_x509req.c.

References eX509ReqError, GetX509AttrPtr(), GetX509Req, NULL, and ossl_raise().

Referenced by Init_ossl_x509req().

◆ ossl_x509req_alloc()

static VALUE ossl_x509req_alloc ( VALUE  klass)
static

Definition at line 101 of file ossl_x509req.c.

References eX509ReqError, NewX509Req, NULL, ossl_raise(), and SetX509Req.

Referenced by Init_ossl_x509req().

◆ ossl_x509req_copy()

static VALUE ossl_x509req_copy ( VALUE  self,
VALUE  other 
)
static

Definition at line 141 of file ossl_x509req.c.

References DATA_PTR, eX509ReqError, GetX509Req, NULL, ossl_raise(), rb_check_frozen, and SafeGetX509Req.

Referenced by Init_ossl_x509req().

◆ ossl_x509req_free()

static void ossl_x509req_free ( void *  ptr)
static

Definition at line 38 of file ossl_x509req.c.

◆ ossl_x509req_get_attributes()

static VALUE ossl_x509req_get_attributes ( VALUE  self)
static

◆ ossl_x509req_get_public_key()

static VALUE ossl_x509req_get_public_key ( VALUE  self)
static

Definition at line 313 of file ossl_x509req.c.

References eX509ReqError, GetX509Req, NULL, ossl_pkey_new(), and ossl_raise().

Referenced by Init_ossl_x509req().

◆ ossl_x509req_get_signature_algorithm()

static VALUE ossl_x509req_get_signature_algorithm ( VALUE  self)
static

◆ ossl_x509req_get_subject()

static VALUE ossl_x509req_get_subject ( VALUE  self)
static

Definition at line 264 of file ossl_x509req.c.

References eX509ReqError, GetX509Req, name, NULL, ossl_raise(), and ossl_x509name_new().

Referenced by Init_ossl_x509req().

◆ ossl_x509req_get_version()

static VALUE ossl_x509req_get_version ( VALUE  self)
static

Definition at line 235 of file ossl_x509req.c.

References GetX509Req, LONG2NUM, and version.

Referenced by Init_ossl_x509req().

◆ ossl_x509req_initialize()

static VALUE ossl_x509req_initialize ( int  argc,
VALUE argv,
VALUE  self 
)
static

◆ ossl_x509req_new()

VALUE ossl_x509req_new ( X509_REQ *  req)

Definition at line 55 of file ossl_x509req.c.

References cX509Req, eX509ReqError, NewX509Req, NULL, ossl_raise(), and SetX509Req.

Referenced by ossl_x509_to_text().

◆ ossl_x509req_set_attributes()

static VALUE ossl_x509req_set_attributes ( VALUE  self,
VALUE  ary 
)
static

◆ ossl_x509req_set_public_key()

static VALUE ossl_x509req_set_public_key ( VALUE  self,
VALUE  key 
)
static

Definition at line 327 of file ossl_x509req.c.

References eX509ReqError, GetPKeyPtr(), GetX509Req, key, NULL, and ossl_raise().

Referenced by Init_ossl_x509req().

◆ ossl_x509req_set_subject()

static VALUE ossl_x509req_set_subject ( VALUE  self,
VALUE  subject 
)
static

Definition at line 278 of file ossl_x509req.c.

References eX509ReqError, GetX509NamePtr(), GetX509Req, NULL, and ossl_raise().

Referenced by Init_ossl_x509req().

◆ ossl_x509req_set_version()

static VALUE ossl_x509req_set_version ( VALUE  self,
VALUE  version 
)
static

Definition at line 247 of file ossl_x509req.c.

References eX509ReqError, GetX509Req, NUM2LONG, ossl_raise(), and version.

Referenced by Init_ossl_x509req().

◆ ossl_x509req_sign()

static VALUE ossl_x509req_sign ( VALUE  self,
VALUE  key,
VALUE  digest 
)
static

Definition at line 342 of file ossl_x509req.c.

References eX509ReqError, GetDigestPtr(), GetPrivPKeyPtr(), GetX509Req, NULL, and ossl_raise().

Referenced by Init_ossl_x509req().

◆ ossl_x509req_to_der()

static VALUE ossl_x509req_to_der ( VALUE  self)
static

Definition at line 177 of file ossl_x509req.c.

References eX509ReqError, GetX509Req, len, NULL, ossl_raise(), ossl_str_adjust, rb_str_new(), and RSTRING_PTR.

Referenced by Init_ossl_x509req().

◆ ossl_x509req_to_pem()

static VALUE ossl_x509req_to_pem ( VALUE  self)
static

Definition at line 159 of file ossl_x509req.c.

References eX509ReqError, GetX509Req, NULL, ossl_membio2str(), and ossl_raise().

Referenced by Init_ossl_x509req().

◆ ossl_x509req_to_text()

static VALUE ossl_x509req_to_text ( VALUE  self)
static

Definition at line 197 of file ossl_x509req.c.

References eX509ReqError, GetX509Req, key, NULL, ossl_membio2str(), ossl_raise(), and ossl_x509_new().

Referenced by Init_ossl_x509req().

◆ ossl_x509req_verify()

static VALUE ossl_x509req_verify ( VALUE  self,
VALUE  key 
)
static

Definition at line 362 of file ossl_x509req.c.

References eX509ReqError, GetPKeyPtr(), GetX509Req, NULL, ossl_clear_error(), ossl_raise(), Qfalse, and Qtrue.

Referenced by Init_ossl_x509req().

Variable Documentation

◆ cX509Req

VALUE cX509Req

Definition at line 34 of file ossl_x509req.c.

Referenced by Init_ossl_x509req(), and ossl_x509req_new().

◆ eX509ReqError

VALUE eX509ReqError

◆ ossl_x509req_type

const rb_data_type_t ossl_x509req_type
static
Initial value:
= {
"OpenSSL/X509/REQ",
{
},
}
#define RUBY_TYPED_FREE_IMMEDIATELY
Definition: ruby.h:1145
static void ossl_x509req_free(void *ptr)
Definition: ossl_x509req.c:38

Definition at line 43 of file ossl_x509req.c.