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
24       parameters.
25
26       PKCS12_verify_mac() verifies the PKCS#12 object's HMAC using the
27       supplied password.
28
29       PKCS12_setup_mac() sets the MAC part of the PKCS#12 structure with the
30       supplied parameters.
31
32       PKCS12_set_mac() sets the MAC and MAC parameters into the PKCS#12
33       object.
34
35       pass is the passphrase to use in the HMAC. salt is the salt value to
36       use, iter is the iteration count and md_type is the message digest
37       function to use.
38

NOTES

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

RETURN VALUES

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

CONFORMING TO

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

SEE ALSO

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