[gnutls-devel] [PATCH 1/2] pkcs11: add interface for C_GenerateKey

Jan Vcelak jan.vcelak at nic.cz
Thu Feb 25 15:21:29 CET 2016


Signed-off-by: Jan Vcelak <jan.vcelak at nic.cz>
---
 lib/pkcs11_int.c | 11 +++++++++++
 lib/pkcs11_int.h |  8 ++++++++
 2 files changed, 19 insertions(+)

diff --git a/lib/pkcs11_int.c b/lib/pkcs11_int.c
index a2277b8..e8517d5 100644
--- a/lib/pkcs11_int.c
+++ b/lib/pkcs11_int.c
@@ -185,6 +185,17 @@ pkcs11_sign(struct ck_function_list * module,
 }
 
 ck_rv_t
+pkcs11_generate_key(struct ck_function_list * module,
+		    ck_session_handle_t sess,
+		    struct ck_mechanism * mechanism,
+		    struct ck_attribute * templ,
+		    unsigned long count,
+		    ck_object_handle_t * key)
+{
+	return (module)->C_GenerateKey(sess, mechanism, templ, count, key);
+}
+
+ck_rv_t
 pkcs11_generate_key_pair(struct ck_function_list * module,
 			 ck_session_handle_t sess,
 			 struct ck_mechanism * mechanism,
diff --git a/lib/pkcs11_int.h b/lib/pkcs11_int.h
index 6c5f266..272e426 100644
--- a/lib/pkcs11_int.h
+++ b/lib/pkcs11_int.h
@@ -213,6 +213,14 @@ static inline int pk_to_genmech(gnutls_pk_algorithm_t pk, ck_key_type_t *type)
 ck_object_class_t pkcs11_type_to_class(gnutls_pkcs11_obj_type_t type);
 
 ck_rv_t
+pkcs11_generate_key(struct ck_function_list * module,
+		    ck_session_handle_t sess,
+		    struct ck_mechanism * mechanism,
+		    struct ck_attribute * templ,
+		    unsigned long count,
+		    ck_object_handle_t * key);
+
+ck_rv_t
 pkcs11_generate_key_pair(struct ck_function_list * module,
 			 ck_session_handle_t sess,
 			 struct ck_mechanism * mechanism,
-- 
2.5.0




More information about the Gnutls-devel mailing list