PolarSSL v1.3.9
pkcs12.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_PKCS12_H
28 #define POLARSSL_PKCS12_H
29 
30 #include <string.h>
31 
32 #include "md.h"
33 #include "cipher.h"
34 #include "asn1.h"
35 
36 #define POLARSSL_ERR_PKCS12_BAD_INPUT_DATA -0x1F80
37 #define POLARSSL_ERR_PKCS12_FEATURE_UNAVAILABLE -0x1F00
38 #define POLARSSL_ERR_PKCS12_PBE_INVALID_FORMAT -0x1E80
39 #define POLARSSL_ERR_PKCS12_PASSWORD_MISMATCH -0x1E00
41 #define PKCS12_DERIVE_KEY 1
42 #define PKCS12_DERIVE_IV 2
43 #define PKCS12_DERIVE_MAC_KEY 3
45 #define PKCS12_PBE_DECRYPT 0
46 #define PKCS12_PBE_ENCRYPT 1
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
66 int pkcs12_pbe_sha1_rc4_128( asn1_buf *pbe_params, int mode,
67  const unsigned char *pwd, size_t pwdlen,
68  const unsigned char *input, size_t len,
69  unsigned char *output );
70 
87 int pkcs12_pbe( asn1_buf *pbe_params, int mode,
88  cipher_type_t cipher_type, md_type_t md_type,
89  const unsigned char *pwd, size_t pwdlen,
90  const unsigned char *input, size_t len,
91  unsigned char *output );
92 
114 int pkcs12_derivation( unsigned char *data, size_t datalen,
115  const unsigned char *pwd, size_t pwdlen,
116  const unsigned char *salt, size_t saltlen,
117  md_type_t md, int id, int iterations );
118 
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 #endif /* pkcs12.h */