PolarSSL v1.2.5
pem.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_PEM_H
28 #define POLARSSL_PEM_H
29 
30 #include <string.h>
31 
38 #define POLARSSL_ERR_PEM_NO_HEADER_PRESENT -0x1080
39 #define POLARSSL_ERR_PEM_INVALID_DATA -0x1100
40 #define POLARSSL_ERR_PEM_MALLOC_FAILED -0x1180
41 #define POLARSSL_ERR_PEM_INVALID_ENC_IV -0x1200
42 #define POLARSSL_ERR_PEM_UNKNOWN_ENC_ALG -0x1280
43 #define POLARSSL_ERR_PEM_PASSWORD_REQUIRED -0x1300
44 #define POLARSSL_ERR_PEM_PASSWORD_MISMATCH -0x1380
45 #define POLARSSL_ERR_PEM_FEATURE_UNAVAILABLE -0x1400
46 /* \} name */
47 
51 typedef struct
52 {
53  unsigned char *buf;
54  size_t buflen;
55  unsigned char *info;
56 }
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
68 void pem_init( pem_context *ctx );
69 
84 int pem_read_buffer( pem_context *ctx, char *header, char *footer,
85  const unsigned char *data,
86  const unsigned char *pwd,
87  size_t pwdlen, size_t *use_len );
88 
94 void pem_free( pem_context *ctx );
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #endif /* pem.h */