00001 00009 #ifndef __PKIFREVERSEPATHSTATE_H__ 00010 #define __PKIFREVERSEPATHSTATE_H__ 00011 00012 #include "PKIFdll.h" 00013 #include "PKIFEnums.h" 00014 #include "CertificatePathState.h" 00015 #include "IPKIFTrustAnchor.h" 00016 #include <vector> 00017 00018 FD_LIST_PTR(CPKIFTrustRoot); 00019 FD_LIST_PTR(IPKIFTrustAnchor); 00020 FD_SMART_PTR(CPKIFCertificateNodeListWithSourceInfo); 00021 FD_LIST_PTR(CPKIFNameAndKeyWithScore); 00022 FD_LIST_PTR(CPKIFCertificateSource); 00023 FD_SMART_PTR(CPKIFCertificate); 00024 FD_SMART_PTR(IPKIFNameAndKey); 00025 FD_SMART_PTR(CPKIFPathSettings); 00026 00033 class CPKIFReversePathState : public CPKIFCertificatePathState 00034 { 00035 friend class CPKIFReversiblePathBuilder; 00036 friend struct CPKIFReversiblePathBuilderImpl; 00037 00038 public: 00039 virtual ~CPKIFReversePathState(void); 00040 00041 void SetTrustRoot(const IPKIFTrustAnchorList& rootList);// {m_rootList.clear(); copy(rootList.begin(), rootList.end(), back_inserter(m_rootList));} 00042 void ClearState(); 00043 00044 private: 00046 CPKIFReversePathState(const CPKIFReversePathState& copy); 00048 CPKIFReversePathState& operator=(const CPKIFReversePathState& rhs); 00049 00050 CPKIFReversePathState(void); 00051 00052 //m_table is the primary component used by the path builder. when building in the forward 00053 //direction, the front position is occupied by the set of candidate target certificates (typically one). 00054 //when building in the reverse direction, the front position is occupied by the set of trust anchors. 00055 //Thus, the nearest position is closest to the target (or is the target), the furtherest position is 00056 //closest to the trust anchor (or is a trust anchor). 00057 std::vector<CPKIFNameAndKeyWithScoreListPtr> m_table; 00058 std::vector<CPKIFCertificateSourceListPtr> m_sourceTable; //MUST BE KEPT IN SYNC WITH m_table 00059 00060 //for convenience, we maintain the current target here instead of taking it in and out of the CPKIFCertificatePath object 00061 CPKIFCertificatePtr m_targetCert; 00062 IPKIFNameAndKeyPtr m_targetCertAsNameAndKey; 00063 00064 PathBuildingDirection m_direction; 00065 00066 bool m_bTableIsComplete; 00067 bool m_bBuildStarted; 00068 00069 IPKIFTrustAnchorPtr m_curRoot; 00070 CPKIFPathSettingsPtr m_pathSettings; 00071 00072 PKIInfoSource m_sources; 00073 }; 00074 DECLARE_SMART_POINTERS(CPKIFReversePathState); 00075 #endif