aboutsummaryrefslogtreecommitdiffstats
path: root/SoftHSMv2/src/lib/session_mgr/Session.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'SoftHSMv2/src/lib/session_mgr/Session.cpp')
-rw-r--r--SoftHSMv2/src/lib/session_mgr/Session.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/SoftHSMv2/src/lib/session_mgr/Session.cpp b/SoftHSMv2/src/lib/session_mgr/Session.cpp
index 5db36fd..54c0ff7 100644
--- a/SoftHSMv2/src/lib/session_mgr/Session.cpp
+++ b/SoftHSMv2/src/lib/session_mgr/Session.cpp
@@ -58,6 +58,9 @@ Session::Session(Slot* inSlot, bool inIsReadWrite, CK_VOID_PTR inPApplication, C
symmetricKey = NULL;
param = NULL;
paramLen = 0;
+
+ // Storing Key handle in session
+ hKey = CK_INVALID_HANDLE;
}
// Constructor
@@ -85,6 +88,9 @@ Session::Session()
symmetricKey = NULL;
param = NULL;
paramLen = 0;
+
+ // Storing Key handle in session
+ hKey = CK_INVALID_HANDLE;
}
// Destructor
@@ -93,6 +99,19 @@ Session::~Session()
resetOp();
}
+void Session::setKeyHandle(CK_OBJECT_HANDLE inHKey)
+{
+ //store the key hanldle for subsequent use
+ hKey = inHKey;
+}
+
+
+CK_OBJECT_HANDLE Session::getKeyHandle()
+{
+ //return the Key handle for subsequent use
+ return hKey;
+}
+
// Get session info
CK_RV Session::getInfo(CK_SESSION_INFO_PTR pInfo)
{