How to get optional certificate in openssl
I used openssl to create SMIME.
i have a valid certificate.I tried to parse this certificate using the following function
int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca);
The certificate parsed successfully and i could able get pkey
, cert
values.But ca
always comes out with null开发者_C百科
.
How to get this STACK_OF(X509)
value from a certificate. I want to use this STACK_OF(X509)
value in PKCS7_sign
function.
If ca
comes out as NULL
, then you probably have no additional certificates in your PKCS12 structure. You do not necessarily need any additional certificates - if your certificate is signed directly by a CA certificate already known to the recipient, then you can simply supply certs = NULL
to pkcs7_sign()
and no additional certificates will be included in the signed message.
精彩评论