1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/lib/pkcs12/pkcs12.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,42 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 + 1.9 +#ifndef _PKCS12_H_ 1.10 +#define _PKCS12_H_ 1.11 + 1.12 +#include "pkcs12t.h" 1.13 +#include "p12.h" 1.14 + 1.15 +SEC_BEGIN_PROTOS 1.16 + 1.17 +typedef SECItem * (* SEC_PKCS12GetPassword)(void *arg); 1.18 + 1.19 +/* Decode functions */ 1.20 +/* Import a PFX item. 1.21 + * der_pfx is the der-encoded pfx item to import. 1.22 + * pbef, and pbefarg are used to retrieve passwords for the HMAC, 1.23 + * and any passwords needed for passing to PKCS5 encryption 1.24 + * routines. 1.25 + * algorithm is the algorithm by which private keys are stored in 1.26 + * the key database. this could be a specific algorithm or could 1.27 + * be based on a global setting. 1.28 + * slot is the slot to where the certificates will be placed. if NULL, 1.29 + * the internal key slot is used. 1.30 + * If the process is successful, a SECSuccess is returned, otherwise 1.31 + * a failure occurred. 1.32 + */ 1.33 +SECStatus 1.34 +SEC_PKCS12PutPFX(SECItem *der_pfx, SECItem *pwitem, 1.35 + SEC_PKCS12NicknameCollisionCallback ncCall, 1.36 + PK11SlotInfo *slot, void *wincx); 1.37 + 1.38 +/* check the first two bytes of a file to make sure that it matches 1.39 + * the desired header for a PKCS 12 file 1.40 + */ 1.41 +PRBool SEC_PKCS12ValidData(char *buf, int bufLen, long int totalLength); 1.42 + 1.43 +SEC_END_PROTOS 1.44 + 1.45 +#endif