1PKCS12_GEN_MAC(3ossl)               OpenSSL              PKCS12_GEN_MAC(3ossl)
2
3
4

NAME

6       PKCS12_gen_mac, PKCS12_setup_mac, PKCS12_set_mac, PKCS12_verify_mac -
7       Functions to create and manipulate a PKCS#12 structure
8

SYNOPSIS

10        #include <openssl/pkcs12.h>
11
12        int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen,
13                           unsigned char *mac, unsigned int *maclen);
14        int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen);
15        int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
16                           unsigned char *salt, int saltlen, int iter,
17                           const EVP_MD *md_type);
18        int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt,
19                             int saltlen, const EVP_MD *md_type);
20

DESCRIPTION

22       PKCS12_gen_mac() generates an HMAC over the entire PKCS#12 object using
23       the supplied password along with a set of already configured paramters.
24
25       PKCS12_verify_mac() verifies the PKCS#12 object's HMAC using the
26       supplied password.
27
28       PKCS12_setup_mac() sets the MAC part of the PKCS#12 structure with the
29       supplied parameters.
30
31       PKCS12_set_mac() sets the MAC and MAC parameters into the PKCS#12
32       object.
33
34       pass is the passphrase to use in the HMAC. salt is the salt value to
35       use, iter is the iteration count and md_type is the message digest
36       function to use.
37

NOTES

39       If salt is NULL then a suitable salt will be generated and used.
40
41       If iter is 1 then an iteration count will be omitted from the PKCS#12
42       structure.
43
44       PKCS12_gen_mac(), PKCS12_verify_mac() and PKCS12_set_mac() make
45       assumptions regarding the encoding of the given passphrase. See
46       passphrase-encoding(7) for more information.
47

RETURN VALUES

49       All functions return 1 on success and 0 if an error occurred.
50

CONFORMING TO

52       IETF RFC 7292 (<https://tools.ietf.org/html/rfc7292>)
53

SEE ALSO

55       d2i_PKCS12(3), PKCS12_create(3), passphrase-encoding(7)
56
58       Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
59
60       Licensed under the Apache License 2.0 (the "License").  You may not use
61       this file except in compliance with the License.  You can obtain a copy
62       in the file LICENSE in the source distribution or at
63       <https://www.openssl.org/source/license.html>.
64
65
66
673.0.9                             2023-07-27             PKCS12_GEN_MAC(3ossl)
Impressum