michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: #ifndef _PKCS12_H_ michael@0: #define _PKCS12_H_ michael@0: michael@0: #include "pkcs12t.h" michael@0: #include "p12.h" michael@0: michael@0: SEC_BEGIN_PROTOS michael@0: michael@0: typedef SECItem * (* SEC_PKCS12GetPassword)(void *arg); michael@0: michael@0: /* Decode functions */ michael@0: /* Import a PFX item. michael@0: * der_pfx is the der-encoded pfx item to import. michael@0: * pbef, and pbefarg are used to retrieve passwords for the HMAC, michael@0: * and any passwords needed for passing to PKCS5 encryption michael@0: * routines. michael@0: * algorithm is the algorithm by which private keys are stored in michael@0: * the key database. this could be a specific algorithm or could michael@0: * be based on a global setting. michael@0: * slot is the slot to where the certificates will be placed. if NULL, michael@0: * the internal key slot is used. michael@0: * If the process is successful, a SECSuccess is returned, otherwise michael@0: * a failure occurred. michael@0: */ michael@0: SECStatus michael@0: SEC_PKCS12PutPFX(SECItem *der_pfx, SECItem *pwitem, michael@0: SEC_PKCS12NicknameCollisionCallback ncCall, michael@0: PK11SlotInfo *slot, void *wincx); michael@0: michael@0: /* check the first two bytes of a file to make sure that it matches michael@0: * the desired header for a PKCS 12 file michael@0: */ michael@0: PRBool SEC_PKCS12ValidData(char *buf, int bufLen, long int totalLength); michael@0: michael@0: SEC_END_PROTOS michael@0: michael@0: #endif