ReplyWantBack.cpp
Go to the documentation of this file.00001
00010 #include "ReplyWantBack.h"
00011 #include "components.h"
00012 #include "ToolkitUtils.h"
00013 #include "Buffer.h"
00014 #include "OID.h"
00015 #include "PKIFSCVPErrors.h"
00016 #include "SCVPException.h"
00017 #include "ASN1Helper.h"
00018 #include "SCVP.h"
00019
00021
00022 struct CPKIFReplyWantBackImpl
00023 {
00024 CPKIFOIDPtr m_wb;
00025 CPKIFBufferPtr m_value;
00026 };
00027
00029
00038 CPKIFReplyWantBack::CPKIFReplyWantBack() :m_impl(new CPKIFReplyWantBackImpl)
00039 {
00040 LOG_STRING_DEBUG("CPKIFReplyWantBack::CPKIFReplyWantBack()", TOOLKIT_SCVP_ASN, 0, this);
00041
00042 }
00053 CPKIFReplyWantBack::CPKIFReplyWantBack(
00055 const CPKIFBufferPtr& replyWantBack)
00056 :m_impl (new CPKIFReplyWantBackImpl)
00057 {
00058 if(replyWantBack == (CPKIFBuffer*)NULL || 0 == replyWantBack->GetLength())
00059 {
00060 throw CPKIFSCVPException(TOOLKIT_SCVP_ASN, COMMON_INVALID_INPUT);
00061 }
00062
00063 CACASNWRAPPER_CREATE(ReplyWantBack, objPDU);
00064 objPDU.Decode(replyWantBack->GetBuffer(), replyWantBack->GetLength());
00065
00066 CPKIFOIDPtr tmpOID(new CPKIFOID(objPDU->wb.subid, objPDU->wb.numids));
00067
00068 m_impl->m_wb = tmpOID;
00069
00070 CPKIFBufferPtr tmpBuf(new CPKIFBuffer(objPDU->value.data, objPDU->value.numocts));
00071
00072 m_impl->m_value = tmpBuf;
00073 }
00081 CPKIFReplyWantBack::~CPKIFReplyWantBack()
00082 {
00083 LOG_STRING_DEBUG("CPKIFReplyWantBack::~CPKIFReplyWantBack()", TOOLKIT_SCVP_ASN, 0, this);
00084
00085 if (m_impl) {
00086 delete m_impl;
00087 }
00088 }
00096 void CPKIFReplyWantBack::SetWB(
00098 CPKIFOIDPtr& wb)
00099 {
00100 m_impl->m_wb = wb;
00101 }
00109 const CPKIFOIDPtr CPKIFReplyWantBack::GetWB() const
00110 {
00111 return m_impl->m_wb;
00112 }
00113
00121 void CPKIFReplyWantBack::SetValue(
00123 CPKIFBufferPtr& value)
00124 {
00125 m_impl->m_value = value;
00126 }
00134 const CPKIFBufferPtr CPKIFReplyWantBack::GetValue() const
00135 {
00136 return m_impl->m_value;
00137 }
00138