70#define PEM_BUFSIZE 1024
72#define PEM_OBJ_UNDEF 0
74#define PEM_OBJ_X509_REQ 2
76#define PEM_OBJ_SSL_SESSION 4
77#define PEM_OBJ_PRIV_KEY 10
78#define PEM_OBJ_PRIV_RSA 11
79#define PEM_OBJ_PRIV_DSA 12
80#define PEM_OBJ_PRIV_DH 13
81#define PEM_OBJ_PUB_RSA 14
82#define PEM_OBJ_PUB_DSA 15
83#define PEM_OBJ_PUB_DH 16
84#define PEM_OBJ_DHPARAMS 17
85#define PEM_OBJ_DSAPARAMS 18
86#define PEM_OBJ_PRIV_RSA_PUBLIC 19
89#define PEM_DEK_DES_CBC 40
90#define PEM_DEK_IDEA_CBC 45
91#define PEM_DEK_DES_EDE 50
92#define PEM_DEK_DES_ECB 60
94#define PEM_DEK_RSA_MD2 80
95#define PEM_DEK_RSA_MD5 90
97#define PEM_MD_MD2 NID_md2
98#define PEM_MD_MD5 NID_md5
99#define PEM_MD_SHA NID_sha
100#define PEM_MD_MD2_RSA NID_md2WithRSAEncryption
101#define PEM_MD_MD5_RSA NID_md5WithRSAEncryption
102#define PEM_MD_SHA_RSA NID_sha1WithRSAEncryption
104#define PEM_STRING_X509_OLD "X509 CERTIFICATE"
105#define PEM_STRING_X509 "CERTIFICATE"
106#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE"
107#define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST"
108#define PEM_STRING_X509_REQ "CERTIFICATE REQUEST"
109#define PEM_STRING_X509_CRL "X509 CRL"
110#define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY"
111#define PEM_STRING_PUBLIC "PUBLIC KEY"
112#define PEM_STRING_RSA "RSA PRIVATE KEY"
113#define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY"
114#define PEM_STRING_DSA "DSA PRIVATE KEY"
115#define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY"
116#define PEM_STRING_PKCS7 "PKCS7"
117#define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY"
118#define PEM_STRING_PKCS8INF "PRIVATE KEY"
119#define PEM_STRING_DHPARAMS "DH PARAMETERS"
120#define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS"
121#define PEM_STRING_DSAPARAMS "DSA PARAMETERS"
132#define PEM_TYPE_ENCRYPTED 10
133#define PEM_TYPE_MIC_ONLY 20
134#define PEM_TYPE_MIC_CLEAR 30
135#define PEM_TYPE_CLEAR 40
197#define IMPLEMENT_PEM_read_fp(name, type, str, asn1)
198#define IMPLEMENT_PEM_write_fp(name, type, str, asn1)
199#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)
203#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \
204type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\
206return((type *)PEM_ASN1_read((char *(*)())d2i_##asn1, str,fp,(char **)x,\
210#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \
211int PEM_write_##name(FILE *fp, type *x) \
213return(PEM_ASN1_write((int (*)())i2d_##asn1,str,fp, (char *)x, \
214 NULL,NULL,0,NULL,NULL)); \
217#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \
218int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
219 unsigned char *kstr, int klen, pem_password_cb *cb, \
222 return(PEM_ASN1_write((int (*)())i2d_##asn1,str,fp, \
223 (char *)x,enc,kstr,klen,cb,u)); \
228#define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
229type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\
231return((type *)PEM_ASN1_read_bio((char *(*)())d2i_##asn1, str,bp,\
235#define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
236int PEM_write_bio_##name(BIO *bp, type *x) \
238return(PEM_ASN1_write_bio((int (*)())i2d_##asn1,str,bp, (char *)x, \
239 NULL,NULL,0,NULL,NULL)); \
242#define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
243int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
244 unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \
246 return(PEM_ASN1_write_bio((int (*)())i2d_##asn1,str,bp, \
247 (char *)x,enc,kstr,klen,cb,u)); \
250#define IMPLEMENT_PEM_write(name, type, str, asn1) \
251 IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
252 IMPLEMENT_PEM_write_fp(name, type, str, asn1)
254#define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \
255 IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
256 IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)
258#define IMPLEMENT_PEM_read(name, type, str, asn1) \
259 IMPLEMENT_PEM_read_bio(name, type, str, asn1) \
260 IMPLEMENT_PEM_read_fp(name, type, str, asn1)
262#define IMPLEMENT_PEM_rw(name, type, str, asn1) \
263 IMPLEMENT_PEM_read(name, type, str, asn1) \
264 IMPLEMENT_PEM_write(name, type, str, asn1)
266#define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \
267 IMPLEMENT_PEM_read(name, type, str, asn1) \
268 IMPLEMENT_PEM_write_cb(name, type, str, asn1)
272#if defined(WIN16) || defined(NO_FP_API)
274#define DECLARE_PEM_read_fp(name, type)
275#define DECLARE_PEM_write_fp(name, type)
276#define DECLARE_PEM_write_cb_fp(name, type)
280#define DECLARE_PEM_read_fp(name, type) \
281 type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u);
283#define DECLARE_PEM_write_fp(name, type) \
284 int PEM_write_##name(FILE *fp, type *x);
286#define DECLARE_PEM_write_cb_fp(name, type) \
287 int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
288 unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
293#define DECLARE_PEM_read_bio(name, type) \
294 type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u);
296#define DECLARE_PEM_write_bio(name, type) \
297 int PEM_write_bio_##name(BIO *bp, type *x);
299#define DECLARE_PEM_write_cb_bio(name, type) \
300 int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
301 unsigned char *kstr, int klen, pem_password_cb *cb, void *u);
305#define DECLARE_PEM_read_bio(name, type)
306#define DECLARE_PEM_write_bio(name, type)
307#define DECLARE_PEM_write_cb_bio(name, type)
311#define DECLARE_PEM_write(name, type) \
312 DECLARE_PEM_write_bio(name, type) \
313 DECLARE_PEM_write_fp(name, type)
315#define DECLARE_PEM_write_cb(name, type) \
316 DECLARE_PEM_write_cb_bio(name, type) \
317 DECLARE_PEM_write_cb_fp(name, type)
319#define DECLARE_PEM_read(name, type) \
320 DECLARE_PEM_read_bio(name, type) \
321 DECLARE_PEM_read_fp(name, type)
323#define DECLARE_PEM_rw(name, type) \
324 DECLARE_PEM_read(name, type) \
325 DECLARE_PEM_write(name, type)
327#define DECLARE_PEM_rw_cb(name, type) \
328 DECLARE_PEM_read(name, type) \
329 DECLARE_PEM_write_cb(name, type)
333#define PEM_write_SSL_SESSION(fp,x) \
334 PEM_ASN1_write((int (*)())i2d_SSL_SESSION, \
335 PEM_STRING_SSL_SESSION,fp, (char *)x, NULL,NULL,0,NULL,NULL)
336#define PEM_write_X509(fp,x) \
337 PEM_ASN1_write((int (*)())i2d_X509,PEM_STRING_X509,fp, \
338 (char *)x, NULL,NULL,0,NULL,NULL)
339#define PEM_write_X509_REQ(fp,x) PEM_ASN1_write( \
340 (int (*)())i2d_X509_REQ,PEM_STRING_X509_REQ,fp,(char *)x, \
341 NULL,NULL,0,NULL,NULL)
342#define PEM_write_X509_CRL(fp,x) \
343 PEM_ASN1_write((int (*)())i2d_X509_CRL,PEM_STRING_X509_CRL, \
344 fp,(char *)x, NULL,NULL,0,NULL,NULL)
345#define PEM_write_RSAPrivateKey(fp,x,enc,kstr,klen,cb,u) \
346 PEM_ASN1_write((int (*)())i2d_RSAPrivateKey,PEM_STRING_RSA,fp,\
347 (char *)x,enc,kstr,klen,cb,u)
348#define PEM_write_RSAPublicKey(fp,x) \
349 PEM_ASN1_write((int (*)())i2d_RSAPublicKey,\
350 PEM_STRING_RSA_PUBLIC,fp,(char *)x,NULL,NULL,0,NULL,NULL)
351#define PEM_write_DSAPrivateKey(fp,x,enc,kstr,klen,cb,u) \
352 PEM_ASN1_write((int (*)())i2d_DSAPrivateKey,PEM_STRING_DSA,fp,\
353 (char *)x,enc,kstr,klen,cb,u)
354#define PEM_write_PrivateKey(bp,x,enc,kstr,klen,cb,u) \
355 PEM_ASN1_write((int (*)())i2d_PrivateKey,\
356 (((x)->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA),\
357 bp,(char *)x,enc,kstr,klen,cb,u)
358#define PEM_write_PKCS7(fp,x) \
359 PEM_ASN1_write((int (*)())i2d_PKCS7,PEM_STRING_PKCS7,fp, \
360 (char *)x, NULL,NULL,0,NULL,NULL)
361#define PEM_write_DHparams(fp,x) \
362 PEM_ASN1_write((int (*)())i2d_DHparams,PEM_STRING_DHPARAMS,fp,\
363 (char *)x,NULL,NULL,0,NULL,NULL)
365#define PEM_write_NETSCAPE_CERT_SEQUENCE(fp,x) \
366 PEM_ASN1_write((int (*)())i2d_NETSCAPE_CERT_SEQUENCE, \
367 PEM_STRING_X509,fp, \
368 (char *)x, NULL,NULL,0,NULL,NULL)
370#define PEM_read_SSL_SESSION(fp,x,cb,u) (SSL_SESSION *)PEM_ASN1_read( \
371 (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,fp,(char **)x,cb,u)
372#define PEM_read_X509(fp,x,cb,u) (X509 *)PEM_ASN1_read( \
373 (char *(*)())d2i_X509,PEM_STRING_X509,fp,(char **)x,cb,u)
374#define PEM_read_X509_REQ(fp,x,cb,u) (X509_REQ *)PEM_ASN1_read( \
375 (char *(*)())d2i_X509_REQ,PEM_STRING_X509_REQ,fp,(char **)x,cb,u)
376#define PEM_read_X509_CRL(fp,x,cb,u) (X509_CRL *)PEM_ASN1_read( \
377 (char *(*)())d2i_X509_CRL,PEM_STRING_X509_CRL,fp,(char **)x,cb,u)
378#define PEM_read_RSAPrivateKey(fp,x,cb,u) (RSA *)PEM_ASN1_read( \
379 (char *(*)())d2i_RSAPrivateKey,PEM_STRING_RSA,fp,(char **)x,cb,u)
380#define PEM_read_RSAPublicKey(fp,x,cb,u) (RSA *)PEM_ASN1_read( \
381 (char *(*)())d2i_RSAPublicKey,PEM_STRING_RSA_PUBLIC,fp,(char **)x,cb,u)
382#define PEM_read_DSAPrivateKey(fp,x,cb,u) (DSA *)PEM_ASN1_read( \
383 (char *(*)())d2i_DSAPrivateKey,PEM_STRING_DSA,fp,(char **)x,cb,u)
384#define PEM_read_PrivateKey(fp,x,cb,u) (EVP_PKEY *)PEM_ASN1_read( \
385 (char *(*)())d2i_PrivateKey,PEM_STRING_EVP_PKEY,fp,(char **)x,cb,u)
386#define PEM_read_PKCS7(fp,x,cb,u) (PKCS7 *)PEM_ASN1_read( \
387 (char *(*)())d2i_PKCS7,PEM_STRING_PKCS7,fp,(char **)x,cb,u)
388#define PEM_read_DHparams(fp,x,cb,u) (DH *)PEM_ASN1_read( \
389 (char *(*)())d2i_DHparams,PEM_STRING_DHPARAMS,fp,(char **)x,cb,u)
391#define PEM_read_NETSCAPE_CERT_SEQUENCE(fp,x,cb,u) \
392 (NETSCAPE_CERT_SEQUENCE *)PEM_ASN1_read( \
393 (char *(*)())d2i_NETSCAPE_CERT_SEQUENCE,PEM_STRING_X509,fp,\
396#define PEM_write_bio_SSL_SESSION(bp,x) \
397 PEM_ASN1_write_bio((int (*)())i2d_SSL_SESSION, \
398 PEM_STRING_SSL_SESSION,bp, (char *)x, NULL,NULL,0,NULL,NULL)
399#define PEM_write_bio_X509(bp,x) \
400 PEM_ASN1_write_bio((int (*)())i2d_X509,PEM_STRING_X509,bp, \
401 (char *)x, NULL,NULL,0,NULL,NULL)
402#define PEM_write_bio_X509_REQ(bp,x) PEM_ASN1_write_bio( \
403 (int (*)())i2d_X509_REQ,PEM_STRING_X509_REQ,bp,(char *)x, \
404 NULL,NULL,0,NULL,NULL)
405#define PEM_write_bio_X509_CRL(bp,x) \
406 PEM_ASN1_write_bio((int (*)())i2d_X509_CRL,PEM_STRING_X509_CRL,\
407 bp,(char *)x, NULL,NULL,0,NULL,NULL)
408#define PEM_write_bio_RSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \
409 PEM_ASN1_write_bio((int (*)())i2d_RSAPrivateKey,PEM_STRING_RSA,\
410 bp,(char *)x,enc,kstr,klen,cb,u)
411#define PEM_write_bio_RSAPublicKey(bp,x) \
412 PEM_ASN1_write_bio((int (*)())i2d_RSAPublicKey, \
413 PEM_STRING_RSA_PUBLIC,\
414 bp,(char *)x,NULL,NULL,0,NULL,NULL)
415#define PEM_write_bio_DSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \
416 PEM_ASN1_write_bio((int (*)())i2d_DSAPrivateKey,PEM_STRING_DSA,\
417 bp,(char *)x,enc,kstr,klen,cb,u)
418#define PEM_write_bio_PrivateKey(bp,x,enc,kstr,klen,cb,u) \
419 PEM_ASN1_write_bio((int (*)())i2d_PrivateKey,\
420 (((x)->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA),\
421 bp,(char *)x,enc,kstr,klen,cb,u)
422#define PEM_write_bio_PKCS7(bp,x) \
423 PEM_ASN1_write_bio((int (*)())i2d_PKCS7,PEM_STRING_PKCS7,bp, \
424 (char *)x, NULL,NULL,0,NULL,NULL)
425#define PEM_write_bio_DHparams(bp,x) \
426 PEM_ASN1_write_bio((int (*)())i2d_DHparams,PEM_STRING_DHPARAMS,\
427 bp,(char *)x,NULL,NULL,0,NULL,NULL)
428#define PEM_write_bio_DSAparams(bp,x) \
429 PEM_ASN1_write_bio((int (*)())i2d_DSAparams, \
430 PEM_STRING_DSAPARAMS,bp,(char *)x,NULL,NULL,0,NULL,NULL)
432#define PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp,x) \
433 PEM_ASN1_write_bio((int (*)())i2d_NETSCAPE_CERT_SEQUENCE, \
434 PEM_STRING_X509,bp, \
435 (char *)x, NULL,NULL,0,NULL,NULL)
437#define PEM_read_bio_SSL_SESSION(bp,x,cb,u) (SSL_SESSION *)PEM_ASN1_read_bio( \
438 (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,bp,(char **)x,cb,u)
439#define PEM_read_bio_X509(bp,x,cb,u) (X509 *)PEM_ASN1_read_bio( \
440 (char *(*)())d2i_X509,PEM_STRING_X509,bp,(char **)x,cb,u)
441#define PEM_read_bio_X509_REQ(bp,x,cb,u) (X509_REQ *)PEM_ASN1_read_bio( \
442 (char *(*)())d2i_X509_REQ,PEM_STRING_X509_REQ,bp,(char **)x,cb,u)
443#define PEM_read_bio_X509_CRL(bp,x,cb,u) (X509_CRL *)PEM_ASN1_read_bio( \
444 (char *(*)())d2i_X509_CRL,PEM_STRING_X509_CRL,bp,(char **)x,cb,u)
445#define PEM_read_bio_RSAPrivateKey(bp,x,cb,u) (RSA *)PEM_ASN1_read_bio( \
446 (char *(*)())d2i_RSAPrivateKey,PEM_STRING_RSA,bp,(char **)x,cb,u)
447#define PEM_read_bio_RSAPublicKey(bp,x,cb,u) (RSA *)PEM_ASN1_read_bio( \
448 (char *(*)())d2i_RSAPublicKey,PEM_STRING_RSA_PUBLIC,bp,(char **)x,cb,u)
449#define PEM_read_bio_DSAPrivateKey(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \
450 (char *(*)())d2i_DSAPrivateKey,PEM_STRING_DSA,bp,(char **)x,cb,u)
451#define PEM_read_bio_PrivateKey(bp,x,cb,u) (EVP_PKEY *)PEM_ASN1_read_bio( \
452 (char *(*)())d2i_PrivateKey,PEM_STRING_EVP_PKEY,bp,(char **)x,cb,u)
454#define PEM_read_bio_PKCS7(bp,x,cb,u) (PKCS7 *)PEM_ASN1_read_bio( \
455 (char *(*)())d2i_PKCS7,PEM_STRING_PKCS7,bp,(char **)x,cb,u)
456#define PEM_read_bio_DHparams(bp,x,cb,u) (DH *)PEM_ASN1_read_bio( \
457 (char *(*)())d2i_DHparams,PEM_STRING_DHPARAMS,bp,(char **)x,cb,u)
458#define PEM_read_bio_DSAparams(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \
459 (char *(*)())d2i_DSAparams,PEM_STRING_DSAPARAMS,bp,(char **)x,cb,u)
461#define PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp,x,cb,u) \
462 (NETSCAPE_CERT_SEQUENCE *)PEM_ASN1_read_bio( \
463 (char *(*)())d2i_NETSCAPE_CERT_SEQUENCE,PEM_STRING_X509,bp,\
481int PEM_read_bio(
BIO *bp,
char **name,
char **header,
482 unsigned char **data,
long *len);
483int PEM_write_bio(
BIO *bp,
const char *name,
char *hdr,
unsigned char *data,
485char * PEM_ASN1_read_bio(
char *(*d2i)(),
const char *name,
BIO *bp,
char **x,
487int PEM_ASN1_write_bio(
int (*i2d)(),
const char *name,
BIO *bp,
char *x,
488 const EVP_CIPHER *enc,
unsigned char *kstr,
int klen,
491int PEM_X509_INFO_write_bio(
BIO *bp,X509_INFO *xi,
EVP_CIPHER *enc,
511 EVP_MD *md_type,
unsigned char **ek,
int *ekl,
512 unsigned char *iv,
EVP_PKEY **pubk,
int npubk);
514 unsigned char *in,
int inl);
516 unsigned char *out,
int *outl,
EVP_PKEY *priv);
521 unsigned int *siglen,
EVP_PKEY *pkey);
531#include "vms_idhacks.h"
581 char *kstr,
int klen,
586 char *kstr,
int klen,
589 char *kstr,
int klen,
620#define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 120
621#define PEM_F_D2I_PKCS8PRIVATEKEY_FP 121
622#define PEM_F_DEF_CALLBACK 100
623#define PEM_F_LOAD_IV 101
624#define PEM_F_PEM_ASN1_READ 102
625#define PEM_F_PEM_ASN1_READ_BIO 103
626#define PEM_F_PEM_ASN1_WRITE 104
627#define PEM_F_PEM_ASN1_WRITE_BIO 105
628#define PEM_F_PEM_DO_HEADER 106
629#define PEM_F_PEM_F_DO_PK8KEY_FP 122
630#define PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY 118
631#define PEM_F_PEM_GET_EVP_CIPHER_INFO 107
632#define PEM_F_PEM_READ 108
633#define PEM_F_PEM_READ_BIO 109
634#define PEM_F_PEM_SEALFINAL 110
635#define PEM_F_PEM_SEALINIT 111
636#define PEM_F_PEM_SIGNFINAL 112
637#define PEM_F_PEM_WRITE 113
638#define PEM_F_PEM_WRITE_BIO 114
639#define PEM_F_PEM_WRITE_BIO_PKCS8PRIVATEKEY 119
640#define PEM_F_PEM_X509_INFO_READ 115
641#define PEM_F_PEM_X509_INFO_READ_BIO 116
642#define PEM_F_PEM_X509_INFO_WRITE_BIO 117
645#define PEM_R_BAD_BASE64_DECODE 100
646#define PEM_R_BAD_DECRYPT 101
647#define PEM_R_BAD_END_LINE 102
648#define PEM_R_BAD_IV_CHARS 103
649#define PEM_R_BAD_PASSWORD_READ 104
650#define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115
651#define PEM_R_NOT_DEK_INFO 105
652#define PEM_R_NOT_ENCRYPTED 106
653#define PEM_R_NOT_PROC_TYPE 107
654#define PEM_R_NO_START_LINE 108
655#define PEM_R_PROBLEMS_GETTING_PASSWORD 109
656#define PEM_R_PUBLIC_KEY_NO_RSA 110
657#define PEM_R_READ_KEY 111
658#define PEM_R_SHORT_HEADER 112
659#define PEM_R_UNSUPPORTED_CIPHER 113
660#define PEM_R_UNSUPPORTED_ENCRYPTION 114
EVP_PKEY * d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u)
int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u)
struct pem_ctx_st::@10 DEK_info
int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher)
struct pem_ctx_st::@9 proc_type
void PEM_proc_type(char *buf, int type)
void ERR_load_PEM_strings(void)
int pem_password_cb(char *buf, int size, int rwflag, void *userdata)
int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u)
int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig, int *sigl, unsigned char *out, int *outl, EVP_PKEY *priv)
struct PEM_Encode_Seal_st PEM_ENCODE_SEAL_CTX
int PEM_write_bio_PKCS8PrivateKey(BIO *, EVP_PKEY *, const EVP_CIPHER *, char *, int, pem_password_cb *, void *)
#define DECLARE_PEM_rw(name, type)
void PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *d, unsigned int cnt)
void PEM_dek_info(char *buf, const char *type, int len, char *str)
int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type, unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk, int npubk)
void PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl, unsigned char *in, int inl)
int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *len, pem_password_cb *callback, void *u)
#define DECLARE_PEM_rw_cb(name, type)
#define DECLARE_PEM_write(name, type)
int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, EVP_PKEY *pkey)
struct pem_recip_st PEM_USER
struct pem_ctx_st PEM_CTX
void PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type)
int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u)