[#PKCS12_SAFEBAG_get1_cert_ex]
= PKCS12&lowbar;SAFEBAG&lowbar;get1&lowbar;cert&lowbar;ex
:mrdocs:

Extract an X&period;509 certificate from a certBag safeBag with a library context&period;

== Synopsis

Declared in `&lt;openssl&sol;pkcs12&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:X509.adoc[X509]*
PKCS12&lowbar;SAFEBAG&lowbar;get1&lowbar;cert&lowbar;ex(
    xref:PKCS12_SAFEBAG.adoc[PKCS12&lowbar;SAFEBAG] const* bag,
    xref:OSSL_LIB_CTX.adoc[OSSL&lowbar;LIB&lowbar;CTX]* libctx,
    char const* propq);
----

== Return Value

New X509 certificate, or NULL on error&period; Caller must free&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *bag*
| SafeBag containing a certificate&period;
| *libctx*
| Library context for algorithm fetching, or NULL for default&period;
| *propq*
| Property query for algorithm fetching, or NULL&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
