wolfSSL 3.11.1 for TLS1.3 beta
Fork of wolfSSL by
wolfssl/openssl/pem.h@13:80fb167dafdf, 2017-05-30 (annotated)
- Committer:
- wolfSSL
- Date:
- Tue May 30 06:16:19 2017 +0000
- Revision:
- 13:80fb167dafdf
- Parent:
- 11:cee25a834751
wolfSSL 3.11.1: TLS1.3 Beta
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wolfSSL | 11:cee25a834751 | 1 | /* pem.h for openssl */ |
wolfSSL | 11:cee25a834751 | 2 | |
wolfSSL | 11:cee25a834751 | 3 | |
wolfSSL | 11:cee25a834751 | 4 | #ifndef WOLFSSL_PEM_H_ |
wolfSSL | 11:cee25a834751 | 5 | #define WOLFSSL_PEM_H_ |
wolfSSL | 11:cee25a834751 | 6 | |
wolfSSL | 11:cee25a834751 | 7 | #include <wolfssl/openssl/evp.h> |
wolfSSL | 11:cee25a834751 | 8 | #include <wolfssl/openssl/bio.h> |
wolfSSL | 11:cee25a834751 | 9 | #include <wolfssl/openssl/rsa.h> |
wolfSSL | 11:cee25a834751 | 10 | #include <wolfssl/openssl/dsa.h> |
wolfSSL | 11:cee25a834751 | 11 | |
wolfSSL | 11:cee25a834751 | 12 | #ifdef __cplusplus |
wolfSSL | 11:cee25a834751 | 13 | extern "C" { |
wolfSSL | 11:cee25a834751 | 14 | #endif |
wolfSSL | 11:cee25a834751 | 15 | |
wolfSSL | 11:cee25a834751 | 16 | #define PEM_write_bio_PrivateKey wolfSSL_PEM_write_bio_PrivateKey |
wolfSSL | 11:cee25a834751 | 17 | |
wolfSSL | 11:cee25a834751 | 18 | /* RSA */ |
wolfSSL | 11:cee25a834751 | 19 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 20 | int wolfSSL_PEM_write_bio_RSAPrivateKey(WOLFSSL_BIO* bio, WOLFSSL_RSA* rsa, |
wolfSSL | 11:cee25a834751 | 21 | const EVP_CIPHER* cipher, |
wolfSSL | 11:cee25a834751 | 22 | unsigned char* passwd, int len, |
wolfSSL | 11:cee25a834751 | 23 | pem_password_cb* cb, void* arg); |
wolfSSL | 11:cee25a834751 | 24 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 25 | int wolfSSL_PEM_write_mem_RSAPrivateKey(RSA* rsa, const EVP_CIPHER* cipher, |
wolfSSL | 11:cee25a834751 | 26 | unsigned char* passwd, int len, |
wolfSSL | 11:cee25a834751 | 27 | unsigned char **pem, int *plen); |
wolfSSL | 11:cee25a834751 | 28 | #if !defined(NO_FILESYSTEM) |
wolfSSL | 11:cee25a834751 | 29 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 30 | int wolfSSL_PEM_write_RSAPrivateKey(FILE *fp, WOLFSSL_RSA *rsa, |
wolfSSL | 11:cee25a834751 | 31 | const EVP_CIPHER *enc, |
wolfSSL | 11:cee25a834751 | 32 | unsigned char *kstr, int klen, |
wolfSSL | 11:cee25a834751 | 33 | pem_password_cb *cb, void *u); |
wolfSSL | 11:cee25a834751 | 34 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 35 | WOLFSSL_RSA *wolfSSL_PEM_read_RSAPublicKey(FILE *fp, WOLFSSL_RSA **x, |
wolfSSL | 11:cee25a834751 | 36 | pem_password_cb *cb, void *u); |
wolfSSL | 11:cee25a834751 | 37 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 38 | int wolfSSL_PEM_write_RSAPublicKey(FILE *fp, WOLFSSL_RSA *x); |
wolfSSL | 11:cee25a834751 | 39 | |
wolfSSL | 11:cee25a834751 | 40 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 41 | int wolfSSL_PEM_write_RSA_PUBKEY(FILE *fp, WOLFSSL_RSA *x); |
wolfSSL | 11:cee25a834751 | 42 | #endif /* NO_FILESYSTEM */ |
wolfSSL | 11:cee25a834751 | 43 | |
wolfSSL | 11:cee25a834751 | 44 | /* DSA */ |
wolfSSL | 11:cee25a834751 | 45 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 46 | int wolfSSL_PEM_write_bio_DSAPrivateKey(WOLFSSL_BIO* bio, |
wolfSSL | 11:cee25a834751 | 47 | WOLFSSL_DSA* dsa, |
wolfSSL | 11:cee25a834751 | 48 | const EVP_CIPHER* cipher, |
wolfSSL | 11:cee25a834751 | 49 | unsigned char* passwd, int len, |
wolfSSL | 11:cee25a834751 | 50 | pem_password_cb* cb, void* arg); |
wolfSSL | 11:cee25a834751 | 51 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 52 | int wolfSSL_PEM_write_mem_DSAPrivateKey(WOLFSSL_DSA* dsa, |
wolfSSL | 11:cee25a834751 | 53 | const EVP_CIPHER* cipher, |
wolfSSL | 11:cee25a834751 | 54 | unsigned char* passwd, int len, |
wolfSSL | 11:cee25a834751 | 55 | unsigned char **pem, int *plen); |
wolfSSL | 11:cee25a834751 | 56 | #if !defined(NO_FILESYSTEM) |
wolfSSL | 11:cee25a834751 | 57 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 58 | int wolfSSL_PEM_write_DSAPrivateKey(FILE *fp, WOLFSSL_DSA *dsa, |
wolfSSL | 11:cee25a834751 | 59 | const EVP_CIPHER *enc, |
wolfSSL | 11:cee25a834751 | 60 | unsigned char *kstr, int klen, |
wolfSSL | 11:cee25a834751 | 61 | pem_password_cb *cb, void *u); |
wolfSSL | 11:cee25a834751 | 62 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 63 | int wolfSSL_PEM_write_DSA_PUBKEY(FILE *fp, WOLFSSL_DSA *x); |
wolfSSL | 11:cee25a834751 | 64 | #endif /* NO_FILESYSTEM */ |
wolfSSL | 11:cee25a834751 | 65 | |
wolfSSL | 11:cee25a834751 | 66 | /* ECC */ |
wolfSSL | 11:cee25a834751 | 67 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 68 | int wolfSSL_PEM_write_bio_ECPrivateKey(WOLFSSL_BIO* bio, WOLFSSL_EC_KEY* ec, |
wolfSSL | 11:cee25a834751 | 69 | const EVP_CIPHER* cipher, |
wolfSSL | 11:cee25a834751 | 70 | unsigned char* passwd, int len, |
wolfSSL | 11:cee25a834751 | 71 | pem_password_cb* cb, void* arg); |
wolfSSL | 11:cee25a834751 | 72 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 73 | int wolfSSL_PEM_write_mem_ECPrivateKey(WOLFSSL_EC_KEY* key, |
wolfSSL | 11:cee25a834751 | 74 | const EVP_CIPHER* cipher, |
wolfSSL | 11:cee25a834751 | 75 | unsigned char* passwd, int len, |
wolfSSL | 11:cee25a834751 | 76 | unsigned char **pem, int *plen); |
wolfSSL | 11:cee25a834751 | 77 | #if !defined(NO_FILESYSTEM) |
wolfSSL | 11:cee25a834751 | 78 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 79 | int wolfSSL_PEM_write_ECPrivateKey(FILE *fp, WOLFSSL_EC_KEY *key, |
wolfSSL | 11:cee25a834751 | 80 | const EVP_CIPHER *enc, |
wolfSSL | 11:cee25a834751 | 81 | unsigned char *kstr, int klen, |
wolfSSL | 11:cee25a834751 | 82 | pem_password_cb *cb, void *u); |
wolfSSL | 11:cee25a834751 | 83 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 84 | int wolfSSL_PEM_write_EC_PUBKEY(FILE *fp, WOLFSSL_EC_KEY *key); |
wolfSSL | 11:cee25a834751 | 85 | #endif /* NO_FILESYSTEM */ |
wolfSSL | 11:cee25a834751 | 86 | |
wolfSSL | 11:cee25a834751 | 87 | /* EVP_KEY */ |
wolfSSL | 11:cee25a834751 | 88 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 89 | WOLFSSL_EVP_PKEY* wolfSSL_PEM_read_bio_PrivateKey(WOLFSSL_BIO* bio, |
wolfSSL | 11:cee25a834751 | 90 | WOLFSSL_EVP_PKEY**, |
wolfSSL | 11:cee25a834751 | 91 | pem_password_cb* cb, |
wolfSSL | 11:cee25a834751 | 92 | void* arg); |
wolfSSL | 11:cee25a834751 | 93 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 94 | int wolfSSL_PEM_write_bio_PrivateKey(WOLFSSL_BIO* bio, WOLFSSL_EVP_PKEY* key, |
wolfSSL | 11:cee25a834751 | 95 | const WOLFSSL_EVP_CIPHER* cipher, |
wolfSSL | 11:cee25a834751 | 96 | unsigned char* passwd, int len, |
wolfSSL | 11:cee25a834751 | 97 | pem_password_cb* cb, void* arg); |
wolfSSL | 11:cee25a834751 | 98 | |
wolfSSL | 11:cee25a834751 | 99 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 100 | int wolfSSL_EVP_PKEY_type(int type); |
wolfSSL | 11:cee25a834751 | 101 | |
wolfSSL | 11:cee25a834751 | 102 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 103 | int wolfSSL_EVP_PKEY_base_id(const EVP_PKEY *pkey); |
wolfSSL | 11:cee25a834751 | 104 | |
wolfSSL | 11:cee25a834751 | 105 | #if !defined(NO_FILESYSTEM) |
wolfSSL | 11:cee25a834751 | 106 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 107 | WOLFSSL_EVP_PKEY *wolfSSL_PEM_read_PUBKEY(FILE *fp, EVP_PKEY **x, |
wolfSSL | 11:cee25a834751 | 108 | pem_password_cb *cb, void *u); |
wolfSSL | 11:cee25a834751 | 109 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 110 | WOLFSSL_X509 *wolfSSL_PEM_read_X509(FILE *fp, WOLFSSL_X509 **x, |
wolfSSL | 11:cee25a834751 | 111 | pem_password_cb *cb, void *u); |
wolfSSL | 11:cee25a834751 | 112 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 113 | WOLFSSL_EVP_PKEY *wolfSSL_PEM_read_PrivateKey(FILE *fp, WOLFSSL_EVP_PKEY **x, |
wolfSSL | 11:cee25a834751 | 114 | pem_password_cb *cb, void *u); |
wolfSSL | 11:cee25a834751 | 115 | #endif /* NO_FILESYSTEM */ |
wolfSSL | 11:cee25a834751 | 116 | |
wolfSSL | 11:cee25a834751 | 117 | #define PEM_read_X509 wolfSSL_PEM_read_X509 |
wolfSSL | 11:cee25a834751 | 118 | #define PEM_read_PrivateKey wolfSSL_PEM_read_PrivateKey |
wolfSSL | 11:cee25a834751 | 119 | #define PEM_write_bio_PrivateKey wolfSSL_PEM_write_bio_PrivateKey |
wolfSSL | 11:cee25a834751 | 120 | /* RSA */ |
wolfSSL | 11:cee25a834751 | 121 | #define PEM_write_bio_RSAPrivateKey wolfSSL_PEM_write_bio_RSAPrivateKey |
wolfSSL | 11:cee25a834751 | 122 | #define PEM_write_RSAPrivateKey wolfSSL_PEM_write_RSAPrivateKey |
wolfSSL | 11:cee25a834751 | 123 | #define PEM_write_RSA_PUBKEY wolfSSL_PEM_write_RSA_PUBKEY |
wolfSSL | 11:cee25a834751 | 124 | #define PEM_write_RSAPublicKey wolfSSL_PEM_write_RSAPublicKey |
wolfSSL | 11:cee25a834751 | 125 | #define PEM_read_RSAPublicKey wolfSSL_PEM_read_RSAPublicKey |
wolfSSL | 11:cee25a834751 | 126 | /* DSA */ |
wolfSSL | 11:cee25a834751 | 127 | #define PEM_write_bio_DSAPrivateKey wolfSSL_PEM_write_bio_DSAPrivateKey |
wolfSSL | 11:cee25a834751 | 128 | #define PEM_write_DSAPrivateKey wolfSSL_PEM_write_DSAPrivateKey |
wolfSSL | 11:cee25a834751 | 129 | #define PEM_write_DSA_PUBKEY wolfSSL_PEM_write_DSA_PUBKEY |
wolfSSL | 11:cee25a834751 | 130 | /* ECC */ |
wolfSSL | 11:cee25a834751 | 131 | #define PEM_write_bio_ECPrivateKey wolfSSL_PEM_write_bio_ECPrivateKey |
wolfSSL | 11:cee25a834751 | 132 | #define PEM_write_EC_PUBKEY wolfSSL_PEM_write_EC_PUBKEY |
wolfSSL | 11:cee25a834751 | 133 | #define PEM_write_ECPrivateKey wolfSSL_PEM_write_ECPrivateKey |
wolfSSL | 11:cee25a834751 | 134 | /* EVP_KEY */ |
wolfSSL | 11:cee25a834751 | 135 | #define PEM_read_bio_PrivateKey wolfSSL_PEM_read_bio_PrivateKey |
wolfSSL | 11:cee25a834751 | 136 | #define PEM_read_PUBKEY wolfSSL_PEM_read_PUBKEY |
wolfSSL | 11:cee25a834751 | 137 | #define EVP_PKEY_type wolfSSL_EVP_PKEY_type |
wolfSSL | 11:cee25a834751 | 138 | |
wolfSSL | 11:cee25a834751 | 139 | #ifdef __cplusplus |
wolfSSL | 11:cee25a834751 | 140 | } /* extern "C" */ |
wolfSSL | 11:cee25a834751 | 141 | #endif |
wolfSSL | 11:cee25a834751 | 142 | |
wolfSSL | 11:cee25a834751 | 143 | #endif /* WOLFSSL_PEM_H_ */ |
wolfSSL | 11:cee25a834751 | 144 | |
wolfSSL | 11:cee25a834751 | 145 |