OpenSSL::X509::Revoked
class OpenSSL::X509::Revoked
父类:Object
公共类方法
新(* args)显示源代码
static VALUE
ossl_x509revoked_initialize(int argc, VALUE *argv, VALUE self)
{
/* EMPTY */
return self;
}
公共实例方法
add_extension(p1) Show source
static VALUE
ossl_x509revoked_add_extension(VALUE self, VALUE ext)
{
X509_REVOKED *rev;
GetX509Rev(self, rev
if (!X509_REVOKED_add_ext(rev, GetX509ExtPtr(ext), -1)) {
ossl_raise(eX509RevError, NULL
}
return ext;
}
extensions()显示源文件
获取X509v3扩展作为X509Ext对象的数组
static VALUE
ossl_x509revoked_get_extensions(VALUE self)
{
X509_REVOKED *rev;
int count, i;
X509_EXTENSION *ext;
VALUE ary;
GetX509Rev(self, rev
count = X509_REVOKED_get_ext_count(rev
if (count < 0) {
OSSL_Debug("count < 0???"
return rb_ary_new(
}
ary = rb_ary_new2(count
for (i=0; i<count; i++) {
ext = X509_REVOKED_get_ext(rev, i
rb_ary_push(ary, ossl_x509ext_new(ext)
}
return ary;
}
extensions =(p1)显示源文件
Sets X509_EXTENSIONs
static VALUE
ossl_x509revoked_set_extensions(VALUE self, VALUE ary)
{
X509_REVOKED *rev;
X509_EXTENSION *ext;
long i;
VALUE item;
Check_Type(ary, T_ARRAY
for (i=0; i<RARRAY_LEN(ary i++) {
OSSL_Check_Kind(RARRAY_AREF(ary, i), cX509Ext
}
GetX509Rev(self, rev
while ((ext = X509_REVOKED_delete_ext(rev, 0)))
X509_EXTENSION_free(ext
for (i=0; i<RARRAY_LEN(ary i++) {
item = RARRAY_AREF(ary, i
ext = GetX509ExtPtr(item
if(!X509_REVOKED_add_ext(rev, ext, -1)) {
ossl_raise(eX509RevError, NULL
}
}
return ary;
}
serial()显示源文件
static VALUE
ossl_x509revoked_get_serial(VALUE self)
{
X509_REVOKED *rev;
GetX509Rev(self, rev
return asn1integer_to_num(X509_REVOKED_get0_serialNumber(rev)
}
serial =(p1)显示源
static VALUE
ossl_x509revoked_set_serial(VALUE self, VALUE num)
{
X509_REVOKED *rev;
ASN1_INTEGER *asn1int;
GetX509Rev(self, rev
asn1int = num_to_asn1integer(num, NULL
if (!X509_REVOKED_set_serialNumber(rev, asn1int)) {
ASN1_INTEGER_free(asn1int
ossl_raise(eX509RevError, "X509_REVOKED_set_serialNumber"
}
ASN1_INTEGER_free(asn1int
return num;
}
时间()显示源
static VALUE
ossl_x509revoked_get_time(VALUE self)
{
X509_REVOKED *rev;
GetX509Rev(self, rev
return asn1time_to_time(X509_REVOKED_get0_revocationDate(rev)
}
时间=(p1)显示来源
static VALUE
ossl_x509revoked_set_time(VALUE self, VALUE time)
{
X509_REVOKED *rev;
ASN1_TIME *asn1time;
GetX509Rev(self, rev
asn1time = ossl_x509_time_adjust(NULL, time
if (!X509_REVOKED_set_revocationDate(rev, asn1time)) {
ASN1_TIME_free(asn1time
ossl_raise(eX509RevError, "X509_REVOKED_set_revocationDate"
}
ASN1_TIME_free(asn1time
return time;
}