• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetX509CRL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetX509CRL函数的典型用法代码示例。如果您正苦于以下问题:C++ GetX509CRL函数的具体用法?C++ GetX509CRL怎么用?C++ GetX509CRL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetX509CRL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ossl_x509crl_set_revoked

static VALUE 
ossl_x509crl_set_revoked(VALUE self, VALUE ary)
{
    X509_CRL *crl;
    X509_REVOKED *rev;
    int i;

    Check_Type(ary, T_ARRAY);
    /* All ary members should be X509 Revoked */
    for (i=0; i<RARRAY_LEN(ary); i++) {
	OSSL_Check_Kind(RARRAY_PTR(ary)[i], cX509Rev);
    }
    GetX509CRL(self, crl);
    sk_X509_REVOKED_pop_free(crl->crl->revoked, X509_REVOKED_free);
    crl->crl->revoked = NULL;
    for (i=0; i<RARRAY_LEN(ary); i++) {
	rev = DupX509RevokedPtr(RARRAY_PTR(ary)[i]);
	if (!X509_CRL_add0_revoked(crl, rev)) { /* NO DUP - don't free! */
	    ossl_raise(eX509CRLError, NULL);
	}
    }
    X509_CRL_sort(crl);

    return ary;
}
开发者ID:tflynn,项目名称:ruby19-norubygems,代码行数:25,代码来源:ossl_x509crl.c


示例2: ossl_x509crl_set_extensions

/*
 * Sets X509_EXTENSIONs
 */
static VALUE 
ossl_x509crl_set_extensions(VALUE self, VALUE ary)
{
    X509_CRL *crl;
    X509_EXTENSION *ext;
    int i;
	
    Check_Type(ary, T_ARRAY);
    /* All ary members should be X509 Extensions */
    for (i=0; i<RARRAY_LEN(ary); i++) {
	OSSL_Check_Kind(RARRAY_PTR(ary)[i], cX509Ext);
    }
    GetX509CRL(self, crl);
    sk_X509_EXTENSION_pop_free(crl->crl->extensions, X509_EXTENSION_free);
    crl->crl->extensions = NULL;
    for (i=0; i<RARRAY_LEN(ary); i++) {
	ext = DupX509ExtPtr(RARRAY_PTR(ary)[i]);
	if(!X509_CRL_add_ext(crl, ext, -1)) { /* DUPs ext - FREE it */
	    X509_EXTENSION_free(ext);
	    ossl_raise(eX509CRLError, NULL);
	}
	X509_EXTENSION_free(ext);
    }

    return ary;
}
开发者ID:tflynn,项目名称:ruby19-norubygems,代码行数:29,代码来源:ossl_x509crl.c


示例3: ossl_x509crl_set_revoked

static VALUE
ossl_x509crl_set_revoked(VALUE self, VALUE ary)
{
    X509_CRL *crl;
    X509_REVOKED *rev;
    STACK_OF(X509_REVOKED) *sk;
    long i;

    Check_Type(ary, T_ARRAY);
    /* All ary members should be X509 Revoked */
    for (i=0; i<RARRAY_LEN(ary); i++) {
	OSSL_Check_Kind(RARRAY_AREF(ary, i), cX509Rev);
    }
    GetX509CRL(self, crl);
    if ((sk = X509_CRL_get_REVOKED(crl))) {
	while ((rev = sk_X509_REVOKED_pop(sk)))
	    X509_REVOKED_free(rev);
    }
    for (i=0; i<RARRAY_LEN(ary); i++) {
	rev = DupX509RevokedPtr(RARRAY_AREF(ary, i));
	if (!X509_CRL_add0_revoked(crl, rev)) { /* NO DUP - don't free! */
	    X509_REVOKED_free(rev);
	    ossl_raise(eX509CRLError, "X509_CRL_add0_revoked");
	}
    }
    X509_CRL_sort(crl);

    return ary;
}
开发者ID:gferguson-gd,项目名称:ruby,代码行数:29,代码来源:ossl_x509crl.c


示例4: ossl_x509crl_get_issuer

static VALUE 
ossl_x509crl_get_issuer(VALUE self)
{
    X509_CRL *crl;

    GetX509CRL(self, crl);

    return ossl_x509name_new(X509_CRL_get_issuer(crl)); /* NO DUP - don't free */
}
开发者ID:tflynn,项目名称:ruby19-norubygems,代码行数:9,代码来源:ossl_x509crl.c


示例5: ossl_x509crl_get_next_update

static VALUE 
ossl_x509crl_get_next_update(VALUE self)
{
    X509_CRL *crl;

    GetX509CRL(self, crl);

    return asn1time_to_time(X509_CRL_get_nextUpdate(crl));
}
开发者ID:tflynn,项目名称:ruby19-norubygems,代码行数:9,代码来源:ossl_x509crl.c


示例6: ossl_x509crl_get_version

static VALUE 
ossl_x509crl_get_version(VALUE self)
{
    X509_CRL *crl;
    long ver;

    GetX509CRL(self, crl);
    ver = X509_CRL_get_version(crl);

    return LONG2NUM(ver);
}
开发者ID:tflynn,项目名称:ruby19-norubygems,代码行数:11,代码来源:ossl_x509crl.c


示例7: ossl_x509crl_set_issuer

static VALUE 
ossl_x509crl_set_issuer(VALUE self, VALUE issuer)
{
    X509_CRL *crl;

    GetX509CRL(self, crl);

    if (!X509_CRL_set_issuer_name(crl, GetX509NamePtr(issuer))) { /* DUPs name */
	ossl_raise(eX509CRLError, NULL);
    }
    return issuer;
}
开发者ID:tflynn,项目名称:ruby19-norubygems,代码行数:12,代码来源:ossl_x509crl.c


示例8: ossl_x509crl_set_last_update

static VALUE 
ossl_x509crl_set_last_update(VALUE self, VALUE time)
{
    X509_CRL *crl;
    time_t sec;

    sec = time_to_time_t(time);
    GetX509CRL(self, crl);
    if (!X509_time_adj(crl->crl->lastUpdate, 0, &sec)) {
	ossl_raise(eX509CRLError, NULL);
    }

    return time;
}
开发者ID:tflynn,项目名称:ruby19-norubygems,代码行数:14,代码来源:ossl_x509crl.c


示例9: ossl_x509crl_add_extension

static VALUE
ossl_x509crl_add_extension(VALUE self, VALUE extension)
{
    X509_CRL *crl;
    X509_EXTENSION *ext;

    GetX509CRL(self, crl);
    ext = GetX509ExtPtr(extension);
    if (!X509_CRL_add_ext(crl, ext, -1)) {
	ossl_raise(eX509CRLError, NULL);
    }

    return extension;
}
开发者ID:gferguson-gd,项目名称:ruby,代码行数:14,代码来源:ossl_x509crl.c


示例10: ossl_x509crl_set_next_update

static VALUE 
ossl_x509crl_set_next_update(VALUE self, VALUE time)
{
    X509_CRL *crl;
    time_t sec;

    sec = time_to_time_t(time);
    GetX509CRL(self, crl);
    /* This must be some thinko in OpenSSL */
    if (!(crl->crl->nextUpdate = X509_time_adj(crl->crl->nextUpdate, 0, &sec))){
	ossl_raise(eX509CRLError, NULL);
    }

    return time;
}
开发者ID:tflynn,项目名称:ruby19-norubygems,代码行数:15,代码来源:ossl_x509crl.c


示例11: ossl_x509crl_add_revoked

static VALUE 
ossl_x509crl_add_revoked(VALUE self, VALUE revoked)
{
    X509_CRL *crl;
    X509_REVOKED *rev;

    GetX509CRL(self, crl);
    rev = DupX509RevokedPtr(revoked);
    if (!X509_CRL_add0_revoked(crl, rev)) { /* NO DUP - don't free! */
	ossl_raise(eX509CRLError, NULL);
    }
    X509_CRL_sort(crl);

    return revoked;
}
开发者ID:tflynn,项目名称:ruby19-norubygems,代码行数:15,代码来源:ossl_x509crl.c


示例12: ossl_x509crl_set_next_update

static VALUE
ossl_x509crl_set_next_update(VALUE self, VALUE time)
{
    X509_CRL *crl;
    ASN1_TIME *asn1time;

    GetX509CRL(self, crl);
    asn1time = ossl_x509_time_adjust(NULL, time);
    if (!X509_CRL_set_nextUpdate(crl, asn1time)) {
	ASN1_TIME_free(asn1time);
	ossl_raise(eX509CRLError, "X509_CRL_set_nextUpdate");
    }
    ASN1_TIME_free(asn1time);

    return time;
}
开发者ID:gferguson-gd,项目名称:ruby,代码行数:16,代码来源:ossl_x509crl.c


示例13: ossl_x509crl_set_version

static VALUE 
ossl_x509crl_set_version(VALUE self, VALUE version)
{
    X509_CRL *crl;
    long ver;

    if ((ver = NUM2LONG(version)) < 0) {
	ossl_raise(eX509CRLError, "version must be >= 0!");
    }
    GetX509CRL(self, crl);
    if (!X509_CRL_set_version(crl, ver)) {
	ossl_raise(eX509CRLError, NULL);
    }

    return version;
}
开发者ID:tflynn,项目名称:ruby19-norubygems,代码行数:16,代码来源:ossl_x509crl.c


示例14: ossl_x509crl_verify

static VALUE
ossl_x509crl_verify(VALUE self, VALUE key)
{
    X509_CRL *crl;

    GetX509CRL(self, crl);
    switch (X509_CRL_verify(crl, GetPKeyPtr(key))) {
      case 1:
	return Qtrue;
      case 0:
	ossl_clear_error();
	return Qfalse;
      default:
	ossl_raise(eX509CRLError, NULL);
    }
}
开发者ID:gferguson-gd,项目名称:ruby,代码行数:16,代码来源:ossl_x509crl.c


示例15: ossl_x509crl_add_extension

static VALUE 
ossl_x509crl_add_extension(VALUE self, VALUE extension)
{
    X509_CRL *crl;
    X509_EXTENSION *ext;

    GetX509CRL(self, crl);
    ext = DupX509ExtPtr(extension);
    if (!X509_CRL_add_ext(crl, ext, -1)) { /* DUPs ext - FREE it */
	X509_EXTENSION_free(ext);
	ossl_raise(eX509CRLError, NULL);
    }
    X509_EXTENSION_free(ext);

    return extension;
}
开发者ID:tflynn,项目名称:ruby19-norubygems,代码行数:16,代码来源:ossl_x509crl.c


示例16: ossl_x509crl_verify

static VALUE 
ossl_x509crl_verify(VALUE self, VALUE key)
{
    X509_CRL *crl;
    int ret;

    GetX509CRL(self, crl);
    if ((ret = X509_CRL_verify(crl, GetPKeyPtr(key))) < 0) {
	ossl_raise(eX509CRLError, NULL);
    }
    if (ret == 1) {
	return Qtrue;
    }

    return Qfalse;
}
开发者ID:tflynn,项目名称:ruby19-norubygems,代码行数:16,代码来源:ossl_x509crl.c


示例17: ossl_x509crl_sign

static VALUE 
ossl_x509crl_sign(VALUE self, VALUE key, VALUE digest)
{
    X509_CRL *crl;
    EVP_PKEY *pkey;
    const EVP_MD *md;

    GetX509CRL(self, crl);
    pkey = GetPrivPKeyPtr(key); /* NO NEED TO DUP */
    md = GetDigestPtr(digest);
    if (!X509_CRL_sign(crl, pkey, md)) {
	ossl_raise(eX509CRLError, NULL);
    }

    return self;
}
开发者ID:tflynn,项目名称:ruby19-norubygems,代码行数:16,代码来源:ossl_x509crl.c


示例18: ossl_x509crl_to_text

static VALUE
ossl_x509crl_to_text(VALUE self)
{
    X509_CRL *crl;
    BIO *out;

    GetX509CRL(self, crl);
    if (!(out = BIO_new(BIO_s_mem()))) {
	ossl_raise(eX509CRLError, NULL);
    }
    if (!X509_CRL_print(out, crl)) {
	BIO_free(out);
	ossl_raise(eX509CRLError, NULL);
    }

    return ossl_membio2str(out);
}
开发者ID:gferguson-gd,项目名称:ruby,代码行数:17,代码来源:ossl_x509crl.c


示例19: ossl_x509crl_copy

static VALUE
ossl_x509crl_copy(VALUE self, VALUE other)
{
    X509_CRL *a, *b, *crl;
	
    rb_check_frozen(self);
    if (self == other) return self;
    GetX509CRL(self, a);
    SafeGetX509CRL(other, b);
    if (!(crl = X509_CRL_dup(b))) {
	ossl_raise(eX509CRLError, NULL);
    }
    X509_CRL_free(a);
    DATA_PTR(self) = crl;

    return self;
}
开发者ID:tflynn,项目名称:ruby19-norubygems,代码行数:17,代码来源:ossl_x509crl.c


示例20: ossl_x509crl_get_signature_algorithm

static VALUE
ossl_x509crl_get_signature_algorithm(VALUE self)
{
    X509_CRL *crl;
    const X509_ALGOR *alg;
    BIO *out;

    GetX509CRL(self, crl);
    if (!(out = BIO_new(BIO_s_mem()))) {
	ossl_raise(eX509CRLError, NULL);
    }
    X509_CRL_get0_signature(crl, NULL, &alg);
    if (!i2a_ASN1_OBJECT(out, alg->algorithm)) {
	BIO_free(out);
	ossl_raise(eX509CRLError, NULL);
    }

    return ossl_membio2str(out);
}
开发者ID:gferguson-gd,项目名称:ruby,代码行数:19,代码来源:ossl_x509crl.c



注:本文中的GetX509CRL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetXid函数代码示例发布时间:2022-05-30
下一篇:
C++ GetX函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap