crypto/pkcs12: facilitate accessing data with non-interoperable password.
[openssl.git] / crypto / pkcs12 / p12_lcl.h
1 /*
2  * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
3  *
4  * Licensed under the OpenSSL license (the "License").  You may not use
5  * this file except in compliance with the License.  You can obtain a copy
6  * in the file LICENSE in the source distribution or at
7  * https://www.openssl.org/source/license.html
8  */
9
10 struct PKCS12_MAC_DATA_st {
11     X509_SIG *dinfo;
12     ASN1_OCTET_STRING *salt;
13     ASN1_INTEGER *iter;         /* defaults to 1 */
14 };
15
16 struct PKCS12_st {
17     ASN1_INTEGER *version;
18     PKCS12_MAC_DATA *mac;
19     PKCS7 *authsafes;
20 };
21
22 struct PKCS12_SAFEBAG_st {
23     ASN1_OBJECT *type;
24     union {
25         struct pkcs12_bag_st *bag; /* secret, crl and certbag */
26         struct pkcs8_priv_key_info_st *keybag; /* keybag */
27         X509_SIG *shkeybag;     /* shrouded key bag */
28         STACK_OF(PKCS12_SAFEBAG) *safes;
29         ASN1_TYPE *other;
30     } value;
31     STACK_OF(X509_ATTRIBUTE) *attrib;
32 };
33
34 struct pkcs12_bag_st {
35     ASN1_OBJECT *type;
36     union {
37         ASN1_OCTET_STRING *x509cert;
38         ASN1_OCTET_STRING *x509crl;
39         ASN1_OCTET_STRING *octet;
40         ASN1_IA5STRING *sdsicert;
41         ASN1_TYPE *other;       /* Secret or other bag */
42     } value;
43 };
44
45 #undef PKCS12_key_gen
46 /*
47  * See p12_multi.c:PKCS12_verify_mac() for details...
48  */
49 extern int (*PKCS12_key_gen)(const char *pass, int passlen,
50                              unsigned char *salt, int slen,
51                              int id, int iter, int n,
52                              unsigned char *out,
53                              const EVP_MD *md_type);