10Sstevel@tonic-gate /* pkcs12.h */ 20Sstevel@tonic-gate /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL 30Sstevel@tonic-gate * project 1999. 40Sstevel@tonic-gate */ 50Sstevel@tonic-gate /* ==================================================================== 60Sstevel@tonic-gate * Copyright (c) 1999 The OpenSSL Project. All rights reserved. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * Redistribution and use in source and binary forms, with or without 90Sstevel@tonic-gate * modification, are permitted provided that the following conditions 100Sstevel@tonic-gate * are met: 110Sstevel@tonic-gate * 120Sstevel@tonic-gate * 1. Redistributions of source code must retain the above copyright 130Sstevel@tonic-gate * notice, this list of conditions and the following disclaimer. 140Sstevel@tonic-gate * 150Sstevel@tonic-gate * 2. Redistributions in binary form must reproduce the above copyright 160Sstevel@tonic-gate * notice, this list of conditions and the following disclaimer in 170Sstevel@tonic-gate * the documentation and/or other materials provided with the 180Sstevel@tonic-gate * distribution. 190Sstevel@tonic-gate * 200Sstevel@tonic-gate * 3. All advertising materials mentioning features or use of this 210Sstevel@tonic-gate * software must display the following acknowledgment: 220Sstevel@tonic-gate * "This product includes software developed by the OpenSSL Project 230Sstevel@tonic-gate * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 240Sstevel@tonic-gate * 250Sstevel@tonic-gate * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 260Sstevel@tonic-gate * endorse or promote products derived from this software without 270Sstevel@tonic-gate * prior written permission. For written permission, please contact 280Sstevel@tonic-gate * licensing@OpenSSL.org. 290Sstevel@tonic-gate * 300Sstevel@tonic-gate * 5. Products derived from this software may not be called "OpenSSL" 310Sstevel@tonic-gate * nor may "OpenSSL" appear in their names without prior written 320Sstevel@tonic-gate * permission of the OpenSSL Project. 330Sstevel@tonic-gate * 340Sstevel@tonic-gate * 6. Redistributions of any form whatsoever must retain the following 350Sstevel@tonic-gate * acknowledgment: 360Sstevel@tonic-gate * "This product includes software developed by the OpenSSL Project 370Sstevel@tonic-gate * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 380Sstevel@tonic-gate * 390Sstevel@tonic-gate * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 400Sstevel@tonic-gate * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 410Sstevel@tonic-gate * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 420Sstevel@tonic-gate * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 430Sstevel@tonic-gate * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 440Sstevel@tonic-gate * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 450Sstevel@tonic-gate * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 460Sstevel@tonic-gate * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 470Sstevel@tonic-gate * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 480Sstevel@tonic-gate * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 490Sstevel@tonic-gate * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 500Sstevel@tonic-gate * OF THE POSSIBILITY OF SUCH DAMAGE. 510Sstevel@tonic-gate * ==================================================================== 520Sstevel@tonic-gate * 530Sstevel@tonic-gate * This product includes cryptographic software written by Eric Young 540Sstevel@tonic-gate * (eay@cryptsoft.com). This product includes software written by Tim 550Sstevel@tonic-gate * Hudson (tjh@cryptsoft.com). 560Sstevel@tonic-gate * 570Sstevel@tonic-gate */ 580Sstevel@tonic-gate 590Sstevel@tonic-gate #ifndef HEADER_PKCS12_H 600Sstevel@tonic-gate #define HEADER_PKCS12_H 610Sstevel@tonic-gate 620Sstevel@tonic-gate #include <openssl/bio.h> 630Sstevel@tonic-gate #include <openssl/x509.h> 640Sstevel@tonic-gate 650Sstevel@tonic-gate #ifdef __cplusplus 660Sstevel@tonic-gate extern "C" { 670Sstevel@tonic-gate #endif 680Sstevel@tonic-gate 690Sstevel@tonic-gate #define PKCS12_KEY_ID 1 700Sstevel@tonic-gate #define PKCS12_IV_ID 2 710Sstevel@tonic-gate #define PKCS12_MAC_ID 3 720Sstevel@tonic-gate 730Sstevel@tonic-gate /* Default iteration count */ 740Sstevel@tonic-gate #ifndef PKCS12_DEFAULT_ITER 750Sstevel@tonic-gate #define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER 760Sstevel@tonic-gate #endif 770Sstevel@tonic-gate 780Sstevel@tonic-gate #define PKCS12_MAC_KEY_LENGTH 20 790Sstevel@tonic-gate 800Sstevel@tonic-gate #define PKCS12_SALT_LEN 8 810Sstevel@tonic-gate 820Sstevel@tonic-gate /* Uncomment out next line for unicode password and names, otherwise ASCII */ 830Sstevel@tonic-gate 840Sstevel@tonic-gate /*#define PBE_UNICODE*/ 850Sstevel@tonic-gate 860Sstevel@tonic-gate #ifdef PBE_UNICODE 870Sstevel@tonic-gate #define PKCS12_key_gen PKCS12_key_gen_uni 880Sstevel@tonic-gate #define PKCS12_add_friendlyname PKCS12_add_friendlyname_uni 890Sstevel@tonic-gate #else 900Sstevel@tonic-gate #define PKCS12_key_gen PKCS12_key_gen_asc 910Sstevel@tonic-gate #define PKCS12_add_friendlyname PKCS12_add_friendlyname_asc 920Sstevel@tonic-gate #endif 930Sstevel@tonic-gate 940Sstevel@tonic-gate /* MS key usage constants */ 950Sstevel@tonic-gate 960Sstevel@tonic-gate #define KEY_EX 0x10 970Sstevel@tonic-gate #define KEY_SIG 0x80 980Sstevel@tonic-gate 990Sstevel@tonic-gate typedef struct { 1000Sstevel@tonic-gate X509_SIG *dinfo; 1010Sstevel@tonic-gate ASN1_OCTET_STRING *salt; 1020Sstevel@tonic-gate ASN1_INTEGER *iter; /* defaults to 1 */ 1030Sstevel@tonic-gate } PKCS12_MAC_DATA; 1040Sstevel@tonic-gate 1050Sstevel@tonic-gate typedef struct { 1060Sstevel@tonic-gate ASN1_INTEGER *version; 1070Sstevel@tonic-gate PKCS12_MAC_DATA *mac; 1080Sstevel@tonic-gate PKCS7 *authsafes; 1090Sstevel@tonic-gate } PKCS12; 1100Sstevel@tonic-gate 1110Sstevel@tonic-gate PREDECLARE_STACK_OF(PKCS12_SAFEBAG) 1120Sstevel@tonic-gate 1130Sstevel@tonic-gate typedef struct { 1140Sstevel@tonic-gate ASN1_OBJECT *type; 1150Sstevel@tonic-gate union { 1160Sstevel@tonic-gate struct pkcs12_bag_st *bag; /* secret, crl and certbag */ 1170Sstevel@tonic-gate struct pkcs8_priv_key_info_st *keybag; /* keybag */ 1180Sstevel@tonic-gate X509_SIG *shkeybag; /* shrouded key bag */ 1190Sstevel@tonic-gate STACK_OF(PKCS12_SAFEBAG) *safes; 1200Sstevel@tonic-gate ASN1_TYPE *other; 1210Sstevel@tonic-gate }value; 1220Sstevel@tonic-gate STACK_OF(X509_ATTRIBUTE) *attrib; 1230Sstevel@tonic-gate } PKCS12_SAFEBAG; 1240Sstevel@tonic-gate 1250Sstevel@tonic-gate DECLARE_STACK_OF(PKCS12_SAFEBAG) 1260Sstevel@tonic-gate DECLARE_ASN1_SET_OF(PKCS12_SAFEBAG) 1270Sstevel@tonic-gate DECLARE_PKCS12_STACK_OF(PKCS12_SAFEBAG) 1280Sstevel@tonic-gate 1290Sstevel@tonic-gate typedef struct pkcs12_bag_st { 1300Sstevel@tonic-gate ASN1_OBJECT *type; 1310Sstevel@tonic-gate union { 1320Sstevel@tonic-gate ASN1_OCTET_STRING *x509cert; 1330Sstevel@tonic-gate ASN1_OCTET_STRING *x509crl; 1340Sstevel@tonic-gate ASN1_OCTET_STRING *octet; 1350Sstevel@tonic-gate ASN1_IA5STRING *sdsicert; 1360Sstevel@tonic-gate ASN1_TYPE *other; /* Secret or other bag */ 1370Sstevel@tonic-gate }value; 1380Sstevel@tonic-gate } PKCS12_BAGS; 1390Sstevel@tonic-gate 1400Sstevel@tonic-gate #define PKCS12_ERROR 0 1410Sstevel@tonic-gate #define PKCS12_OK 1 1420Sstevel@tonic-gate 1430Sstevel@tonic-gate /* Compatibility macros */ 1440Sstevel@tonic-gate 1450Sstevel@tonic-gate #define M_PKCS12_x5092certbag PKCS12_x5092certbag 1460Sstevel@tonic-gate #define M_PKCS12_x509crl2certbag PKCS12_x509crl2certbag 1470Sstevel@tonic-gate 1480Sstevel@tonic-gate #define M_PKCS12_certbag2x509 PKCS12_certbag2x509 1490Sstevel@tonic-gate #define M_PKCS12_certbag2x509crl PKCS12_certbag2x509crl 1500Sstevel@tonic-gate 1510Sstevel@tonic-gate #define M_PKCS12_unpack_p7data PKCS12_unpack_p7data 1520Sstevel@tonic-gate #define M_PKCS12_pack_authsafes PKCS12_pack_authsafes 1530Sstevel@tonic-gate #define M_PKCS12_unpack_authsafes PKCS12_unpack_authsafes 1540Sstevel@tonic-gate #define M_PKCS12_unpack_p7encdata PKCS12_unpack_p7encdata 1550Sstevel@tonic-gate 1560Sstevel@tonic-gate #define M_PKCS12_decrypt_skey PKCS12_decrypt_skey 1570Sstevel@tonic-gate #define M_PKCS8_decrypt PKCS8_decrypt 1580Sstevel@tonic-gate 1590Sstevel@tonic-gate #define M_PKCS12_bag_type(bg) OBJ_obj2nid((bg)->type) 1600Sstevel@tonic-gate #define M_PKCS12_cert_bag_type(bg) OBJ_obj2nid((bg)->value.bag->type) 1610Sstevel@tonic-gate #define M_PKCS12_crl_bag_type M_PKCS12_cert_bag_type 1620Sstevel@tonic-gate 1630Sstevel@tonic-gate #define PKCS12_get_attr(bag, attr_nid) \ 1640Sstevel@tonic-gate PKCS12_get_attr_gen(bag->attrib, attr_nid) 1650Sstevel@tonic-gate 1660Sstevel@tonic-gate #define PKCS8_get_attr(p8, attr_nid) \ 1670Sstevel@tonic-gate PKCS12_get_attr_gen(p8->attributes, attr_nid) 1680Sstevel@tonic-gate 1690Sstevel@tonic-gate #define PKCS12_mac_present(p12) ((p12)->mac ? 1 : 0) 1700Sstevel@tonic-gate 1710Sstevel@tonic-gate 1720Sstevel@tonic-gate PKCS12_SAFEBAG *PKCS12_x5092certbag(X509 *x509); 1730Sstevel@tonic-gate PKCS12_SAFEBAG *PKCS12_x509crl2certbag(X509_CRL *crl); 1740Sstevel@tonic-gate X509 *PKCS12_certbag2x509(PKCS12_SAFEBAG *bag); 1750Sstevel@tonic-gate X509_CRL *PKCS12_certbag2x509crl(PKCS12_SAFEBAG *bag); 1760Sstevel@tonic-gate 1770Sstevel@tonic-gate PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it, int nid1, 1780Sstevel@tonic-gate int nid2); 1790Sstevel@tonic-gate PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG(PKCS8_PRIV_KEY_INFO *p8); 1800Sstevel@tonic-gate PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *p8, const char *pass, int passlen); 1810Sstevel@tonic-gate PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(PKCS12_SAFEBAG *bag, const char *pass, 1820Sstevel@tonic-gate int passlen); 1830Sstevel@tonic-gate X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, 1840Sstevel@tonic-gate const char *pass, int passlen, 1850Sstevel@tonic-gate unsigned char *salt, int saltlen, int iter, 1860Sstevel@tonic-gate PKCS8_PRIV_KEY_INFO *p8); 1870Sstevel@tonic-gate PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass, 1880Sstevel@tonic-gate int passlen, unsigned char *salt, 1890Sstevel@tonic-gate int saltlen, int iter, 1900Sstevel@tonic-gate PKCS8_PRIV_KEY_INFO *p8); 1910Sstevel@tonic-gate PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk); 1920Sstevel@tonic-gate STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7); 1930Sstevel@tonic-gate PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen, 1940Sstevel@tonic-gate unsigned char *salt, int saltlen, int iter, 1950Sstevel@tonic-gate STACK_OF(PKCS12_SAFEBAG) *bags); 1960Sstevel@tonic-gate STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, int passlen); 1970Sstevel@tonic-gate 1980Sstevel@tonic-gate int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes); 1990Sstevel@tonic-gate STACK_OF(PKCS7) *PKCS12_unpack_authsafes(PKCS12 *p12); 2000Sstevel@tonic-gate 2010Sstevel@tonic-gate int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, int namelen); 2020Sstevel@tonic-gate int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name, 2030Sstevel@tonic-gate int namelen); 2040Sstevel@tonic-gate int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name, 2050Sstevel@tonic-gate int namelen); 2060Sstevel@tonic-gate int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag, const unsigned char *name, 2070Sstevel@tonic-gate int namelen); 2080Sstevel@tonic-gate int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage); 2090Sstevel@tonic-gate ASN1_TYPE *PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid); 2100Sstevel@tonic-gate char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag); 2110Sstevel@tonic-gate unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass, 2120Sstevel@tonic-gate int passlen, unsigned char *in, int inlen, 2130Sstevel@tonic-gate unsigned char **data, int *datalen, int en_de); 2140Sstevel@tonic-gate void * PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it, 2150Sstevel@tonic-gate const char *pass, int passlen, ASN1_OCTET_STRING *oct, int zbuf); 2160Sstevel@tonic-gate ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, const ASN1_ITEM *it, 2170Sstevel@tonic-gate const char *pass, int passlen, 2180Sstevel@tonic-gate void *obj, int zbuf); 2190Sstevel@tonic-gate PKCS12 *PKCS12_init(int mode); 2200Sstevel@tonic-gate int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt, 2210Sstevel@tonic-gate int saltlen, int id, int iter, int n, 2220Sstevel@tonic-gate unsigned char *out, const EVP_MD *md_type); 2230Sstevel@tonic-gate int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, int saltlen, int id, int iter, int n, unsigned char *out, const EVP_MD *md_type); 2240Sstevel@tonic-gate int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, 2250Sstevel@tonic-gate ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md_type, 2260Sstevel@tonic-gate int en_de); 2270Sstevel@tonic-gate int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen, 2280Sstevel@tonic-gate unsigned char *mac, unsigned int *maclen); 2290Sstevel@tonic-gate int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen); 2300Sstevel@tonic-gate int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen, 2310Sstevel@tonic-gate unsigned char *salt, int saltlen, int iter, 2320Sstevel@tonic-gate const EVP_MD *md_type); 2330Sstevel@tonic-gate int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, 2340Sstevel@tonic-gate int saltlen, const EVP_MD *md_type); 2350Sstevel@tonic-gate unsigned char *asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen); 2360Sstevel@tonic-gate char *uni2asc(unsigned char *uni, int unilen); 2370Sstevel@tonic-gate 2380Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(PKCS12) 2390Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA) 2400Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG) 2410Sstevel@tonic-gate DECLARE_ASN1_FUNCTIONS(PKCS12_BAGS) 2420Sstevel@tonic-gate 2430Sstevel@tonic-gate DECLARE_ASN1_ITEM(PKCS12_SAFEBAGS) 2440Sstevel@tonic-gate DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES) 2450Sstevel@tonic-gate 2460Sstevel@tonic-gate void PKCS12_PBE_add(void); 2470Sstevel@tonic-gate int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, 2480Sstevel@tonic-gate STACK_OF(X509) **ca); 2490Sstevel@tonic-gate PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, 2500Sstevel@tonic-gate STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter, 2510Sstevel@tonic-gate int mac_iter, int keytype); 252*2139Sjp161948 253*2139Sjp161948 PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert); 254*2139Sjp161948 PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, EVP_PKEY *key, 255*2139Sjp161948 int key_usage, int iter, 256*2139Sjp161948 int key_nid, char *pass); 257*2139Sjp161948 int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags, 258*2139Sjp161948 int safe_nid, int iter, char *pass); 259*2139Sjp161948 PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid); 260*2139Sjp161948 2610Sstevel@tonic-gate int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12); 2620Sstevel@tonic-gate int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12); 2630Sstevel@tonic-gate PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12); 2640Sstevel@tonic-gate PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12); 2650Sstevel@tonic-gate int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass); 2660Sstevel@tonic-gate 2670Sstevel@tonic-gate /* BEGIN ERROR CODES */ 2680Sstevel@tonic-gate /* The following lines are auto generated by the script mkerr.pl. Any changes 2690Sstevel@tonic-gate * made after this point may be overwritten when the script is next run. 2700Sstevel@tonic-gate */ 2710Sstevel@tonic-gate void ERR_load_PKCS12_strings(void); 2720Sstevel@tonic-gate 2730Sstevel@tonic-gate /* Error codes for the PKCS12 functions. */ 2740Sstevel@tonic-gate 2750Sstevel@tonic-gate /* Function codes. */ 276*2139Sjp161948 #define PKCS12_F_PARSE_BAG 129 2770Sstevel@tonic-gate #define PKCS12_F_PARSE_BAGS 103 2780Sstevel@tonic-gate #define PKCS12_F_PKCS12_ADD_FRIENDLYNAME 100 2790Sstevel@tonic-gate #define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_ASC 127 2800Sstevel@tonic-gate #define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI 102 2810Sstevel@tonic-gate #define PKCS12_F_PKCS12_ADD_LOCALKEYID 104 2820Sstevel@tonic-gate #define PKCS12_F_PKCS12_CREATE 105 2830Sstevel@tonic-gate #define PKCS12_F_PKCS12_GEN_MAC 107 2840Sstevel@tonic-gate #define PKCS12_F_PKCS12_INIT 109 285*2139Sjp161948 #define PKCS12_F_PKCS12_ITEM_DECRYPT_D2I 106 286*2139Sjp161948 #define PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT 108 287*2139Sjp161948 #define PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG 117 2880Sstevel@tonic-gate #define PKCS12_F_PKCS12_KEY_GEN_ASC 110 2890Sstevel@tonic-gate #define PKCS12_F_PKCS12_KEY_GEN_UNI 111 2900Sstevel@tonic-gate #define PKCS12_F_PKCS12_MAKE_KEYBAG 112 2910Sstevel@tonic-gate #define PKCS12_F_PKCS12_MAKE_SHKEYBAG 113 2920Sstevel@tonic-gate #define PKCS12_F_PKCS12_NEWPASS 128 2930Sstevel@tonic-gate #define PKCS12_F_PKCS12_PACK_P7DATA 114 2940Sstevel@tonic-gate #define PKCS12_F_PKCS12_PACK_P7ENCDATA 115 2950Sstevel@tonic-gate #define PKCS12_F_PKCS12_PARSE 118 2960Sstevel@tonic-gate #define PKCS12_F_PKCS12_PBE_CRYPT 119 2970Sstevel@tonic-gate #define PKCS12_F_PKCS12_PBE_KEYIVGEN 120 2980Sstevel@tonic-gate #define PKCS12_F_PKCS12_SETUP_MAC 122 2990Sstevel@tonic-gate #define PKCS12_F_PKCS12_SET_MAC 123 300*2139Sjp161948 #define PKCS12_F_PKCS12_UNPACK_AUTHSAFES 130 301*2139Sjp161948 #define PKCS12_F_PKCS12_UNPACK_P7DATA 131 302*2139Sjp161948 #define PKCS12_F_PKCS12_VERIFY_MAC 126 3030Sstevel@tonic-gate #define PKCS12_F_PKCS8_ADD_KEYUSAGE 124 3040Sstevel@tonic-gate #define PKCS12_F_PKCS8_ENCRYPT 125 3050Sstevel@tonic-gate 3060Sstevel@tonic-gate /* Reason codes. */ 3070Sstevel@tonic-gate #define PKCS12_R_CANT_PACK_STRUCTURE 100 308*2139Sjp161948 #define PKCS12_R_CONTENT_TYPE_NOT_DATA 121 3090Sstevel@tonic-gate #define PKCS12_R_DECODE_ERROR 101 3100Sstevel@tonic-gate #define PKCS12_R_ENCODE_ERROR 102 3110Sstevel@tonic-gate #define PKCS12_R_ENCRYPT_ERROR 103 3120Sstevel@tonic-gate #define PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE 120 3130Sstevel@tonic-gate #define PKCS12_R_INVALID_NULL_ARGUMENT 104 3140Sstevel@tonic-gate #define PKCS12_R_INVALID_NULL_PKCS12_POINTER 105 3150Sstevel@tonic-gate #define PKCS12_R_IV_GEN_ERROR 106 3160Sstevel@tonic-gate #define PKCS12_R_KEY_GEN_ERROR 107 3170Sstevel@tonic-gate #define PKCS12_R_MAC_ABSENT 108 3180Sstevel@tonic-gate #define PKCS12_R_MAC_GENERATION_ERROR 109 3190Sstevel@tonic-gate #define PKCS12_R_MAC_SETUP_ERROR 110 3200Sstevel@tonic-gate #define PKCS12_R_MAC_STRING_SET_ERROR 111 3210Sstevel@tonic-gate #define PKCS12_R_MAC_VERIFY_ERROR 112 3220Sstevel@tonic-gate #define PKCS12_R_MAC_VERIFY_FAILURE 113 3230Sstevel@tonic-gate #define PKCS12_R_PARSE_ERROR 114 3240Sstevel@tonic-gate #define PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR 115 3250Sstevel@tonic-gate #define PKCS12_R_PKCS12_CIPHERFINAL_ERROR 116 3260Sstevel@tonic-gate #define PKCS12_R_PKCS12_PBE_CRYPT_ERROR 117 3270Sstevel@tonic-gate #define PKCS12_R_UNKNOWN_DIGEST_ALGORITHM 118 3280Sstevel@tonic-gate #define PKCS12_R_UNSUPPORTED_PKCS12_MODE 119 3290Sstevel@tonic-gate 3300Sstevel@tonic-gate #ifdef __cplusplus 3310Sstevel@tonic-gate } 3320Sstevel@tonic-gate #endif 3330Sstevel@tonic-gate #endif 334