00001 00009 #ifndef CERT_STATUS_CACHE_H_ 00010 #define CERT_STATUS_CACHE_H_ 00011 00012 #include "PKIFdll.h" 00013 #include "PKIFMediators.h" 00014 #include "PKIFRevocationStatusInterfaces.h" 00015 00016 struct CertStatusCacheImpl; 00017 FD_SMART_PTR(CPKIFCertificate); 00018 FD_SMART_PTR(CPKIFCertStatus); 00019 00027 class CPKIFCertStatusCache : public IPKIFColleague, public IPKIFRevocationStatus 00028 { 00029 public: 00030 CPKIFCertStatusCache(); 00031 ~CPKIFCertStatusCache(); 00032 00033 void PutObject(const CPKIFCertificatePtr& targetCert, const CPKIFCertificatePtr& issuersCert, RevocationStatus& status, CPKIFCertStatusPtr& certStatus); 00034 void PutObjectsInPath(CPKIFCertificatePath& path); 00035 00036 void SetMaxCacheAge(unsigned long maxAgeInMilliseconds); 00037 long GetMaxCacheAge() const; 00038 00039 void SetMaxCacheSize(int count); 00040 int GetMaxCacheSize() const; 00041 00042 void SetCacheCaCertsOnly(bool bCacheCaCertsOnly); 00043 bool GetCacheCaCertsOnly() const; 00044 00045 void SetPurgeFrequency(int minTimeBetweenPurgesInSeconds); 00046 int GetPurgeFrequency() const; 00047 00048 //IPKIFColleague functions 00049 void Initialize(); 00050 00051 //IPKIFRevocationStatus functions 00052 bool CheckStatus(const CPKIFCertificatePtr& targetCert, const CPKIFCertificatePtr& issuersCert, RevocationStatus& status, CPKIFCertStatusPtr& certStatus); 00053 bool CheckStatusPath(CPKIFCertificatePath& path, RevocationStatus& status); 00054 00055 private: 00056 struct CertStatusCacheImpl* m_impl; 00057 }; 00058 DECLARE_SMART_POINTERS(CPKIFCertStatusCache); 00059 00060 #endif //CERT_STATUS_CACHE_H_