CACCertificatePath.cpp

Go to the documentation of this file.
00001 
00009 #include "PKIFCertificatePath.h"
00010 #include "ToolkitUtils.h"
00011 #include "CRL.h"
00012 #include "components.h"
00013 #include "IPKIFTrustAnchor.h"
00014 
00015 #include <iterator>
00016 
00017 
00019 struct CPKIFCertificatePathImpl
00020 {
00021     CPKIFCertificatePtr m_target;       //lone target cert
00022     CPKIFCertificateNodeList m_path;    //list of certs incl. target to closet to root
00023     IPKIFTrustAnchorPtr m_root;         //lone trust root
00024 
00025     CPKIFCertificatePathStatePtr m_state;//builder-specific state object
00026     CPKIFPathSettingsPtr m_settings;        //generic path val settings (may need to be val obj specific)
00027     CPKIFBuilderStatisticsPtr m_stats;
00028     CPKIFCRLList m_crlList;
00029 };
00031 
00040 CPKIFCertificatePath::CPKIFCertificatePath(void)
00041   :m_impl (new CPKIFCertificatePathImpl)
00042 {
00043     LOG_STRING_DEBUG("CPKIFCertificatePath::CPKIFCertificatePath()", TOOLKIT_PATH_MISC, 0, this);
00044 }
00052 CPKIFCertificatePath::~CPKIFCertificatePath(void)
00053 {
00054     LOG_STRING_DEBUG("CPKIFCertificatePath::~CPKIFCertificatePath()", TOOLKIT_PATH_MISC, 0, this);
00055 
00056     delete m_impl;
00057     m_impl = 0;
00058 }
00059 /*
00060 void CPKIFCertificatePath::GetCRLList(CPKIFCRLList& crlList)
00061 {
00062     crlList.clear();
00063 
00064     CPKIFCRLList::iterator pos;
00065     CPKIFCRLList::iterator end = m_crlList.end();
00066     for(pos = m_crlList.begin(); pos != end; ++pos)
00067         crlList.push_back(*pos);
00068 }
00069 */
00070 //set/get target certificate
00084 void CPKIFCertificatePath::SetTarget(
00087     const CPKIFCertificatePtr& cert) 
00088 { 
00089     m_impl->m_target = cert; 
00090 }
00100 void CPKIFCertificatePath::GetTarget(
00103     CPKIFCertificatePtr& cert)const 
00104 { 
00105     cert = m_impl->m_target; 
00106 }
00107 
00108 //set/get path
00121 void CPKIFCertificatePath::SetPath(
00123     const CPKIFCertificateNodeList& path) 
00124 { 
00125     m_impl->m_path.clear(); 
00126     copy(path.begin(), path.end(), back_inserter(m_impl->m_path)); 
00127 }
00139 void CPKIFCertificatePath::GetPath(
00141     CPKIFCertificateNodeList& path)const 
00142 { 
00143     path.clear(); 
00144     copy(m_impl->m_path.begin(), m_impl->m_path.end(), back_inserter(path)); 
00145 }
00146 
00147 //set/get path state
00156 void CPKIFCertificatePath::SetState(
00158     const CPKIFCertificatePathStatePtr& state) 
00159 {
00160     m_impl->m_state = state; 
00161 }
00170 void CPKIFCertificatePath::GetState(
00172     CPKIFCertificatePathStatePtr& state)const 
00173 { 
00174     state = m_impl->m_state; 
00175 }
00176 
00177 //set/get trust root
00186 void CPKIFCertificatePath::SetTrustRoot(
00188     const IPKIFTrustAnchorPtr& root) 
00189 {
00190     m_impl->m_root = root;
00191 }
00199 void CPKIFCertificatePath::GetTrustRoot(
00201     IPKIFTrustAnchorPtr& root)const 
00202 {
00203     root = m_impl->m_root;
00204 }
00205 
00206 //set/get path settings
00220 void CPKIFCertificatePath::SetPathSettings(
00222     const CPKIFPathSettingsPtr& settings) 
00223 {
00224     m_impl->m_settings = settings;
00225 }
00235 void CPKIFCertificatePath::GetPathSettings(
00237     CPKIFPathSettingsPtr& settings)const 
00238 {
00239     settings = m_impl->m_settings;
00240 }
00241 
00242 //set/get builder stats
00250 void CPKIFCertificatePath::SetBuilderStats(
00252     const CPKIFBuilderStatisticsPtr& stats) 
00253 {
00254     m_impl->m_stats = stats;
00255 }
00263 void CPKIFCertificatePath::GetBuilderStats(
00265     CPKIFBuilderStatisticsPtr& stats)const 
00266 {
00267     stats = m_impl->m_stats;
00268 }
00269 /*
00270 //set/get CRLs (need some abstract class for returning rev info)
00271 void CPKIFCertificatePath::ClearCRLs() 
00272 {
00273     m_crlList.clear();
00274 }
00275 void CPKIFCertificatePath::AddCRL(CPKIFCRLPtr& crl) 
00276 {
00277     m_crlList.push_back(crl);
00278 }
00279 */

Generated on Mon Nov 15 11:15:46 2010 for PublicKeyInfrastructureFramework(PKIF) by  doxygen 1.5.6