source: UsbWattMeter/trunk/wolfssl-3.7.0/wolfssl/openssl/pem.h@ 164

Last change on this file since 164 was 164, checked in by coas-nagasima, 6 years ago

TOPPERS/ECNLサンプルアプリ「USB充電器電力計」を追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-chdr
File size: 4.9 KB
Line 
1/* pem.h for openssl */
2
3
4#ifndef WOLFSSL_PEM_H_
5#define WOLFSSL_PEM_H_
6
7#include <wolfssl/openssl/evp.h>
8#include <wolfssl/openssl/bio.h>
9#include <wolfssl/openssl/rsa.h>
10#include <wolfssl/openssl/dsa.h>
11
12#ifdef __cplusplus
13 extern "C" {
14#endif
15
16
17/* RSA */
18WOLFSSL_API
19int wolfSSL_PEM_write_bio_RSAPrivateKey(WOLFSSL_BIO* bio, WOLFSSL_RSA* rsa,
20 const EVP_CIPHER* cipher,
21 unsigned char* passwd, int len,
22 pem_password_cb cb, void* arg);
23WOLFSSL_API
24int wolfSSL_PEM_write_mem_RSAPrivateKey(RSA* rsa, const EVP_CIPHER* cipher,
25 unsigned char* passwd, int len,
26 unsigned char **pem, int *plen);
27#if !defined(NO_FILESYSTEM)
28WOLFSSL_API
29int wolfSSL_PEM_write_RSAPrivateKey(XFILE fp, WOLFSSL_RSA *rsa,
30 const EVP_CIPHER *enc,
31 unsigned char *kstr, int klen,
32 pem_password_cb *cb, void *u);
33WOLFSSL_API
34WOLFSSL_RSA *wolfSSL_PEM_read_RSAPublicKey(XFILE fp, WOLFSSL_RSA **x,
35 pem_password_cb *cb, void *u);
36WOLFSSL_API
37int wolfSSL_PEM_write_RSAPublicKey(XFILE fp, WOLFSSL_RSA *x);
38
39WOLFSSL_API
40int wolfSSL_PEM_write_RSA_PUBKEY(XFILE fp, WOLFSSL_RSA *x);
41#endif /* NO_FILESYSTEM */
42
43/* DSA */
44WOLFSSL_API
45int wolfSSL_PEM_write_bio_DSAPrivateKey(WOLFSSL_BIO* bio,
46 WOLFSSL_DSA* dsa,
47 const EVP_CIPHER* cipher,
48 unsigned char* passwd, int len,
49 pem_password_cb cb, void* arg);
50WOLFSSL_API
51int wolfSSL_PEM_write_mem_DSAPrivateKey(WOLFSSL_DSA* dsa,
52 const EVP_CIPHER* cipher,
53 unsigned char* passwd, int len,
54 unsigned char **pem, int *plen);
55#if !defined(NO_FILESYSTEM)
56WOLFSSL_API
57int wolfSSL_PEM_write_DSAPrivateKey(XFILE fp, WOLFSSL_DSA *dsa,
58 const EVP_CIPHER *enc,
59 unsigned char *kstr, int klen,
60 pem_password_cb *cb, void *u);
61WOLFSSL_API
62int wolfSSL_PEM_write_DSA_PUBKEY(XFILE fp, WOLFSSL_DSA *x);
63#endif /* NO_FILESYSTEM */
64
65/* ECC */
66WOLFSSL_API
67int wolfSSL_PEM_write_bio_ECPrivateKey(WOLFSSL_BIO* bio, WOLFSSL_EC_KEY* ec,
68 const EVP_CIPHER* cipher,
69 unsigned char* passwd, int len,
70 pem_password_cb cb, void* arg);
71WOLFSSL_API
72int wolfSSL_PEM_write_mem_ECPrivateKey(WOLFSSL_EC_KEY* key,
73 const EVP_CIPHER* cipher,
74 unsigned char* passwd, int len,
75 unsigned char **pem, int *plen);
76#if !defined(NO_FILESYSTEM)
77WOLFSSL_API
78int wolfSSL_PEM_write_ECPrivateKey(XFILE fp, WOLFSSL_EC_KEY *key,
79 const EVP_CIPHER *enc,
80 unsigned char *kstr, int klen,
81 pem_password_cb *cb, void *u);
82WOLFSSL_API
83int wolfSSL_PEM_write_EC_PUBKEY(XFILE fp, WOLFSSL_EC_KEY *key);
84#endif /* NO_FILESYSTEM */
85
86/* EVP_KEY */
87WOLFSSL_API
88WOLFSSL_EVP_PKEY* wolfSSL_PEM_read_bio_PrivateKey(WOLFSSL_BIO* bio,
89 WOLFSSL_EVP_PKEY**,
90 pem_password_cb cb,
91 void* arg);
92WOLFSSL_API
93int wolfSSL_EVP_PKEY_type(int type);
94
95#if !defined(NO_FILESYSTEM)
96WOLFSSL_API
97WOLFSSL_EVP_PKEY *wolfSSL_PEM_read_PUBKEY(XFILE fp, EVP_PKEY **x,
98 pem_password_cb *cb, void *u);
99#endif /* NO_FILESYSTEM */
100
101/* RSA */
102#define PEM_write_bio_RSAPrivateKey wolfSSL_PEM_write_bio_RSAPrivateKey
103#define PEM_write_RSAPrivateKey wolfSSL_PEM_write_RSAPrivateKey
104#define PEM_write_RSA_PUBKEY wolfSSL_PEM_write_RSA_PUBKEY
105#define PEM_write_RSAPublicKey wolfSSL_PEM_write_RSAPublicKey
106#define PEM_read_RSAPublicKey wolfSSL_PEM_read_RSAPublicKey
107/* DSA */
108#define PEM_write_bio_DSAPrivateKey wolfSSL_PEM_write_bio_DSAPrivateKey
109#define PEM_write_DSAPrivateKey wolfSSL_PEM_write_DSAPrivateKey
110#define PEM_write_DSA_PUBKEY wolfSSL_PEM_write_DSA_PUBKEY
111/* ECC */
112#define PEM_write_bio_ECPrivateKey wolfSSL_PEM_write_bio_ECPrivateKey
113#define PEM_write_EC_PUBKEY wolfSSL_PEM_write_EC_PUBKEY
114#define PEM_write_ECPrivateKey wolfSSL_PEM_write_ECPrivateKey
115/* EVP_KEY */
116#define PEM_read_bio_PrivateKey wolfSSL_PEM_read_bio_PrivateKey
117#define PEM_read_PUBKEY wolfSSL_PEM_read_PUBKEY
118#define EVP_PKEY_type wolfSSL_EVP_PKEY_type
119
120#ifdef __cplusplus
121 } /* extern "C" */
122#endif
123
124#endif /* WOLFSSL_PEM_H_ */
125
Note: See TracBrowser for help on using the repository browser.