1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/lib/pkcs12/p12local.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,59 @@ 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 _P12LOCAL_H_ 1.10 +#define _P12LOCAL_H_ 1.11 + 1.12 +#include "plarena.h" 1.13 +#include "secoidt.h" 1.14 +#include "secasn1.h" 1.15 +#include "secder.h" 1.16 +#include "certt.h" 1.17 +#include "secpkcs7.h" 1.18 +#include "pkcs12.h" 1.19 +#include "p12.h" 1.20 + 1.21 +/* helper functions */ 1.22 +extern const SEC_ASN1Template * 1.23 +sec_pkcs12_choose_bag_type(void *src_or_dest, PRBool encoding); 1.24 +extern const SEC_ASN1Template * 1.25 +sec_pkcs12_choose_cert_crl_type(void *src_or_dest, PRBool encoding); 1.26 +extern const SEC_ASN1Template * 1.27 +sec_pkcs12_choose_shroud_type(void *src_or_dest, PRBool encoding); 1.28 +extern SECItem *sec_pkcs12_generate_salt(void); 1.29 +extern SECItem *sec_pkcs12_generate_key_from_password(SECOidTag algorithm, 1.30 + SECItem *salt, SECItem *password); 1.31 +extern SECItem *sec_pkcs12_generate_mac(SECItem *key, SECItem *msg, 1.32 + PRBool old_method); 1.33 +extern SGNDigestInfo *sec_pkcs12_compute_thumbprint(SECItem *der_cert); 1.34 +extern SECItem *sec_pkcs12_create_virtual_password(SECItem *password, 1.35 + SECItem *salt, PRBool swapUnicodeBytes); 1.36 +extern SECStatus sec_pkcs12_append_shrouded_key(SEC_PKCS12BaggageItem *bag, 1.37 + SEC_PKCS12ESPVKItem *espvk); 1.38 +extern void *sec_pkcs12_find_object(SEC_PKCS12SafeContents *safe, 1.39 + SEC_PKCS12Baggage *baggage, SECOidTag objType, 1.40 + SECItem *nickname, SGNDigestInfo *thumbprint); 1.41 +extern PRBool sec_pkcs12_convert_item_to_unicode(PLArenaPool *arena, SECItem *dest, 1.42 + SECItem *src, PRBool zeroTerm, 1.43 + PRBool asciiConvert, PRBool toUnicode); 1.44 +extern CK_MECHANISM_TYPE sec_pkcs12_algtag_to_mech(SECOidTag algtag); 1.45 + 1.46 +/* create functions */ 1.47 +extern SEC_PKCS12PFXItem *sec_pkcs12_new_pfx(void); 1.48 +extern SEC_PKCS12SafeContents *sec_pkcs12_create_safe_contents( 1.49 + PLArenaPool *poolp); 1.50 +extern SEC_PKCS12Baggage *sec_pkcs12_create_baggage(PLArenaPool *poolp); 1.51 +extern SEC_PKCS12BaggageItem *sec_pkcs12_create_external_bag(SEC_PKCS12Baggage *luggage); 1.52 +extern void SEC_PKCS12DestroyPFX(SEC_PKCS12PFXItem *pfx); 1.53 +extern SEC_PKCS12AuthenticatedSafe *sec_pkcs12_new_asafe(PLArenaPool *poolp); 1.54 + 1.55 +/* conversion from old to new */ 1.56 +extern SEC_PKCS12DecoderContext * 1.57 +sec_PKCS12ConvertOldSafeToNew(PLArenaPool *arena, PK11SlotInfo *slot, 1.58 + PRBool swapUnicode, SECItem *pwitem, 1.59 + void *wincx, SEC_PKCS12SafeContents *safe, 1.60 + SEC_PKCS12Baggage *baggage); 1.61 + 1.62 +#endif