RetroArch
pkcs12.h
Go to the documentation of this file.
1 
23 #ifndef MBEDTLS_PKCS12_H
24 #define MBEDTLS_PKCS12_H
25 
26 #include "md.h"
27 #include "cipher.h"
28 #include "asn1.h"
29 
30 #include <stddef.h>
31 
32 #define MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA -0x1F80
33 #define MBEDTLS_ERR_PKCS12_FEATURE_UNAVAILABLE -0x1F00
34 #define MBEDTLS_ERR_PKCS12_PBE_INVALID_FORMAT -0x1E80
35 #define MBEDTLS_ERR_PKCS12_PASSWORD_MISMATCH -0x1E00
37 #define MBEDTLS_PKCS12_DERIVE_KEY 1
38 #define MBEDTLS_PKCS12_DERIVE_IV 2
39 #define MBEDTLS_PKCS12_DERIVE_MAC_KEY 3
41 #define MBEDTLS_PKCS12_PBE_DECRYPT 0
42 #define MBEDTLS_PKCS12_PBE_ENCRYPT 1
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
63  const unsigned char *pwd, size_t pwdlen,
64  const unsigned char *input, size_t len,
65  unsigned char *output );
66 
83 int mbedtls_pkcs12_pbe( mbedtls_asn1_buf *pbe_params, int mode,
84  mbedtls_cipher_type_t cipher_type, mbedtls_md_type_t md_type,
85  const unsigned char *pwd, size_t pwdlen,
86  const unsigned char *input, size_t len,
87  unsigned char *output );
88 
110 int mbedtls_pkcs12_derivation( unsigned char *data, size_t datalen,
111  const unsigned char *pwd, size_t pwdlen,
112  const unsigned char *salt, size_t saltlen,
113  mbedtls_md_type_t mbedtls_md, int id, int iterations );
114 
115 #ifdef __cplusplus
116 }
117 #endif
118 
119 #endif /* pkcs12.h */
GLenum mode
Definition: glext.h:6857
int mbedtls_pkcs12_derivation(unsigned char *data, size_t datalen, const unsigned char *pwd, size_t pwdlen, const unsigned char *salt, size_t saltlen, mbedtls_md_type_t mbedtls_md, int id, int iterations)
The PKCS#12 derivation function uses a password and a salt to produce pseudo-random bits for a partic...
Definition: pkcs12.c:245
GLenum GLsizei len
Definition: glext.h:7389
Definition: ibxm.h:9
GLenum GLenum GLenum input
Definition: glext.h:9938
Definition: asn1.h:118
mbedtls_md_type_t
Definition: md.h:39
int mbedtls_pkcs12_pbe(mbedtls_asn1_buf *pbe_params, int mode, mbedtls_cipher_type_t cipher_type, mbedtls_md_type_t md_type, const unsigned char *pwd, size_t pwdlen, const unsigned char *input, size_t len, unsigned char *output)
PKCS12 Password Based function (encryption / decryption) for cipher-based and mbedtls_md-based PBE's.
Definition: pkcs12.c:173
int mbedtls_md(const mbedtls_md_info_t *md_info, const unsigned char *input, size_t ilen, unsigned char *output)
Output = message_digest( input buffer )
Definition: md.c:275
Generic message digest wrapper.
Generic cipher wrapper.
int mbedtls_pkcs12_pbe_sha1_rc4_128(mbedtls_asn1_buf *pbe_params, int mode, const unsigned char *pwd, size_t pwdlen, const unsigned char *input, size_t len, unsigned char *output)
PKCS12 Password Based function (encryption / decryption) for pbeWithSHAAnd128BitRC4.
Definition: pkcs12.c:132
std::string output
Definition: Config.FromFile.cpp:44
static const unsigned char salt[MAX_TESTS][40]
Definition: pkcs5.c:317
Generic ASN.1 parsing.
mbedtls_cipher_type_t
Definition: cipher.h:77