ReplyCheck.cpp
Go to the documentation of this file.00001
00010 #include "ReplyCheck.h"
00011 #include "components.h"
00012 #include "ToolkitUtils.h"
00013 #include "Buffer.h"
00014 #include "PKIFSCVPErrors.h"
00015 #include "SCVPException.h"
00016 #include "ASN1Helper.h"
00017 #include "OID.h"
00018 #include "SCVP.h"
00019
00021
00022 struct CPKIFReplyCheckImpl
00023 {
00024 CPKIFOIDPtr m_check;
00025 int m_status;
00026 };
00027
00029
00038 CPKIFReplyCheck::CPKIFReplyCheck() :m_impl(new CPKIFReplyCheckImpl)
00039 {
00040 LOG_STRING_DEBUG("CPKIFReplyCheck::CPKIFReplyCheck()", TOOLKIT_SCVP_ASN, 0, this);
00041
00042 }
00053 CPKIFReplyCheck::CPKIFReplyCheck(
00055 const CPKIFBufferPtr& replyCheck)
00056 :m_impl (new CPKIFReplyCheckImpl)
00057 {
00058 if(replyCheck == (CPKIFBuffer*)NULL || 0 == replyCheck->GetLength())
00059 {
00060 throw CPKIFSCVPException(TOOLKIT_SCVP_ASN, COMMON_INVALID_INPUT);
00061 }
00062
00063 CACASNWRAPPER_CREATE(ReplyCheck, objPDU);
00064 objPDU.Decode(replyCheck->GetBuffer(), replyCheck->GetLength());
00065
00066 CPKIFOIDPtr algOID(new CPKIFOID(objPDU->check.subid, objPDU->check.numids));
00067 m_impl->m_check = algOID;
00068
00069 m_impl->m_status = objPDU->status;
00070
00071
00072 }
00080 CPKIFReplyCheck::~CPKIFReplyCheck()
00081 {
00082 LOG_STRING_DEBUG("CPKIFReplyCheck::~CPKIFReplyCheck()", TOOLKIT_SCVP_ASN, 0, this);
00083
00084 if (m_impl) {
00085 delete m_impl;
00086 }
00087 }
00095 void CPKIFReplyCheck::SetCheck(
00097 CPKIFOIDPtr& check)
00098 {
00099 m_impl->m_check = check;
00100 }
00108 const CPKIFOIDPtr CPKIFReplyCheck::GetCheck() const
00109 {
00110 return m_impl->m_check;
00111 }
00112
00120 void CPKIFReplyCheck::SetStatus(
00122 int status)
00123 {
00124 m_impl->m_status = status;
00125 }
00133 const int CPKIFReplyCheck::GetStatus() const
00134 {
00135 return m_impl->m_status;
00136 }
00137