Method: OpenSSL::X509::Name#add_entry

Defined in:
ossl_x509name.c

#add_entry(oid, value[, type]) ⇒ self

Returns:

  • (self)


155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'ossl_x509name.c', line 155

static
VALUE ossl_x509name_add_entry(int argc, VALUE *argv, VALUE self)
{
    X509_NAME *name;
    VALUE oid, value, type;

    rb_scan_args(argc, argv, "21", &oid, &value, &type);
    StringValue(oid);
    StringValue(value);
    if(NIL_P(type)) type = rb_aref(OBJECT_TYPE_TEMPLATE, oid);
    GetX509Name(self, name);
    if (!X509_NAME_add_entry_by_txt(name, RSTRING_PTR(oid), NUM2INT(type),
    RSTRING_PTR(value), RSTRING_LEN(value), -1, 0)) {
  ossl_raise(eX509NameError, NULL);
    }

    return self;
}