00001 00010 #include "PKIFNSSHelper.h" 00011 #include "PKIFCryptUtils.h" 00012 00013 CPKIFNSSHelper * CPKIFNSSHelper::m_instance = 0; 00014 00022 CPKIFNSSHelper::CPKIFNSSHelper() 00023 :m_tested(false),m_available(false) 00024 { 00025 } 00033 CPKIFNSSHelper::~CPKIFNSSHelper(void) 00034 { 00035 } 00043 bool CPKIFNSSHelper::NSSAvaliable(void) 00044 { 00045 #ifdef _WIN32 00046 if(!m_instance) m_instance = new CPKIFNSSHelper(); 00047 if(!m_instance->m_tested){ 00048 HMODULE hNSS = LoadLibrary("nss3.dll"); 00049 if(hNSS) m_instance->m_available = true; 00050 m_instance->m_tested = true; 00051 } 00052 return m_instance->m_available; 00053 #else 00054 return true; 00055 #endif //_WIN32 00056 } 00057 00064 void CPKIFNSSHelper::ShutdownHelper(void) 00065 { 00066 #ifdef _WIN32 00067 if(m_instance) { 00068 delete m_instance; 00069 m_instance = 0; 00070 } 00071 #endif //_WIN32 00072 }