Typo.
[openssl.git] / crypto / pkcs12 / pkcs12.h
index 611762777dcf713845ec7e63eec02acee1516baf..b17eb9f42b8e70fbd9c94a390e8dc3b2d725ad34 100644 (file)
@@ -1,5 +1,5 @@
 /* pkcs12.h */
-/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
+/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
  * project 1999.
  */
 /* ====================================================================
@@ -108,8 +108,6 @@ PKCS12_MAC_DATA *mac;
 PKCS7 *authsafes;
 } PKCS12;
 
-PREDECLARE_STACK_OF(PKCS12_SAFEBAG)
-
 typedef struct {
 ASN1_OBJECT *type;
 union {
@@ -156,8 +154,8 @@ union {
 #define M_PKCS12_decrypt_skey PKCS12_decrypt_skey
 #define M_PKCS8_decrypt PKCS8_decrypt
 
-#define M_PKCS12_bag_type(bag) OBJ_obj2nid(bag->type)
-#define M_PKCS12_cert_bag_type(bag) OBJ_obj2nid(bag->value.bag->type)
+#define M_PKCS12_bag_type(bg) OBJ_obj2nid((bg)->type)
+#define M_PKCS12_cert_bag_type(bg) OBJ_obj2nid((bg)->value.bag->type)
 #define M_PKCS12_crl_bag_type M_PKCS12_cert_bag_type
 
 #define PKCS12_get_attr(bag, attr_nid) \
@@ -232,8 +230,8 @@ int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
                   const EVP_MD *md_type);
 int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt,
                                         int saltlen, const EVP_MD *md_type);
-unsigned char *asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen);
-char *uni2asc(unsigned char *uni, int unilen);
+unsigned char *OPENSSL_asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen);
+char *OPENSSL_uni2asc(unsigned char *uni, int unilen);
 
 DECLARE_ASN1_FUNCTIONS(PKCS12)
 DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA)
@@ -243,13 +241,21 @@ DECLARE_ASN1_FUNCTIONS(PKCS12_BAGS)
 DECLARE_ASN1_ITEM(PKCS12_SAFEBAGS)
 DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES)
 
-void ERR_load_PKCS12_strings(void);
 void PKCS12_PBE_add(void);
 int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
                 STACK_OF(X509) **ca);
 PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
                         STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter,
                                                 int mac_iter, int keytype);
+
+PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert);
+PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, EVP_PKEY *key,
+                                               int key_usage, int iter,
+                                               int key_nid, char *pass);
+int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,
+                                       int safe_nid, int iter, char *pass);
+PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid);
+
 int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12);
 int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12);
 PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12);
@@ -260,20 +266,23 @@ int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass);
 /* The following lines are auto generated by the script mkerr.pl. Any changes
  * made after this point may be overwritten when the script is next run.
  */
+void ERR_load_PKCS12_strings(void);
 
 /* Error codes for the PKCS12 functions. */
 
 /* Function codes. */
+#define PKCS12_F_PARSE_BAG                              129
 #define PKCS12_F_PARSE_BAGS                             103
 #define PKCS12_F_PKCS12_ADD_FRIENDLYNAME                100
 #define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_ASC            127
 #define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI            102
 #define PKCS12_F_PKCS12_ADD_LOCALKEYID                  104
 #define PKCS12_F_PKCS12_CREATE                          105
-#define PKCS12_F_PKCS12_DECRYPT_D2I                     106
 #define PKCS12_F_PKCS12_GEN_MAC                                 107
-#define PKCS12_F_PKCS12_I2D_ENCRYPT                     108
 #define PKCS12_F_PKCS12_INIT                            109
+#define PKCS12_F_PKCS12_ITEM_DECRYPT_D2I                106
+#define PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT                108
+#define PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG               117
 #define PKCS12_F_PKCS12_KEY_GEN_ASC                     110
 #define PKCS12_F_PKCS12_KEY_GEN_UNI                     111
 #define PKCS12_F_PKCS12_MAKE_KEYBAG                     112
@@ -281,18 +290,20 @@ int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass);
 #define PKCS12_F_PKCS12_NEWPASS                                 128
 #define PKCS12_F_PKCS12_PACK_P7DATA                     114
 #define PKCS12_F_PKCS12_PACK_P7ENCDATA                  115
-#define PKCS12_F_PKCS12_PACK_SAFEBAG                    117
 #define PKCS12_F_PKCS12_PARSE                           118
 #define PKCS12_F_PKCS12_PBE_CRYPT                       119
 #define PKCS12_F_PKCS12_PBE_KEYIVGEN                    120
 #define PKCS12_F_PKCS12_SETUP_MAC                       122
 #define PKCS12_F_PKCS12_SET_MAC                                 123
+#define PKCS12_F_PKCS12_UNPACK_AUTHSAFES                130
+#define PKCS12_F_PKCS12_UNPACK_P7DATA                   131
+#define PKCS12_F_PKCS12_VERIFY_MAC                      126
 #define PKCS12_F_PKCS8_ADD_KEYUSAGE                     124
 #define PKCS12_F_PKCS8_ENCRYPT                          125
-#define PKCS12_F_VERIFY_MAC                             126
 
 /* Reason codes. */
 #define PKCS12_R_CANT_PACK_STRUCTURE                    100
+#define PKCS12_R_CONTENT_TYPE_NOT_DATA                  121
 #define PKCS12_R_DECODE_ERROR                           101
 #define PKCS12_R_ENCODE_ERROR                           102
 #define PKCS12_R_ENCRYPT_ERROR                          103
@@ -318,4 +329,3 @@ int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass);
 }
 #endif
 #endif
-