Class: OpenSSL::ASN1::ObjectId
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
|
|
|
Instance Chain:
|
|
| Inherits: |
OpenSSL::ASN1::Primitive
|
| Defined in: | ext/openssl/ossl_asn1.c, ext/openssl/ossl_asn1.c |
Overview
Represents the primitive object id for ::OpenSSL::ASN1
Class Method Summary
-
.register(object_id, short_name, long_name)
This adds a new
ObjectIdto the internal tables.
Primitive - Inherited
| .new | value: is mandatory. |
ASN1Data - Inherited
| .new | value: Please have a look at |
Instance Method Summary
-
#ln ⇒ String
(also: #long_name)
The long name of the
ObjectId, as defined in <openssl/objects.h>. -
#long_name ⇒ String
Alias for #ln.
-
#oid ⇒ String
Returns a String representing the
::ObjectIdentifier in the dot notation, e.g. -
#short_name ⇒ String
Alias for #sn.
-
#sn ⇒ String
(also: #short_name)
The short name of the
ObjectId, as defined in <openssl/objects.h>.
Primitive - Inherited
| #to_der | See ASN1Data#to_der for details. |
ASN1Data - Inherited
| #infinite_length | Alias for |
| #infinite_length= | Alias for |
| #to_der | Encodes this |
Constructor Details
This class inherits a constructor from OpenSSL::ASN1::Primitive
Class Method Details
.register(object_id, short_name, long_name)
This adds a new ObjectId to the internal tables. Where object_id is the numerical form, short_name is the short name, and long_name is the long name.
Returns true if successful. Raises an ASN1Error if it fails.
# File 'ext/openssl/ossl_asn1.c', line 1235
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;
}
Instance Method Details
#ln ⇒ String
#long_name ⇒ String
Also known as: #long_name
String
#long_name ⇒ String
The long name of the ObjectId, as defined in <openssl/objects.h>.
# File 'ext/openssl/ossl_asn1.c', line 1275
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;
}
#ln ⇒ String
#long_name ⇒ String
String
#long_name ⇒ String
Alias for #ln.
#oid ⇒ String
Returns a String representing the ::Object Identifier in the dot notation, e.g. “1.2.3.4.5”
# File 'ext/openssl/ossl_asn1.c', line 1317
static VALUE
ossl_asn1obj_get_oid(VALUE self)
{
VALUE str;
ASN1_OBJECT *a1obj;
int state;
a1obj = obj_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;
}
#sn ⇒ String
#short_name ⇒ String
String
#short_name ⇒ String
Alias for #sn.
#sn ⇒ String
#short_name ⇒ String
Also known as: #short_name
String
#short_name ⇒ String
The short name of the ObjectId, as defined in <openssl/objects.h>.
# File 'ext/openssl/ossl_asn1.c', line 1255
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;
}