Esempio n. 1
0
CK_RV CKManager::RemoveAllSessions(CK_SLOT_ID slotID)
{
	// Check that the library is initialized
	if (!m_isInitialized)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	// Check that the slotID is valid
	if (slotID != 0)
		return CKR_SLOT_ID_INVALID;

	// Delete all the open sessions
	m_sessionMap.clear();

	return CKR_OK;
}
Esempio n. 2
0
CK_RV CKManager::Finalize(CK_VOID_PTR pReserved)
{
	// Check that the library is initialized
	if (!m_isInitialized)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	// Check parameter
	if (pReserved != NULL_PTR)
		return CKR_ARGUMENTS_BAD;

	// Delete all the open sessions
	m_sessionMap.clear();

	// Set the isInitialized member to false and return
	m_isInitialized = false;
	return CKR_OK;
}