FreshestCRL.cpp
Go to the documentation of this file.00001
00009 #include "FreshestCRL.h"
00010 #include "OID.h"
00011 #include "Buffer.h"
00012 #include "CRLDistributionPoint.h"
00013
00014 #include "ASN1Helper.h"
00015 #include "PKIX1Implicit88.h"
00016 #include "PKIX1Explicit88.h"
00017
00019
00020 struct CPKIFFreshestCRLImpl
00021 {
00022 CPKIFCRLDistributionPointListPtr m_crlDPs;
00023 CPKIFBufferPtr m_value;
00024 bool m_extModified;
00025 };
00026
00028
00029 char CPKIFFreshestCRL::extOID[] = "2.5.29.46";
00030
00038 CPKIFFreshestCRL::CPKIFFreshestCRL()
00039 :m_impl (new CPKIFFreshestCRLImpl)
00040 {
00041 }
00049 CPKIFCRLDistributionPointListPtr CPKIFFreshestCRL::DPs() const
00050 {
00051 return m_impl->m_crlDPs;
00052 }
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00096 CPKIFFreshestCRL::CPKIFFreshestCRL(
00097 const bool& criticality,
00098 const CPKIFBufferPtr& ext)
00099 : CPKIFX509Extension (criticality, ext), m_impl (new CPKIFFreshestCRLImpl)
00100 {
00101
00102 CACASNWRAPPER_CREATE(CACX509V3CRLDistributionPoints, objPDU);
00103 objPDU.Decode(ext->GetBuffer(), ext->GetLength());
00104
00105 DListNode* cur = objPDU->head;
00106 if(NULL != cur)
00107 {
00108 CPKIFCRLDistributionPointListPtr piList(new CPKIFCRLDistributionPointList);
00109 m_impl->m_crlDPs = piList;
00110 }
00111 while(NULL != cur)
00112 {
00113
00114
00115
00116
00117 ASN1OpenType* openType = (ASN1OpenType*)cur->data;
00118 CPKIFBufferPtr tmpBuffer(new CPKIFBuffer(openType->data, openType->numocts));
00119
00120 CPKIFCRLDistributionPointPtr dp(new CPKIFCRLDistributionPoint(tmpBuffer));
00121 m_impl->m_crlDPs->push_back(dp);
00122 cur = cur->next;
00123 }
00124
00125 m_impl->m_value = ext;
00126 m_impl->m_extModified = false;
00127 }
00128
00136 CPKIFFreshestCRL::~CPKIFFreshestCRL()
00137 {
00138 if(m_impl)
00139 {
00140 delete m_impl;
00141 m_impl = 0;
00142 }
00143 }
00152 const CPKIFOIDPtr CPKIFFreshestCRL::oid() const
00153 {
00154
00155 static CPKIFOID staticOID(extOID);
00156
00157 static CPKIFOIDPtr tmp(new CPKIFOID(staticOID));
00158 return tmp;
00159 }
00167 CPKIFBufferPtr CPKIFFreshestCRL::value() const
00168 {
00169 CPKIFBufferPtr rv = m_impl->m_value;
00170 if(m_impl->m_value == (CPKIFBuffer*)NULL || m_impl->m_extModified)
00171 {
00172
00173 }
00174
00175 return rv;
00176 }