- Support for PKCS#11 through the use of the pkcs11-helper library
diff --git a/include/polarssl/ssl.h b/include/polarssl/ssl.h
index 7ddf7b1..a4d3af0 100644
--- a/include/polarssl/ssl.h
+++ b/include/polarssl/ssl.h
@@ -35,6 +35,11 @@
#include "polarssl/md5.h"
#include "polarssl/sha1.h"
#include "polarssl/x509.h"
+#include "polarssl/config.h"
+
+#if defined(POLARSSL_PKCS11_C)
+#include "polarssl/pkcs11.h"
+#endif
/*
* SSL Error codes
@@ -268,6 +273,9 @@
* PKI layer
*/
rsa_context *rsa_key; /*!< own RSA private key */
+#if defined(POLARSSL_PKCS11_C)
+ pkcs11_context *pkcs11_key; /*!< own PKCS#11 RSA private key */
+#endif
x509_cert *own_cert; /*!< own X.509 certificate */
x509_cert *ca_chain; /*!< own trusted CA chain */
x509_crl *ca_crl; /*!< trusted CA CRLs */
@@ -480,6 +488,18 @@
void ssl_set_own_cert( ssl_context *ssl, x509_cert *own_cert,
rsa_context *rsa_key );
+#if defined(POLARSSL_PKCS11_C)
+/**
+ * \brief Set own certificate and PKCS#11 private key
+ *
+ * \param ssl SSL context
+ * \param own_cert own public certificate
+ * \param pkcs11_key own PKCS#11 RSA key
+ */
+void ssl_set_own_cert_pkcs11( ssl_context *ssl, x509_cert *own_cert,
+ pkcs11_context *pkcs11_key );
+#endif
+
/**
* \brief Set the Diffie-Hellman public P and G values,
* read as hexadecimal strings (server-side only)