CRLNumber.cpp
Go to the documentation of this file.00001
00009 #include "CRLNumber.h"
00010 #include "OID.h"
00011 #include "Buffer.h"
00012
00013 #include "ASN1Helper.h"
00014 #include "PKIX1Implicit88.h"
00015 #include "PKIX1Explicit88.h"
00016
00018
00019 struct CPKIFCRLNumberImpl
00020 {
00021 CPKIFStringPtr m_crlNumber;
00022 CPKIFBufferPtr m_value;
00023 bool m_extModified;
00024 };
00025
00027
00028 char CPKIFCRLNumber::extOID[] = "2.5.29.20";
00029
00037 CPKIFCRLNumber::CPKIFCRLNumber()
00038 :m_impl (new CPKIFCRLNumberImpl)
00039 {
00040 }
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00078 CPKIFCRLNumber::CPKIFCRLNumber(
00079 const bool& criticality,
00080 const CPKIFBufferPtr& ext)
00081 : CPKIFX509Extension (criticality, ext), m_impl (new CPKIFCRLNumberImpl)
00082 {
00083
00084 CACASNWRAPPER_CREATE(CACX509V3CRLNumber, objPDU);
00085 objPDU.Decode(ext->GetBuffer(), ext->GetLength());
00086
00087 CACX509V3CRLNumber* tmp = objPDU.data();
00088 if(NULL != tmp)
00089 {
00090 CPKIFStringPtr tmpStr(new std::string((char*)*tmp));
00091 m_impl->m_crlNumber = tmpStr;
00092 }
00093
00094 m_impl->m_value = ext;
00095 m_impl->m_extModified = false;
00096 }
00097
00105 CPKIFCRLNumber::~CPKIFCRLNumber()
00106 {
00107 if(m_impl)
00108 {
00109 delete m_impl;
00110 m_impl = 0;
00111 }
00112 }
00120 const CPKIFOIDPtr CPKIFCRLNumber::oid() const
00121 {
00122
00123 static CPKIFOID staticOID(extOID);
00124
00125 static CPKIFOIDPtr tmp(new CPKIFOID(staticOID));
00126 return tmp;
00127 }
00135 const char* CPKIFCRLNumber::CRLNumber() const
00136 {
00137 if(m_impl->m_crlNumber == (std::string*)NULL)
00138 return NULL;
00139 else
00140 return m_impl->m_crlNumber->c_str();
00141 }
00149 CPKIFBufferPtr CPKIFCRLNumber::value() const
00150 {
00151 CPKIFBufferPtr rv = m_impl->m_value;
00152 if(m_impl->m_value == (CPKIFBuffer*)NULL || m_impl->m_extModified)
00153 {
00154
00155 }
00156
00157 return rv;
00158 }