diff options
author | Stef Walter <stef@memberwebs.com> | 2009-01-10 13:58:15 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2009-01-10 13:58:15 +0000 |
commit | f8c4c268f745985322126cf99a51ac227a432dc8 (patch) | |
tree | 778a4afd3a55f3964e7d3ffff99dcfe0af54321c /src/dsa.c | |
parent | 1220a0745cb8674e5ce0506a1ad298fe08b0f745 (diff) |
Test creation of session keys.
Diffstat (limited to 'src/dsa.c')
-rw-r--r-- | src/dsa.c | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -199,3 +199,35 @@ p11t_dsa_tests(void) { p11t_slot_for_each_mech(CKM_DSA, test_dsa); } + +void +p11t_dsa_test_public_key(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE handle) +{ + CK_MECHANISM_TYPE_PTR mechanisms; + CK_ULONG n_mechanisms, i; + + mechanisms = p11t_key_get_mechanisms (session, handle, &n_mechanisms); + if (!mechanisms) + return; + + for (i = 0; i < n_mechanisms; ++i) + test_dsa_public_key (session, handle, mechanisms[i]); + + free (mechanisms); +} + +void +p11t_dsa_test_private_key(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE handle) +{ + CK_MECHANISM_TYPE_PTR mechanisms; + CK_ULONG n_mechanisms, i; + + mechanisms = p11t_key_get_mechanisms (session, handle, &n_mechanisms); + if (!mechanisms) + return; + + for (i = 0; i < n_mechanisms; ++i) + test_dsa_private_key (session, handle, mechanisms[i]); + + free (mechanisms); +} |