PolarSSL v1.1.4
pem.h
Go to the documentation of this file.
00001 
00027 #ifndef POLARSSL_PEM_H
00028 #define POLARSSL_PEM_H
00029 
00030 #include <string.h>
00031 
00038 #define POLARSSL_ERR_PEM_NO_HEADER_PRESENT                 -0x1080  
00039 #define POLARSSL_ERR_PEM_INVALID_DATA                      -0x1100  
00040 #define POLARSSL_ERR_PEM_MALLOC_FAILED                     -0x1180  
00041 #define POLARSSL_ERR_PEM_INVALID_ENC_IV                    -0x1200  
00042 #define POLARSSL_ERR_PEM_UNKNOWN_ENC_ALG                   -0x1280  
00043 #define POLARSSL_ERR_PEM_PASSWORD_REQUIRED                 -0x1300  
00044 #define POLARSSL_ERR_PEM_PASSWORD_MISMATCH                 -0x1380  
00045 #define POLARSSL_ERR_PEM_FEATURE_UNAVAILABLE               -0x1400  
00046 /* \} name */
00047 
00051 typedef struct
00052 {
00053     unsigned char *buf;     
00054     size_t buflen;          
00055     unsigned char *info;    
00056 }
00057 pem_context;
00058 
00059 #ifdef __cplusplus
00060 extern "C" {
00061 #endif
00062 
00068 void pem_init( pem_context *ctx );
00069 
00084 int pem_read_buffer( pem_context *ctx, char *header, char *footer,
00085                      const unsigned char *data,
00086                      const unsigned char *pwd,
00087                      size_t pwdlen, size_t *use_len );
00088 
00094 void pem_free( pem_context *ctx );
00095 
00096 #ifdef __cplusplus
00097 }
00098 #endif
00099 
00100 #endif /* pem.h */