以下代码是我在使用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
请帮助?