[#OSSL_CRMF_pbm_new]
= OSSL&lowbar;CRMF&lowbar;pbm&lowbar;new
:mrdocs:

Compute a Password&hyphen;Based MAC (PBM) for CRMF POPO using the given parameters, message, and secret&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
OSSL&lowbar;CRMF&lowbar;pbm&lowbar;new(
    xref:OSSL_LIB_CTX.adoc[OSSL&lowbar;LIB&lowbar;CTX]* libctx,
    char const* propq,
    xref:OSSL_CRMF_PBMPARAMETER.adoc[OSSL&lowbar;CRMF&lowbar;PBMPARAMETER] const* pbmp,
    unsigned char const* msg,
    size&lowbar;t msglen,
    unsigned char const* sec,
    size&lowbar;t seclen,
    unsigned char** mac,
    size&lowbar;t* maclen);
----

== Return Value

1 on success, or 0 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *libctx*
| Library context for algorithm fetching, or NULL for the default&period;
| *propq*
| Property query for the MAC algorithm, or NULL&period;
| *pbmp*
| PBMParameter describing salt, OWF, iteration count, and MAC&period;
| *msg*
| Message octets to authenticate&period;
| *msglen*
| Length of `msg` in bytes&period;
| *sec*
| Shared secret &sol; password octets&period;
| *seclen*
| Length of `sec` in bytes&period;
| *mac*
| On success, receives a newly allocated MAC buffer (caller frees with OPENSSL&lowbar;free())&period;
| *maclen*
| Optional&semi; on success receives the MAC length in bytes when non&hyphen;NULL&period;
|===


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