EncryptedContentInfo.cpp

Go to the documentation of this file.
00001 
00010 #include "EncryptedContentInfo.h"
00011 
00012 #include "ToolkitUtils.h"
00013 #include "PKIFMessageException.h"
00014 #include "components.h"
00015 #include "PKIFCommonErrors.h"
00016 
00018 struct CPKIFEncryptedContentInfoImpl
00019 {
00020     CPKIFOIDPtr m_oid;
00021     CPKIFBufferPtr m_content;
00022     CPKIFAlgorithmIdentifierPtr m_algID;
00023 };
00025 
00034 CPKIFEncryptedContentInfo::CPKIFEncryptedContentInfo()
00035     :m_impl (new CPKIFEncryptedContentInfoImpl)
00036 {
00037     m_impl->m_oid = g_data;
00038 }
00046 CPKIFEncryptedContentInfo::~CPKIFEncryptedContentInfo() 
00047 {
00048     delete m_impl;
00049     m_impl = NULL;
00050 }
00063 void CPKIFEncryptedContentInfo::SetOID(
00066     CPKIFOIDPtr& oid) 
00067 {
00068     //accept no NULLs
00069     if(oid == (CPKIFOID*)NULL)
00070         throw CPKIFMessageException(TOOLKIT_MESSAGE, COMMON_INVALID_INPUT);
00071 
00072     m_impl->m_oid = oid;
00073 }
00084 CPKIFOIDPtr CPKIFEncryptedContentInfo::GetOID() const 
00085 {
00086     return m_impl->m_oid;
00087 }
00098 void CPKIFEncryptedContentInfo::SetContent(
00101     CPKIFBufferPtr& buf) 
00102 {
00103     //accept no NULLs
00104     if(buf == (CPKIFBuffer*)NULL)
00105         throw CPKIFMessageException(TOOLKIT_MESSAGE, COMMON_INVALID_INPUT);
00106 
00107     m_impl->m_content = buf;
00108 }
00123 CPKIFBufferPtr CPKIFEncryptedContentInfo::GetContent() const 
00124 {
00125     return m_impl->m_content;
00126 }
00145 void CPKIFEncryptedContentInfo::SetAlgorithmIdentifier(
00148     CPKIFAlgorithmIdentifierPtr& algID) 
00149 {
00150     //accept no NULLs
00151     if(algID == (CPKIFAlgorithmIdentifier*)NULL)
00152         throw CPKIFMessageException(TOOLKIT_MESSAGE, COMMON_INVALID_INPUT);
00153 
00154     m_impl->m_algID = algID;
00155 }
00165 CPKIFAlgorithmIdentifierPtr CPKIFEncryptedContentInfo::GetAlgorithmIdentifier() 
00166 {
00167     return m_impl->m_algID;
00168 }
00169 

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