24 #ifndef MBEDTLS_PKCS11_H
25 #define MBEDTLS_PKCS11_H
27 #if !defined(MBEDTLS_CONFIG_FILE)
30 #include MBEDTLS_CONFIG_FILE
33 #if defined(MBEDTLS_PKCS11_C)
37 #include <pkcs11-helper-1.0/pkcs11h-certificate.h>
39 #if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
40 !defined(inline) && !defined(__cplusplus)
41 #define inline __inline
48 #if defined(MBEDTLS_DEPRECATED_REMOVED)
59 #if defined(MBEDTLS_DEPRECATED_WARNING)
60 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
62 #define MBEDTLS_DEPRECATED
86 pkcs11h_certificate_t pkcs11h_cert );
103 pkcs11h_certificate_t pkcs11_cert );
138 int mode,
size_t *olen,
139 const unsigned char *input,
140 unsigned char *output,
141 size_t output_max_len );
165 unsigned int hashlen,
166 const unsigned char *hash,
167 unsigned char *sig );
176 int mode,
size_t *olen,
177 const unsigned char *input,
unsigned char *output,
178 size_t output_max_len )
211 int (*f_rng)(
void *,
unsigned char *,
size_t),
void *p_rng,
213 const unsigned char *hash,
unsigned char *sig )
218 hashlen, hash, sig );
236 #undef MBEDTLS_DEPRECATED
MBEDTLS_DEPRECATED int mbedtls_pkcs11_x509_cert_bind(mbedtls_x509_crt *cert, pkcs11h_certificate_t pkcs11h_cert)
MBEDTLS_DEPRECATED void mbedtls_pkcs11_init(mbedtls_pkcs11_context *ctx)
static MBEDTLS_DEPRECATED int mbedtls_ssl_pkcs11_decrypt(void *ctx, int mode, size_t *olen, const unsigned char *input, unsigned char *output, size_t output_max_len)
Configuration options (set of defines)
#define MBEDTLS_DEPRECATED
MBEDTLS_DEPRECATED int mbedtls_pkcs11_decrypt(mbedtls_pkcs11_context *ctx, int mode, size_t *olen, const unsigned char *input, unsigned char *output, size_t output_max_len)
Do an RSA private key decrypt, then remove the message padding.
MBEDTLS_DEPRECATED int mbedtls_pkcs11_sign(mbedtls_pkcs11_context *ctx, int mode, mbedtls_md_type_t md_alg, unsigned int hashlen, const unsigned char *hash, unsigned char *sig)
Do a private RSA to sign a message digest.
static MBEDTLS_DEPRECATED size_t mbedtls_ssl_pkcs11_key_len(void *ctx)
X.509 certificate parsing and writing.
MBEDTLS_DEPRECATED int mbedtls_pkcs11_priv_key_bind(mbedtls_pkcs11_context *priv_key, pkcs11h_certificate_t pkcs11_cert)
pkcs11h_certificate_t pkcs11h_cert
static MBEDTLS_DEPRECATED int mbedtls_ssl_pkcs11_sign(void *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, mbedtls_md_type_t md_alg, unsigned int hashlen, const unsigned char *hash, unsigned char *sig)
This function signs a message digest using RSA.
MBEDTLS_DEPRECATED void mbedtls_pkcs11_priv_key_free(mbedtls_pkcs11_context *priv_key)
mbedtls_md_type_t
Supported message digests.
struct mbedtls_pkcs11_context mbedtls_pkcs11_context