|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 |
|
6 #ifndef _PKCS12_H_ |
|
7 #define _PKCS12_H_ |
|
8 |
|
9 #include "pkcs12t.h" |
|
10 #include "p12.h" |
|
11 |
|
12 SEC_BEGIN_PROTOS |
|
13 |
|
14 typedef SECItem * (* SEC_PKCS12GetPassword)(void *arg); |
|
15 |
|
16 /* Decode functions */ |
|
17 /* Import a PFX item. |
|
18 * der_pfx is the der-encoded pfx item to import. |
|
19 * pbef, and pbefarg are used to retrieve passwords for the HMAC, |
|
20 * and any passwords needed for passing to PKCS5 encryption |
|
21 * routines. |
|
22 * algorithm is the algorithm by which private keys are stored in |
|
23 * the key database. this could be a specific algorithm or could |
|
24 * be based on a global setting. |
|
25 * slot is the slot to where the certificates will be placed. if NULL, |
|
26 * the internal key slot is used. |
|
27 * If the process is successful, a SECSuccess is returned, otherwise |
|
28 * a failure occurred. |
|
29 */ |
|
30 SECStatus |
|
31 SEC_PKCS12PutPFX(SECItem *der_pfx, SECItem *pwitem, |
|
32 SEC_PKCS12NicknameCollisionCallback ncCall, |
|
33 PK11SlotInfo *slot, void *wincx); |
|
34 |
|
35 /* check the first two bytes of a file to make sure that it matches |
|
36 * the desired header for a PKCS 12 file |
|
37 */ |
|
38 PRBool SEC_PKCS12ValidData(char *buf, int bufLen, long int totalLength); |
|
39 |
|
40 SEC_END_PROTOS |
|
41 |
|
42 #endif |