Export scheme_to_mechanism conversion function
authorMartin Willi <martin@revosec.ch>
Fri, 6 Aug 2010 15:02:01 +0000 (17:02 +0200)
committerMartin Willi <martin@revosec.ch>
Fri, 6 Aug 2010 15:02:01 +0000 (17:02 +0200)
src/libstrongswan/plugins/pkcs11/pkcs11_private_key.c
src/libstrongswan/plugins/pkcs11/pkcs11_private_key.h

index 1909988..80c0f00 100644 (file)
@@ -87,9 +87,9 @@ METHOD(private_key_t, get_keysize, size_t,
 }
 
 /**
- * Get the Cryptoki mechanism for a signature scheme
+ * See header.
  */
-static CK_MECHANISM_PTR scheme_to_mechanism(signature_scheme_t scheme)
+CK_MECHANISM_PTR pkcs11_scheme_to_mechanism(signature_scheme_t scheme)
 {
        static struct {
                signature_scheme_t scheme;
@@ -159,7 +159,7 @@ METHOD(private_key_t, sign, bool,
        CK_ULONG len;
        CK_RV rv;
 
-       mechanism = scheme_to_mechanism(scheme);
+       mechanism = pkcs11_scheme_to_mechanism(scheme);
        if (!mechanism)
        {
                DBG1(DBG_LIB, "signature scheme %N not supported",
index 86b04b7..921a027 100644 (file)
@@ -26,6 +26,8 @@ typedef struct pkcs11_private_key_t pkcs11_private_key_t;
 #include <credentials/builder.h>
 #include <credentials/keys/private_key.h>
 
+#include "pkcs11.h"
+
 /**
  * Private Key implementation on top of PKCS#11.
  */
@@ -48,4 +50,9 @@ struct pkcs11_private_key_t {
  */
 pkcs11_private_key_t *pkcs11_private_key_connect(key_type_t type, va_list args);
 
+/**
+ * Get the Cryptoki mechanism for a signature scheme.
+ */
+CK_MECHANISM_PTR pkcs11_scheme_to_mechanism(signature_scheme_t scheme);
+
 #endif /** PKCS11_PRIVATE_KEY_H_ @}*/