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

C++ ASN1_item_i2d_bio函数代码示例

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

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



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

示例1: ASN1_item_i2d_fp

int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x)
{
    BIO *b = BIO_new_fp(out, BIO_NOCLOSE);
    if (b == NULL) {
        OPENSSL_PUT_ERROR(ASN1, ERR_R_BUF_LIB);
        return 0;
    }
    int ret = ASN1_item_i2d_bio(it, b, x);
    BIO_free(b);
    return ret;
}
开发者ID:google,项目名称:boringssl,代码行数:11,代码来源:a_i2d_fp.c


示例2: OCSP_REQ_CTX_i2d

int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it, ASN1_VALUE *val)
	{
	static const char req_hdr[] =
			"Content-Type: application/ocsp-request\r\n"
			"Content-Length: %d\r\n\r\n";
	int reqlen = ASN1_item_i2d(val, NULL, it);
        if (BIO_printf(rctx->mem, req_hdr, reqlen) <= 0)
		return 0;
        if (ASN1_item_i2d_bio(it, rctx->mem, val) <= 0)
		return 0;
	rctx->state = OHS_ASN1_WRITE_INIT;
	return 1;
	}
开发者ID:AdrianaPineda,项目名称:openssl,代码行数:13,代码来源:ocsp_ht.c


示例3: ASN1_item_i2d_fp

int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x)
{
    BIO *b;
    int ret;

    if ((b = BIO_new(BIO_s_file())) == NULL) {
        ASN1err(ASN1_F_ASN1_ITEM_I2D_FP, ERR_R_BUF_LIB);
        return 0;
    }
    BIO_set_fp(b, out, BIO_NOCLOSE);
    ret = ASN1_item_i2d_bio(it, b, x);
    BIO_free(b);
    return ret;
}
开发者ID:RTEMS,项目名称:rtems-libbsd,代码行数:14,代码来源:a_i2d_fp.c


示例4: output_issuer

int output_issuer (BIO *out, BIO *err, X509 *x) {
  X509_NAME *issuer ;
  BIO *b64 ;

  if ((b64 = BIO_push(BIO_new(BIO_f_base64()), out)) == NULL) {
    BIO_printf(err,
      "Error - Cannot initialise Base64 output filter for issuer\n");
    return 1 ;
  } 
  BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL) ;
  
  BIO_printf(out, "3_issuer ") ;
  
  issuer = X509_get_issuer_name(x) ;
  ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509_NAME), b64, issuer);
  BIO_flush(b64);
  
  BIO_printf(out, "\n") ;
  return 0 ;
}
开发者ID:spujadas,项目名称:tp-confiance,代码行数:20,代码来源:gen_test_ev_roots.c


示例5: i2d_PKCS12_bio

int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12)
{
    return ASN1_item_i2d_bio(ASN1_ITEM_rptr(PKCS12), bp, p12);
}
开发者ID:mz02005,项目名称:CScript,代码行数:4,代码来源:p12_utl.c


示例6: i2d_RSAPublicKey_bio

int i2d_RSAPublicKey_bio(BIO *bp, RSA *rsa)
{
    return ASN1_item_i2d_bio(ASN1_ITEM_rptr(RSAPublicKey), bp, rsa);
}
开发者ID:1234-,项目名称:openssl,代码行数:4,代码来源:x_all.c


示例7: i2d_X509_REQ_bio

int i2d_X509_REQ_bio(BIO *bp, X509_REQ *req)
{
    return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509_REQ), bp, req);
}
开发者ID:1234-,项目名称:openssl,代码行数:4,代码来源:x_all.c


示例8: i2d_PKCS7_bio

int i2d_PKCS7_bio(BIO *bp, PKCS7 *p7)
{
    return ASN1_item_i2d_bio(ASN1_ITEM_rptr(PKCS7), bp, p7);
}
开发者ID:1234-,项目名称:openssl,代码行数:4,代码来源:x_all.c


示例9: i2d_X509_CRL_bio

int i2d_X509_CRL_bio(BIO *bp, X509_CRL *crl)
{
    return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509_CRL), bp, crl);
}
开发者ID:1234-,项目名称:openssl,代码行数:4,代码来源:x_all.c


示例10: i2d_DSAparams_bio

int
i2d_DSAparams_bio(BIO *bp, DSA *a)
{
	return ASN1_item_i2d_bio(&DSAparams_it, bp, a);
}
开发者ID:mr-moai-2016,项目名称:znk_project,代码行数:5,代码来源:dsa_asn1.c


示例11: x509_main


//.........这里部分代码省略.........
                if (keyfile == NULL) {
                    BIO_printf(bio_err, "no request key file specified\n");
                    goto end;
                } else {
                    pk = load_key(keyfile, keyformat, 0,
                                  passin, e, "request key");
                    if (pk == NULL)
                        goto end;
                }

                BIO_printf(bio_err, "Generating certificate request\n");

                rq = X509_to_X509_REQ(x, pk, digest);
                EVP_PKEY_free(pk);
                if (rq == NULL) {
                    ERR_print_errors(bio_err);
                    goto end;
                }
                if (!noout) {
                    X509_REQ_print(out, rq);
                    PEM_write_bio_X509_REQ(out, rq);
                }
                noout = 1;
            } else if (ocspid == i) {
                X509_ocspid_print(out, x);
            }
        }
    }

    if (checkend) {
        time_t tcheck = time(NULL) + checkoffset;

        if (X509_cmp_time(X509_get_notAfter(x), &tcheck) < 0) {
            BIO_printf(out, "Certificate will expire\n");
            ret = 1;
        } else {
            BIO_printf(out, "Certificate will not expire\n");
            ret = 0;
        }
        goto end;
    }

    print_cert_checks(out, x, checkhost, checkemail, checkip);

    if (noout || nocert) {
        ret = 0;
        goto end;
    }

    if (badsig)
        x->signature->data[x->signature->length - 1] ^= 0x1;

    if (outformat == FORMAT_ASN1)
        i = i2d_X509_bio(out, x);
    else if (outformat == FORMAT_PEM) {
        if (trustout)
            i = PEM_write_bio_X509_AUX(out, x);
        else
            i = PEM_write_bio_X509(out, x);
    } else if (outformat == FORMAT_NETSCAPE) {
        NETSCAPE_X509 nx;
        ASN1_OCTET_STRING hdr;

        hdr.data = (unsigned char *)NETSCAPE_CERT_HDR;
        hdr.length = strlen(NETSCAPE_CERT_HDR);
        nx.header = &hdr;
        nx.cert = x;

        i = ASN1_item_i2d_bio(ASN1_ITEM_rptr(NETSCAPE_X509), out, &nx);
    } else {
        BIO_printf(bio_err, "bad output format specified for outfile\n");
        goto end;
    }
    if (!i) {
        BIO_printf(bio_err, "unable to write certificate\n");
        ERR_print_errors(bio_err);
        goto end;
    }
    ret = 0;
 end:
    if (need_rand)
        app_RAND_write_file(NULL);
    OBJ_cleanup();
    NCONF_free(extconf);
    BIO_free_all(out);
    X509_STORE_free(ctx);
    X509_REQ_free(req);
    X509_free(x);
    X509_free(xca);
    EVP_PKEY_free(Upkey);
    EVP_PKEY_free(CApkey);
    EVP_PKEY_free(fkey);
    sk_OPENSSL_STRING_free(sigopts);
    X509_REQ_free(rq);
    ASN1_INTEGER_free(sno);
    sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free);
    sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
    OPENSSL_free(passin);
    return (ret);
}
开发者ID:eight-pack-abdominals,项目名称:openssl,代码行数:101,代码来源:x509.c


示例12: i2d_CPK_PUBLIC_PARAMS_bio

int i2d_CPK_PUBLIC_PARAMS_bio(BIO *bp, CPK_PUBLIC_PARAMS *params) {
	return ASN1_item_i2d_bio(ASN1_ITEM_rptr(CPK_PUBLIC_PARAMS), bp, params);
}
开发者ID:Mumblebo,项目名称:GmSSL,代码行数:3,代码来源:cpk_asn1.c


示例13: i2d_CPK_MASTER_SECRET_bio

int i2d_CPK_MASTER_SECRET_bio(BIO *bp, CPK_MASTER_SECRET *master) {
	return ASN1_item_i2d_bio(ASN1_ITEM_rptr(CPK_MASTER_SECRET), bp, master);
}
开发者ID:Mumblebo,项目名称:GmSSL,代码行数:3,代码来源:cpk_asn1.c


示例14: i2d_OCSP_RESPONSE_bio

int
i2d_OCSP_RESPONSE_bio(BIO *bp, OCSP_RESPONSE *a)
{
	return ASN1_item_i2d_bio(&OCSP_RESPONSE_it, bp, a);
}
开发者ID:mr-moai-2016,项目名称:znk_project,代码行数:5,代码来源:ocsp_asn.c


示例15: i2d_OCSP_REQUEST_bio

int
i2d_OCSP_REQUEST_bio(BIO *bp, OCSP_REQUEST *a)
{
	return ASN1_item_i2d_bio(&OCSP_REQUEST_it, bp, a);
}
开发者ID:mr-moai-2016,项目名称:znk_project,代码行数:5,代码来源:ocsp_asn.c


示例16: i2d_CMS_bio

int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms)
{
    return ASN1_item_i2d_bio(ASN1_ITEM_rptr(CMS_ContentInfo), bp, cms);
}
开发者ID:GrayKing,项目名称:Leakfix-on-OpenSSL,代码行数:4,代码来源:cms_io.c


示例17: MAIN


//.........这里部分代码省略.........

				BIO_printf(bio_err,"Generating certificate request\n");

				rq=X509_to_X509_REQ(x,pk,digest);
				EVP_PKEY_free(pk);
				if (rq == NULL)
					{
					ERR_print_errors(bio_err);
					goto end;
					}
				if (!noout)
					{
					X509_REQ_print(out,rq);
					PEM_write_bio_X509_REQ(out,rq);
					}
				noout=1;
				}
			else if (ocspid == i)
				{
				X509_ocspid_print(out, x);
				}
			}
		}

	if (checkend)
		{
		time_t tcheck=time(NULL) + checkoffset;

		if (X509_cmp_time(X509_get_notAfter(x), &tcheck) < 0)
			{
			BIO_printf(out,"Certificate will expire\n");
			ret=1;
			}
		else
			{
			BIO_printf(out,"Certificate will not expire\n");
			ret=0;
			}
		goto end;
		}

	if (noout)
		{
		ret=0;
		goto end;
		}

	if 	(outformat == FORMAT_ASN1)
		i=i2d_X509_bio(out,x);
	else if (outformat == FORMAT_PEM)
		{
		if (trustout) i=PEM_write_bio_X509_AUX(out,x);
		else i=PEM_write_bio_X509(out,x);
		}
	else if (outformat == FORMAT_NETSCAPE)
		{
		NETSCAPE_X509 nx;
		ASN1_OCTET_STRING hdr;

		hdr.data=(unsigned char *)NETSCAPE_CERT_HDR;
		hdr.length=strlen(NETSCAPE_CERT_HDR);
		nx.header= &hdr;
		nx.cert=x;

		i=ASN1_item_i2d_bio(ASN1_ITEM_rptr(NETSCAPE_X509),out,&nx);
		}
	else	{
		BIO_printf(bio_err,"bad output format specified for outfile\n");
		goto end;
		}
	if (!i)
		{
		BIO_printf(bio_err,"unable to write certificate\n");
		ERR_print_errors(bio_err);
		goto end;
		}
	ret=0;
end:
	if (need_rand)
		app_RAND_write_file(NULL, bio_err);
	OBJ_cleanup();
	NCONF_free(extconf);
	BIO_free_all(out);
	BIO_free_all(STDout);
	X509_STORE_free(ctx);
	X509_REQ_free(req);
	X509_free(x);
	X509_free(xca);
	EVP_PKEY_free(Upkey);
	EVP_PKEY_free(CApkey);
	if (sigopts)
		sk_OPENSSL_STRING_free(sigopts);
	X509_REQ_free(rq);
	ASN1_INTEGER_free(sno);
	sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free);
	sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
	if (passin) OPENSSL_free(passin);
	apps_shutdown();
	OPENSSL_EXIT(ret);
	}
开发者ID:0omega,项目名称:platform_external_openssl,代码行数:101,代码来源:x509.c


示例18: i2d_X509_bio

int i2d_X509_bio(BIO *bp, X509 *x509)
{
    return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509), bp, x509);
}
开发者ID:1234-,项目名称:openssl,代码行数:4,代码来源:x_all.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ ASN1_item_i2d_fp函数代码示例发布时间:2022-05-30
下一篇:
C++ ASN1_item_i2d函数代码示例发布时间: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