AccessDescription.cpp

Go to the documentation of this file.
00001 
00009 #include "AccessDescription.h"
00010 
00011 #include "OID.h"
00012 #include "GeneralName.h"
00013 #include "ASN1Helper.h"
00014 #include "PKIX1Implicit88.h"
00015 #include "PKIX1Explicit88.h"
00016 
00017 using namespace std;
00018 
00020 struct CPKIFAccessDescriptionImpl
00021 {
00023     CPKIFOIDPtr m_accessMethod;
00024 
00026     CPKIFGeneralNamePtr m_accessLocation;
00027 };
00029 
00037 CPKIFAccessDescription::CPKIFAccessDescription()
00038 :m_impl (new CPKIFAccessDescriptionImpl)
00039 {
00040 }
00041 
00053 CPKIFAccessDescription::CPKIFAccessDescription(
00055     const CPKIFBufferPtr& ext)
00056 :m_impl (new CPKIFAccessDescriptionImpl)
00057 {
00058     CACASNWRAPPER_CREATE(CACX509V3AccessDescription, objPDU);
00059     objPDU.Decode(ext->GetBuffer(), ext->GetLength());
00060     CPKIFOIDPtr tmp(new CPKIFOID(objPDU->accessMethod.subid, objPDU->accessMethod.numids));
00061     m_impl->m_accessMethod = tmp;
00062 
00063     CACASNWRAPPER_CREATE(CACX509V3GeneralName, objPDU2);
00064     ASN1OpenType* data1 = objPDU2.Encode(&(objPDU->accessLocation));
00065     CPKIFBufferPtr tmpBuf;
00066     if (data1 != NULL)
00067     {
00068          tmpBuf = CPKIFBufferPtr(new CPKIFBuffer(data1->data, data1->numocts));
00069         delete data1;
00070     }
00071         //CPKIFGeneralNamePtr gn(new CPKIFGeneralName(objPDU->accessLocation));
00072     CPKIFGeneralNamePtr gn(new CPKIFGeneralName(tmpBuf));
00073     m_impl->m_accessLocation = gn;
00074 }
00075 
00083 CPKIFAccessDescription::~CPKIFAccessDescription()
00084 {
00085   delete m_impl;
00086   m_impl = 0;
00087 }
00088 
00096 CPKIFGeneralNamePtr CPKIFAccessDescription::AccessLocation() const 
00097 {
00098     return m_impl->m_accessLocation;
00099 }
00100 
00109 CPKIFOIDPtr CPKIFAccessDescription::AccessMethod() const
00110 {
00111     return m_impl->m_accessMethod;
00112 }

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