Remove references to .org header file names.
[openssl.git] / crypto / pem / pem.h
index 55fbaef..2c279c6 100644 (file)
@@ -1,4 +1,4 @@
-/* crypto/pem/pem.org */
+/* crypto/pem/pem.h */
 /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
  * [including the GNU Public Licence.]
  */
 
-/* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 
- *
- * Always modify pem.org since pem.h is automatically generated from
- * it during SSLeay configuration.
- *
- * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
- */
-
 #ifndef HEADER_PEM_H
 #define HEADER_PEM_H
 
@@ -73,6 +65,7 @@ extern "C" {
 
 #include "evp.h"
 #include "x509.h"
+#include "pem2.h"
 
 #define PEM_OBJ_UNDEF          0
 #define PEM_OBJ_X509           1
@@ -120,36 +113,6 @@ extern "C" {
 #define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS"
 #define PEM_STRING_DSAPARAMS   "DSA PARAMETERS"
 
-#ifndef HEADER_ENVELOPE_H
-
-#define EVP_ENCODE_CTX_SIZE  96
-#define EVP_MD_SIZE  60
-#define EVP_MD_CTX_SIZE  152
-#define EVP_CIPHER_SIZE  40
-#define EVP_CIPHER_CTX_SIZE  4212
-#define EVP_MAX_MD_SIZE  20
-
-typedef struct evp_encode_ctx_st
-       {
-       char data[EVP_ENCODE_CTX_SIZE];
-       } EVP_ENCODE_CTX;
-
-typedef struct env_md_ctx_st
-       {
-       char data[EVP_MD_CTX_SIZE];
-       } EVP_MD_CTX;
-
-typedef struct evp_cipher_st
-       {
-       char data[EVP_CIPHER_SIZE];
-       } EVP_CIPHER;
-
-typedef struct evp_cipher_ctx_st
-       {
-       char data[EVP_CIPHER_CTX_SIZE];
-       } EVP_CIPHER_CTX;
-#endif
-
 
 typedef struct PEM_Encode_Seal_st
        {
@@ -251,6 +214,11 @@ typedef struct pem_ctx_st
                PEM_ASN1_write((int (*)())i2d_DHparams,PEM_STRING_DHPARAMS,fp,\
                        (char *)x,NULL,NULL,0,NULL)
 
+#define PEM_write_NETSCAPE_CERT_SEQUENCE(fp,x) \
+                PEM_ASN1_write((int (*)())i2d_NETSCAPE_CERT_SEQUENCE, \
+                       PEM_STRING_X509,fp, \
+                        (char *)x, NULL,NULL,0,NULL)
+
 #define        PEM_read_SSL_SESSION(fp,x,cb) (SSL_SESSION *)PEM_ASN1_read( \
        (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,fp,(char **)x,cb)
 #define        PEM_read_X509(fp,x,cb) (X509 *)PEM_ASN1_read( \
@@ -272,6 +240,11 @@ typedef struct pem_ctx_st
 #define        PEM_read_DHparams(fp,x,cb) (DH *)PEM_ASN1_read( \
        (char *(*)())d2i_DHparams,PEM_STRING_DHPARAMS,fp,(char **)x,cb)
 
+#define PEM_read_NETSCAPE_CERT_SEQUENCE(fp,x,cb) \
+               (NETSCAPE_CERT_SEQUENCE *)PEM_ASN1_read( \
+        (char *(*)())d2i_NETSCAPE_CERT_SEQUENCE,PEM_STRING_X509,fp,\
+                                                       (char **)x,cb)
+
 #define PEM_write_bio_SSL_SESSION(bp,x) \
                PEM_ASN1_write_bio((int (*)())i2d_SSL_SESSION, \
                        PEM_STRING_SSL_SESSION,bp, (char *)x, NULL,NULL,0,NULL)
@@ -308,6 +281,11 @@ typedef struct pem_ctx_st
                PEM_ASN1_write_bio((int (*)())i2d_DSAparams, \
                        PEM_STRING_DSAPARAMS,bp,(char *)x,NULL,NULL,0,NULL)
 
+#define PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp,x) \
+                PEM_ASN1_write_bio((int (*)())i2d_NETSCAPE_CERT_SEQUENCE, \
+                       PEM_STRING_X509,bp, \
+                        (char *)x, NULL,NULL,0,NULL)
+
 #define        PEM_read_bio_SSL_SESSION(bp,x,cb) (SSL_SESSION *)PEM_ASN1_read_bio( \
        (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,bp,(char **)x,cb)
 #define        PEM_read_bio_X509(bp,x,cb) (X509 *)PEM_ASN1_read_bio( \
@@ -332,6 +310,11 @@ typedef struct pem_ctx_st
 #define        PEM_read_bio_DSAparams(bp,x,cb) (DSA *)PEM_ASN1_read_bio( \
        (char *(*)())d2i_DSAparams,PEM_STRING_DSAPARAMS,bp,(char **)x,cb)
 
+#define PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp,x,cb) \
+               (NETSCAPE_CERT_SEQUENCE *)PEM_ASN1_read_bio( \
+        (char *(*)())d2i_NETSCAPE_CERT_SEQUENCE,PEM_STRING_X509,bp,\
+                                                       (char **)x,cb)
+
 #endif
 
 #ifndef NOPROTO
@@ -342,12 +325,13 @@ int       PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data,long *len,
 #ifdef HEADER_BIO_H
 int    PEM_read_bio(BIO *bp, char **name, char **header,
                unsigned char **data,long *len);
-int    PEM_write_bio(BIO *bp,char *name,char *hdr,unsigned char *data,
+int    PEM_write_bio(BIO *bp,const char *name,char *hdr,unsigned char *data,
                long len);
-char * PEM_ASN1_read_bio(char *(*d2i)(),char *name,BIO *bp,char **x,
+char * PEM_ASN1_read_bio(char *(*d2i)(),const char *name,BIO *bp,char **x,
                int (*cb)());
-int    PEM_ASN1_write_bio(int (*i2d)(),char *name,BIO *bp,char *x,
-               EVP_CIPHER *enc,unsigned char *kstr,int klen,int (*callback)());
+int    PEM_ASN1_write_bio(int (*i2d)(),const char *name,BIO *bp,char *x,
+                          const EVP_CIPHER *enc,unsigned char *kstr,int klen,
+                          int (*callback)());
 STACK *        PEM_X509_INFO_read_bio(BIO *bp, STACK *sk, int (*cb)());
 int    PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc,
                unsigned char *kstr, int klen, int (*cb)());
@@ -357,10 +341,11 @@ int       PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc,
 int    PEM_read(FILE *fp, char **name, char **header,
                unsigned char **data,long *len);
 int    PEM_write(FILE *fp,char *name,char *hdr,unsigned char *data,long len);
-char * PEM_ASN1_read(char *(*d2i)(),char *name,FILE *fp,char **x,
+char * PEM_ASN1_read(char *(*d2i)(),const char *name,FILE *fp,char **x,
                int (*cb)());
-int    PEM_ASN1_write(int (*i2d)(),char *name,FILE *fp,char *x,
-               EVP_CIPHER *enc,unsigned char *kstr,int klen,int (*callback)());
+int    PEM_ASN1_write(int (*i2d)(),const char *name,FILE *fp,char *x,
+                      const EVP_CIPHER *enc,unsigned char *kstr,int klen,
+                      int (*callback)());
 STACK *        PEM_X509_INFO_read(FILE *fp, STACK *sk, int (*cb)());
 #endif
 
@@ -377,10 +362,8 @@ void    PEM_SignUpdate(EVP_MD_CTX *ctx,unsigned char *d,unsigned int cnt);
 int    PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
                unsigned int *siglen, EVP_PKEY *pkey);
 
-void   ERR_load_PEM_strings(void);
-
 void   PEM_proc_type(char *buf, int type);
-void   PEM_dek_info(char *buf, char *type, int len, char *str);
+void   PEM_dek_info(char *buf, const char *type, int len, char *str);
 
 #ifndef SSLEAY_MACROS
 
@@ -395,19 +378,22 @@ EVP_PKEY *PEM_read_PrivateKey(FILE *fp,EVP_PKEY **x,int (*cb)());
 PKCS7 *PEM_read_PKCS7(FILE *fp,PKCS7 **x,int (*cb)());
 DH *PEM_read_DHparams(FILE *fp,DH **x,int (*cb)());
 DSA *PEM_read_DSAparams(FILE *fp,DSA **x,int (*cb)());
+NETSCAPE_CERT_SEQUENCE *PEM_read_NETSCAPE_CERT_SEQUENCE(FILE *fp,NETSCAPE_CERT_SEQUENCE **x,int (*cb)());
 int PEM_write_X509(FILE *fp,X509 *x);
 int PEM_write_X509_REQ(FILE *fp,X509_REQ *x);
 int PEM_write_X509_CRL(FILE *fp,X509_CRL *x);
 int PEM_write_RSAPrivateKey(FILE *fp,RSA *x,EVP_CIPHER *enc,unsigned char *kstr,
         int klen,int (*cb)());
 int PEM_write_RSAPublicKey(FILE *fp,RSA *x);
-int PEM_write_DSAPrivateKey(FILE *fp,DSA *x,EVP_CIPHER *enc,unsigned char *kstr,
+int PEM_write_DSAPrivateKey(FILE *fp,DSA *x,const EVP_CIPHER *enc,
+                           unsigned char *kstr,
         int klen,int (*cb)());
 int PEM_write_PrivateKey(FILE *fp,EVP_PKEY *x,EVP_CIPHER *enc,
        unsigned char *kstr,int klen,int (*cb)());
 int PEM_write_PKCS7(FILE *fp,PKCS7 *x);
 int PEM_write_DHparams(FILE *fp,DH *x);
 int PEM_write_DSAparams(FILE *fp,DSA *x);
+int PEM_write_NETSCAPE_CERT_SEQUENCE(FILE *fp,NETSCAPE_CERT_SEQUENCE *x);
 #endif
 
 #ifdef HEADER_BIO_H
@@ -420,20 +406,22 @@ DSA *PEM_read_bio_DSAPrivateKey(BIO *bp,DSA **x,int (*cb)());
 EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp,EVP_PKEY **x,int (*cb)());
 PKCS7 *PEM_read_bio_PKCS7(BIO *bp,PKCS7 **x,int (*cb)());
 DH *PEM_read_bio_DHparams(BIO *bp,DH **x,int (*cb)());
+NETSCAPE_CERT_SEQUENCE *PEM_read_bio_NETSCAPE_CERT_SEQUENCE(BIO *bp,NETSCAPE_CERT_SEQUENCE **x,int (*cb)());
 DSA *PEM_read_bio_DSAparams(BIO *bp,DSA **x,int (*cb)());
 int PEM_write_bio_X509(BIO *bp,X509 *x);
 int PEM_write_bio_X509_REQ(BIO *bp,X509_REQ *x);
 int PEM_write_bio_X509_CRL(BIO *bp,X509_CRL *x);
-int PEM_write_bio_RSAPrivateKey(BIO *fp,RSA *x,EVP_CIPHER *enc,
+int PEM_write_bio_RSAPrivateKey(BIO *fp,RSA *x,const EVP_CIPHER *enc,
         unsigned char *kstr,int klen,int (*cb)());
 int PEM_write_bio_RSAPublicKey(BIO *fp,RSA *x);
-int PEM_write_bio_DSAPrivateKey(BIO *fp,DSA *x,EVP_CIPHER *enc,
+int PEM_write_bio_DSAPrivateKey(BIO *fp,DSA *x,const EVP_CIPHER *enc,
         unsigned char *kstr,int klen,int (*cb)());
 int PEM_write_bio_PrivateKey(BIO *fp,EVP_PKEY *x,EVP_CIPHER *enc,
         unsigned char *kstr,int klen,int (*cb)());
 int PEM_write_bio_PKCS7(BIO *bp,PKCS7 *x);
 int PEM_write_bio_DHparams(BIO *bp,DH *x);
 int PEM_write_bio_DSAparams(BIO *bp,DSA *x);
+int PEM_write_bio_NETSCAPE_CERT_SEQUENCE(BIO *bp,NETSCAPE_CERT_SEQUENCE *x);
 #endif
 
 #endif /* SSLEAY_MACROS */
@@ -459,6 +447,8 @@ int PEM_ASN1_write_bio();
 int    PEM_SealInit();
 void   PEM_SealUpdate();
 int    PEM_SealFinal();
+void    PEM_SignInit();
+void    PEM_SignUpdate();
 int    PEM_SignFinal();
 
 void   ERR_load_PEM_strings();
@@ -478,6 +468,7 @@ EVP_PKEY *PEM_read_PrivateKey();
 PKCS7 *PEM_read_PKCS7();
 DH *PEM_read_DHparams();
 DSA *PEM_read_DSAparams();
+NETSCAPE_CERT_SEQUENCE *PEM_read_NETSCAPE_CERT_SEQUENCE();
 int PEM_write_X509();
 int PEM_write_X509_REQ();
 int PEM_write_X509_CRL();
@@ -488,6 +479,7 @@ int PEM_write_PrivateKey();
 int PEM_write_PKCS7();
 int PEM_write_DHparams();
 int PEM_write_DSAparams();
+int PEM_write_NETSCAPE_CERT_SEQUENCE();
 #endif
 
 X509 *PEM_read_bio_X509();
@@ -500,6 +492,7 @@ EVP_PKEY *PEM_read_bio_PrivateKey();
 PKCS7 *PEM_read_bio_PKCS7();
 DH *PEM_read_bio_DHparams();
 DSA *PEM_read_bio_DSAparams();
+NETSCAPE_CERT_SEQUENCE *PEM_read_bio_NETSCAPE_CERT_SEQUENCE();
 int PEM_write_bio_X509();
 int PEM_write_bio_X509_REQ();
 int PEM_write_bio_X509_CRL();
@@ -510,6 +503,7 @@ int PEM_write_bio_PrivateKey();
 int PEM_write_bio_PKCS7();
 int PEM_write_bio_DHparams();
 int PEM_write_bio_DSAparams();
+int PEM_write_bio_NETSCAPE_CERT_SEQUENCE();
 
 #endif /* SSLEAY_MACROS */