當前位置: 首頁>>代碼示例>>C++>>正文


C++ ASN1_item_i2d_bio函數代碼示例

本文整理匯總了C++中ASN1_item_i2d_bio函數的典型用法代碼示例。如果您正苦於以下問題:C++ ASN1_item_i2d_bio函數的具體用法?C++ ASN1_item_i2d_bio怎麽用?C++ ASN1_item_i2d_bio使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ASN1_item_i2d_bio函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的ASN1_item_i2d_bio函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。