使用单个BIO推送到STACK_OF(X509_INFO)和STACK_OF(X509)2个堆栈

时间:2019-01-29 10:24:08

标签: c++ openssl stack

以下代码是我在使用BIO *将消息推送到X509_INFO stack(sk)X509 stack(certs)

但是我能注意到的是它仅将数据推送到X509 stack,始终X509_INFO stack为空。

STACK_OF(X509_INFO) *sk;
STACK_OF(X509) *certs;
X509* x509 = NULL;
BIO* stackbio = NULL;

stackbio = BIO_new(BIO_s_file());
stackbio = BIO_new_file("abc.pam", "r");

x509 = PEM_read_bio_X509(stackbio, NULL, NULL, NULL);

sk = PEM_X509_INFO_read_bio(stackbio, sk, NULL, NULL);//push certificate to sk

sk_X509_push(ca_certs, x509); // push certificate to certs

请帮助?

0 个答案:

没有答案