00001 00009 #ifndef __CapiCRL_H__ 00010 #define __CapiCRL_H__ 00011 00012 #include "PKIFdll.h" 00013 #define CAC_API_FACTORY 00014 00015 #if defined(WIN32) || defined(_WIN32) 00016 #include <Wincrypt.h> 00017 #endif 00018 00019 #include <vector> 00020 #include <map> 00021 #include "IPKIFHasExtensions.h" 00022 00023 #include "CRLEntry.h" 00024 #include "X509Extension.h" 00025 00026 // forward declarations 00027 struct CPKIFCapiCRLImpl; 00028 FD_SMART_PTR(CPKIFName); 00029 FD_SMART_PTR(CPKIFTime); 00030 FD_SMART_PTR(CPKIFAlgorithmIdentifier); 00031 FD_SMART_PTR(CPKIFCertificate); 00032 00033 struct CPKIFCapiCRLEntryImpl; 00034 FD_SMART_PTR(CPKIFBuffer); 00035 00041 class CPKIFCapiCRLEntry : public CPKIFCRLEntry 00042 { 00043 public: 00044 CPKIFCapiCRLEntry(PCRL_ENTRY crlEntry); 00045 virtual ~CPKIFCapiCRLEntry(); 00046 00047 bool AreThereAnyUnprocessedCriticalExtensions(std::vector<CPKIFX509ExtensionPtr>& processedExts); 00048 00049 virtual void GetEncodedExtensions (CPKIFBufferPtr& buf); 00050 virtual void GetExtensionByOID(const CPKIFOID& oid, CPKIFX509ExtensionPtr& ref); 00051 00052 const char* SerialNumber() const; 00053 const CPKIFTimePtr RevocationDate() const; 00054 00055 private: 00056 CPKIFCapiCRLEntry(); 00057 CPKIFCapiCRLEntry(const CPKIFCapiCRLEntry& ext); 00058 CPKIFCapiCRLEntry& operator=(const CPKIFCapiCRLEntry& rhs); 00059 00060 struct CPKIFCapiCRLEntryImpl *m_impl; 00061 }; 00062 DECLARE_SMART_POINTERS(CPKIFCapiCRLEntry) 00063 00064 00091 class CAC_API CPKIFCapiCRL : public CPKIFCRL 00092 { 00093 friend class CPKIFCAPIRepository2; 00094 public: 00095 virtual ~CPKIFCapiCRL(void); 00096 00097 virtual void Decode(const unsigned char* cert, int certLen); 00098 virtual CPKIFBufferPtr Encoded() const; 00099 00100 virtual int Version() const; 00101 virtual CPKIFNamePtr Issuer( ) const; 00102 virtual CPKIFBufferPtr Signature() const; 00103 virtual CPKIFTimePtr NextUpdate() const; 00104 virtual CPKIFTimePtr ThisUpdate() const; 00105 virtual CPKIFAlgorithmIdentifierPtr SignatureAlgorithm() const; 00106 00107 virtual bool operator==(const CPKIFCRL& rhs) const; 00108 00109 virtual bool CertOnThisCRL(const CPKIFCertificatePtr& cert, CPKIFCRLEntryPtr& crlEntry); 00110 virtual bool AreThereAnyUnprocessedCriticalExtensions(std::vector<CPKIFX509ExtensionPtr>& processedExts); 00111 00112 virtual void GetEncodedExtensions (CPKIFBufferPtr& buf); 00113 virtual void GetExtensionByOID(const CPKIFOID& oid, CPKIFX509ExtensionPtr& ref); 00114 00115 private: 00116 CPKIFCapiCRL(const CPKIFCapiCRL& ext); 00117 CPKIFCapiCRL& operator=(const CPKIFCapiCRL& rhs); //added 4/6/2004 00118 00119 //can only be created by CAPI colleagues 00120 CPKIFCapiCRL(void); 00121 void SetCRL(PCCRL_CONTEXT crl); 00122 00123 struct CPKIFCapiCRLImpl *m_impl; 00124 }; 00125 DECLARE_SMART_POINTERS(CPKIFCapiCRL) 00126 00127 #endif