Implemented private key on top of a PKCS#11 token

This commit is contained in:
Martin Willi
2010-08-04 09:26:20 +02:00
parent d007ce3206
commit 5f1e4438cb
4 changed files with 427 additions and 0 deletions
@@ -22,6 +22,7 @@
#include "pkcs11_manager.h"
#include "pkcs11_creds.h"
#include "pkcs11_private_key.h"
typedef struct private_pkcs11_plugin_t private_pkcs11_plugin_t;
@@ -103,6 +104,8 @@ METHOD(plugin_t, destroy, void,
{
pkcs11_creds_t *creds;
lib->creds->remove_builder(lib->creds,
(builder_function_t)pkcs11_private_key_connect);
while (this->creds->remove_last(this->creds, (void**)&creds) == SUCCESS)
{
lib->credmgr->remove_set(lib->credmgr, &creds->set);
@@ -129,5 +132,8 @@ plugin_t *pkcs11_plugin_create()
this->manager = pkcs11_manager_create((void*)token_event_cb, this);
lib->creds->add_builder(lib->creds, CRED_PRIVATE_KEY, KEY_ANY,
(builder_function_t)pkcs11_private_key_connect);
return &this->public.plugin;
}