PolarSSL v1.1.5
pkcs11.h
Go to the documentation of this file.
1 
29 #ifndef POLARSSL_PKCS11_H
30 #define POLARSSL_PKCS11_H
31 
32 #include "config.h"
33 
34 #if defined(POLARSSL_PKCS11_C)
35 
36 #include "x509.h"
37 
38 #include <pkcs11-helper-1.0/pkcs11h-certificate.h>
39 
43 typedef struct {
44  pkcs11h_certificate_t pkcs11h_cert;
45  int len;
46 } pkcs11_context;
47 
56 int pkcs11_x509_cert_init( x509_cert *cert, pkcs11h_certificate_t pkcs11h_cert );
57 
68 int pkcs11_priv_key_init( pkcs11_context *priv_key,
69  pkcs11h_certificate_t pkcs11_cert );
70 
77 void pkcs11_priv_key_free( pkcs11_context *priv_key );
78 
95 int pkcs11_decrypt( pkcs11_context *ctx,
96  int mode, size_t *olen,
97  const unsigned char *input,
98  unsigned char *output,
99  unsigned int output_max_len );
100 
117 int pkcs11_sign( pkcs11_context *ctx,
118  int mode,
119  int hash_id,
120  unsigned int hashlen,
121  const unsigned char *hash,
122  unsigned char *sig );
123 
124 #endif /* POLARSSL_PKCS11_C */
125 
126 #endif /* POLARSSL_PKCS11_H */