Make EVP_PKEY_ASN1_METHOD opaque. Add application level functions to
[openssl.git] / crypto / evp / evp.h
index 3f90b175c720549387d1ed39ef92a1ed6c9f73fb..ab2a1e593f0f3370f6bb9e362dcd82780ec951ca 100644 (file)
@@ -128,6 +128,7 @@ struct evp_pkey_st
        int type;
        int save_type;
        int references;
+       const EVP_PKEY_ASN1_METHOD *ameth;
        union   {
                char *ptr;
 #ifndef OPENSSL_NO_RSA
@@ -818,6 +819,13 @@ int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b);
 
 int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b);
 
+int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey,
+                               int indent, ASN1_PCTX *pctx);
+int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey,
+                               int indent, ASN1_PCTX *pctx);
+int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey,
+                               int indent, ASN1_PCTX *pctx);
+
 int EVP_CIPHER_type(const EVP_CIPHER *ctx);
 
 /* calls methods */
@@ -847,6 +855,8 @@ int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md,
                    EVP_PBE_KEYGEN *keygen);
 void EVP_PBE_cleanup(void);
 
+const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(int type);
+
 /* BEGIN ERROR CODES */
 /* 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.
@@ -873,6 +883,7 @@ void ERR_load_EVP_strings(void);
 #define EVP_F_EVP_PBE_ALG_ADD                           115
 #define EVP_F_EVP_PBE_CIPHERINIT                        116
 #define EVP_F_EVP_PKCS82PKEY                            111
+#define EVP_F_EVP_PKCS82PKEY_BROKEN                     136
 #define EVP_F_EVP_PKEY2PKCS8_BROKEN                     113
 #define EVP_F_EVP_PKEY_COPY_PARAMETERS                  103
 #define EVP_F_EVP_PKEY_DECRYPT                          104
@@ -918,6 +929,7 @@ void ERR_load_EVP_strings(void);
 #define EVP_R_INVALID_KEY_LENGTH                        130
 #define EVP_R_IV_TOO_LARGE                              102
 #define EVP_R_KEYGEN_FAILURE                            120
+#define EVP_R_METHOD_NOT_SUPPORTED                      144
 #define EVP_R_MISSING_PARAMETERS                        103
 #define EVP_R_NO_CIPHER_SET                             131
 #define EVP_R_NO_DIGEST_SET                             139
@@ -925,6 +937,8 @@ void ERR_load_EVP_strings(void);
 #define EVP_R_NO_SIGN_FUNCTION_CONFIGURED               104
 #define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED             105
 #define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE                         117
+#define EVP_R_PRIVATE_KEY_DECODE_ERROR                  145
+#define EVP_R_PRIVATE_KEY_ENCODE_ERROR                  146
 #define EVP_R_PUBLIC_KEY_NOT_RSA                        106
 #define EVP_R_UNKNOWN_PBE_ALGORITHM                     121
 #define EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS               135