Hi!

Some example code to extract a cert from a P12 file:

        BIO* certFile = BIO_new_file("cert path", "r");
        PKCS12* p12 = nullptr;
        X509* cert = nullptr;

        if (!certFile) {
            goto done;
        }

        p12 = d2i_PKCS12_bio(certFile, nullptr);

        if (!p12) {
            goto done;
        }

        if (!PKCS12_parse(p12, "P12 password", &g_pk, &cert, nullptr)) {
            goto done;
        }

    done:
        X509_free(cert);
        PKCS12_free(p12);
        BIO_free(certFile);


On Mon, Mar 10, 2014 at 1:09 PM, Marcio Campos de Lima
<marcio.lim...@gmail.com> wrote:
> Hi
>
> How can I get the Public Key from a PKCS12 keystone?
> Do I need to parse the certificate ? Is there a way to store the public key 
> into the PKCS12 keystone?
>
> Thanks
>
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    openssl-users@openssl.org
> Automated List Manager                           majord...@openssl.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to