Method: OpenSSL::ASN1::ObjectId#==

Defined in:
ossl_asn1.c

#==(other_oid) ⇒ Boolean

Returns true if other_oid is the same as oid

Returns:

  • (Boolean)


1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
# File 'ossl_asn1.c', line 1294

static VALUE
ossl_asn1obj_eq(VALUE self, VALUE other)
{
    VALUE valSelf, valOther;
    int nidSelf, nidOther;

    valSelf = ossl_asn1_get_value(self);
    valOther = ossl_asn1_get_value(other);

    if ((nidSelf = OBJ_txt2nid(StringValueCStr(valSelf))) == NID_undef)
	ossl_raise(eASN1Error, "OBJ_txt2nid");

    if ((nidOther = OBJ_txt2nid(StringValueCStr(valOther))) == NID_undef)
	ossl_raise(eASN1Error, "OBJ_txt2nid");

    return nidSelf == nidOther ? Qtrue : Qfalse;
}