PolarSSL v1.2.10
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_FOOTER_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 #define POLARSSL_ERR_PEM_BAD_INPUT_DATA -0x1480
47 /* \} name */
48 
52 typedef struct
53 {
54  unsigned char *buf;
55  size_t buflen;
56  unsigned char *info;
57 }
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
69 void pem_init( pem_context *ctx );
70 
89 int pem_read_buffer( pem_context *ctx, char *header, char *footer,
90  const unsigned char *data,
91  const unsigned char *pwd,
92  size_t pwdlen, size_t *use_len );
93 
99 void pem_free( pem_context *ctx );
100 
101 #ifdef __cplusplus
102 }
103 #endif
104 
105 #endif /* pem.h */
unsigned char * info
Definition: pem.h:56
int pem_read_buffer(pem_context *ctx, char *header, char *footer, const unsigned char *data, const unsigned char *pwd, size_t pwdlen, size_t *use_len)
Read a buffer for PEM information and store the resulting data into the specified context buffers...
void pem_init(pem_context *ctx)
PEM context setup.
void pem_free(pem_context *ctx)
PEM context memory freeing.
PEM context structure.
Definition: pem.h:52
unsigned char * buf
Definition: pem.h:54
size_t buflen
Definition: pem.h:55