class OpenSSL::ASN1::ObjectId
Repräsentiert das primitive Objekt-ID für OpenSSL::ASN1
Öffentliche Klassenmethoden
Source
static VALUE
ossl_asn1obj_s_register(VALUE self, VALUE oid, VALUE sn, VALUE ln)
{
StringValueCStr(oid);
StringValueCStr(sn);
StringValueCStr(ln);
if(!OBJ_create(RSTRING_PTR(oid), RSTRING_PTR(sn), RSTRING_PTR(ln)))
ossl_raise(eASN1Error, NULL);
return Qtrue;
}
Dies fügt eine neue ObjectId zu den internen Tabellen hinzu. Wobei object_id die numerische Form, short_name der Kurzname und long_name der Langname ist.
Gibt true zurück, wenn erfolgreich. Löst einen OpenSSL::ASN1::ASN1Error aus, wenn ein Fehler auftritt.
Öffentliche Instanzmethoden
Source
static VALUE
ossl_asn1obj_eq(VALUE self, VALUE other)
{
VALUE oid1, oid2;
if (!rb_obj_is_kind_of(other, cASN1ObjectId))
return Qfalse;
oid1 = ossl_asn1obj_get_oid(self);
oid2 = ossl_asn1obj_get_oid(other);
return rb_str_equal(oid1, oid2);
}
Gibt true zurück, wenn other_oid mit oid übereinstimmt.
Source
static VALUE
ossl_asn1obj_get_ln(VALUE self)
{
VALUE val, ret = Qnil;
int nid;
val = ossl_asn1_get_value(self);
if ((nid = OBJ_txt2nid(StringValueCStr(val))) != NID_undef)
ret = rb_str_new2(OBJ_nid2ln(nid));
return ret;
}
Der Langname der ObjectId, wie in <openssl/objects.h> definiert.
Auch als Alias genannt: long_name
Source
static VALUE
ossl_asn1obj_get_oid(VALUE self)
{
VALUE str;
ASN1_OBJECT *a1obj;
int state;
a1obj = ossl_to_asn1obj(ossl_asn1_get_value(self));
str = rb_protect(asn1obj_get_oid_i, (VALUE)a1obj, &state);
ASN1_OBJECT_free(a1obj);
if (state)
rb_jump_tag(state);
return str;
}
Gibt einen String zurück, der die Objekt-Identifikation in Punktnotation darstellt, z.B. "1.2.3.4.5"
Source
static VALUE
ossl_asn1obj_get_sn(VALUE self)
{
VALUE val, ret = Qnil;
int nid;
val = ossl_asn1_get_value(self);
if ((nid = OBJ_txt2nid(StringValueCStr(val))) != NID_undef)
ret = rb_str_new2(OBJ_nid2sn(nid));
return ret;
}
Der Kurzname der ObjectId, wie in <openssl/objects.h> definiert.
Auch als Alias genannt: short_name