summaryrefslogtreecommitdiff
path: root/lib/pkcs11_int.h
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2015-10-16 13:03:57 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2015-10-16 15:58:33 +0200
commit1c07fda247f1bb570cde745981b049f495678aac (patch)
treeed98d124a79b7b72e747fc772312a451eb9da6a2 /lib/pkcs11_int.h
parent5ecb418ee5c53b4f235dacbb085f2ba4d1396dfc (diff)
downloadgnutls-1c07fda247f1bb570cde745981b049f495678aac.tar.gz
pkcs11: introduced gnutls_pkcs11_copy_pubkey
That allows copying a public key to a PKCS #11 module.
Diffstat (limited to 'lib/pkcs11_int.h')
-rw-r--r--lib/pkcs11_int.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/pkcs11_int.h b/lib/pkcs11_int.h
index f2ccfe200c..811b2eb266 100644
--- a/lib/pkcs11_int.h
+++ b/lib/pkcs11_int.h
@@ -173,7 +173,17 @@ static inline int pk_to_mech(gnutls_pk_algorithm_t pk)
return CKM_RSA_PKCS;
}
-static inline gnutls_pk_algorithm_t mech_to_pk(ck_key_type_t m)
+static inline int pk_to_key_type(gnutls_pk_algorithm_t pk)
+{
+ if (pk == GNUTLS_PK_DSA)
+ return CKK_DSA;
+ else if (pk == GNUTLS_PK_EC)
+ return CKK_ECDSA;
+ else
+ return CKK_RSA;
+}
+
+static inline gnutls_pk_algorithm_t key_type_to_pk(ck_key_type_t m)
{
if (m == CKK_RSA)
return GNUTLS_PK_RSA;