Ruby 2.0.0p247(2013-06-27revision41674)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

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

Go to the source code of this file.

## Macros
#define | WrapSPKI(klass, obj, spki)
#define | GetSPKI(obj, spki)

## Functions
static VALUE | ossl_spki_alloc (VALUE klass)
static VALUE | ossl_spki_initialize (int argc, VALUE *argv, VALUE self)
static VALUE | ossl_spki_to_der (VALUE self)
static VALUE | ossl_spki_to_pem (VALUE self)
static VALUE | ossl_spki_print (VALUE self)
static VALUE | ossl_spki_get_public_key (VALUE self)
static VALUE | ossl_spki_set_public_key (VALUE self, VALUE key)
static VALUE | ossl_spki_get_challenge (VALUE self)
static VALUE | ossl_spki_set_challenge (VALUE self, VALUE str)
static VALUE | ossl_spki_sign (VALUE self, VALUE key, VALUE digest)
static VALUE | ossl_spki_verify (VALUE self, VALUE key)
void | Init_ossl_ns_spki ()

## Variables
VALUE | mNetscape
VALUE | cSPKI
VALUE | eSPKIError

## Macro Definition Documentation

#define GetSPKI | ( |  | obj,
|  |  | spki
| ) |  |

Value:
do { \
Data_Get_Struct((obj), NETSCAPE_SPKI, (spki)); \
if (!(spki)) { \
ossl_raise(rb_eRuntimeError, "SPKI wasn't initialized!"); \
} \
} while (0)

Definition at line 19 of file ossl_ns_spki.c.

Referenced by ossl_spki_get_challenge(), ossl_spki_get_public_key(), ossl_spki_print(), ossl_spki_set_challenge(), ossl_spki_set_public_key(), ossl_spki_sign(), ossl_spki_to_der(), ossl_spki_to_pem(), and ossl_spki_verify().

#define WrapSPKI | ( |  | klass,
|  |  | obj,
|  |  | spki
| ) |  |

Value:
do { \
if (!(spki)) { \
ossl_raise(rb_eRuntimeError, "SPKI wasn't initialized!"); \
} \
(obj) = Data_Wrap_Struct((klass), 0, NETSCAPE_SPKI_free, (spki)); \
} while (0)

Definition at line 13 of file ossl_ns_spki.c.

Referenced by ossl_spki_alloc().

## Function Documentation

void Init_ossl_ns_spki | ( | void | ) |  |

Definition at line 363 of file ossl_ns_spki.c.

References cSPKI, eOSSLError, eSPKIError, mNetscape, mOSSL, ossl_spki_alloc(), ossl_spki_get_challenge(), ossl_spki_get_public_key(), ossl_spki_initialize(), ossl_spki_print(), ossl_spki_set_challenge(), ossl_spki_set_public_key(), ossl_spki_sign(), ossl_spki_to_der(), ossl_spki_to_pem(), ossl_spki_verify(), rb_cObject, rb_define_alias(), rb_define_alloc_func(), rb_define_class_under(), rb_define_method(), rb_define_module(), and rb_define_module_under().

Referenced by Init_openssl().

static VALUE ossl_spki_alloc | ( | VALUE | klass) |  |
| static

Definition at line 41 of file ossl_ns_spki.c.

References eSPKIError, NULL, ossl_raise(), and WrapSPKI.

Referenced by Init_ossl_ns_spki().

static VALUE ossl_spki_get_challenge | ( | VALUE | self) |  |
| static

Definition at line 215 of file ossl_ns_spki.c.

References GetSPKI, OSSL_Debug, and rb_str_new().

Referenced by Init_ossl_ns_spki().

static VALUE ossl_spki_get_public_key | ( | VALUE | self) |  |
| static

Definition at line 171 of file ossl_ns_spki.c.

References eSPKIError, GetSPKI, NULL, ossl_pkey_new(), and ossl_raise().

Referenced by Init_ossl_ns_spki().

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

Definition at line 62 of file ossl_ns_spki.c.

References DATA_PTR, eSPKIError, NULL, ossl_raise(), p, rb_scan_args(), RSTRING_LEN, RSTRING_PTR, and StringValue.

Referenced by Init_ossl_ns_spki().

static VALUE ossl_spki_print | ( | VALUE | self) |  |
| static

Definition at line 141 of file ossl_ns_spki.c.

References buf, eSPKIError, GetSPKI, NULL, ossl_raise(), and rb_str_new().

Referenced by Init_ossl_ns_spki().

static VALUE ossl_spki_set_challenge | ( | VALUE | self,
|  | VALUE | str
| ) |  |
| static

Definition at line 240 of file ossl_ns_spki.c.

References eSPKIError, GetSPKI, NULL, ossl_raise(), RSTRING_LENINT, RSTRING_PTR, and StringValue.

Referenced by Init_ossl_ns_spki().

static VALUE ossl_spki_set_public_key | ( | VALUE | self,
|  | VALUE | key
| ) |  |
| static

Definition at line 196 of file ossl_ns_spki.c.

References eSPKIError, GetPKeyPtr(), GetSPKI, key, NULL, and ossl_raise().

Referenced by Init_ossl_ns_spki().

static VALUE ossl_spki_sign | ( | VALUE | self,
|  | VALUE | key,
|  | VALUE | digest
| ) |  |
| static

Definition at line 268 of file ossl_ns_spki.c.

References eSPKIError, GetDigestPtr(), GetPrivPKeyPtr(), GetSPKI, NULL, and ossl_raise().

Referenced by Init_ossl_ns_spki().

static VALUE ossl_spki_to_der | ( | VALUE | self) |  |
| static

Definition at line 92 of file ossl_ns_spki.c.

References eX509CertError, GetSPKI, NULL, ossl_raise(), ossl_str_adjust, p, rb_str_new(), and RSTRING_PTR.

Referenced by Init_ossl_ns_spki().

static VALUE ossl_spki_to_pem | ( | VALUE | self) |  |
| static

Definition at line 118 of file ossl_ns_spki.c.

References eSPKIError, GetSPKI, NULL, ossl_buf2str(), ossl_raise(), rb_long2int, and strlen().

Referenced by Init_ossl_ns_spki().

static VALUE ossl_spki_verify | ( | VALUE | self,
|  | VALUE | key
| ) |  |
| static

Definition at line 295 of file ossl_ns_spki.c.

References eSPKIError, GetPKeyPtr(), GetSPKI, NULL, ossl_raise(), Qfalse, Qnil, and Qtrue.

Referenced by Init_ossl_ns_spki().

## Variable Documentation

VALUE cSPKI

Definition at line 30 of file ossl_ns_spki.c.

Referenced by Init_ossl_ns_spki().

VALUE eSPKIError

Definition at line 31 of file ossl_ns_spki.c.

Referenced by Init_ossl_ns_spki(), ossl_spki_alloc(), ossl_spki_get_public_key(), ossl_spki_initialize(), ossl_spki_print(), ossl_spki_set_challenge(), ossl_spki_set_public_key(), ossl_spki_sign(), ossl_spki_to_pem(), and ossl_spki_verify().

VALUE mNetscape

Definition at line 29 of file ossl_ns_spki.c.

Referenced by Init_ossl_ns_spki().