SignedData.h
Go to the documentation of this file.00001
00009 #ifndef __SIGNEDDATA_H__
00010 #define __SIGNEDDATA_H__
00011
00012 #include "PKIFCMSDLL.h"
00013 #include "components.h"
00014 #include "PKIFMediators.h"
00015 #include "PKIFCMSUtils.h"
00016 #include "ContentType.h"
00017
00018
00019
00020
00021
00022
00023
00024
00025 FD_LIST_PTR(CPKIFCRL);
00026 FD_SMART_PTR(CPKIFEncapsulatedContentInfo);
00027 FD_SMART_PTR(CPKIFPathValidationResults);
00028 FD_SMART_PTR(CPKIFFuncStorage);
00029
00030 struct HashInfo;
00031 class IPKIFCryptoMisc;
00032
00033
00059 class PKIFCMS_API CPKIFSignedData : public CPKIFContentType
00060 {
00061 friend struct CPKIFSignedDataImpl;
00062 public:
00063
00064
00065 typedef enum {
00066 CMSv0 = 0,
00067 CMSv1 = 1,
00068 CMSv2 = 2,
00069 CMSv3 = 3,
00070 CMSv4 = 4
00071 } CMSVersion;
00072
00073
00074
00075
00076 CPKIFSignedData(void);
00077 virtual ~CPKIFSignedData(void);
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 CMSVersion GetVersion() const;
00094
00095
00096
00097
00098 void SetEncapsulatedContent(CPKIFEncapsulatedContentInfoPtr& ecip);
00099 CPKIFEncapsulatedContentInfoPtr GetEncapsulatedContent() const;
00100
00101 void UpdateMessage(unsigned char* buf, int bufLen);
00102
00103
00104 void AddCertificate(CPKIFCertificatePtr& cert);
00105 void GetCertificates(CPKIFCertificateList& certs);
00106
00107
00108 void AddCRL(CPKIFCRLPtr& crl);
00109 void GetCRLs(CPKIFCRLList& crls);
00110
00111
00112 void AddSignerInfo(CPKIFSignerInfoPtr& si);
00113 void GetSignerInfos(CPKIFSignerInfoList& sis);
00114
00115
00116
00117
00118 CPKIFBufferPtr Encode();
00119 void Decode(CPKIFBufferPtr& buf);
00120
00121
00122
00123
00124 bool Verify(int signerIndex, CMSVerificationStatus& status, CMSPathValidationStatus minStatus = PVS_REV_STATUS_VERIFIED);
00125 bool Verify(int signerIndex, CMSVerificationStatus& status, CPKIFCertificatePtr& signersCert, CMSPathValidationStatus minStatus = PVS_REV_STATUS_VERIFIED);
00126 void SetKeyUsageChecker(CPKIFFuncStoragePtr& kuChecker);
00127 void SetPathSettings(CPKIFPathSettingsPtr& settings);
00128 CPKIFCertificatePathPtr GetPath() const;
00129 CPKIFPathValidationResultsPtr GetValidationResults() const;
00130 void GetSignersCert(int signerIndex, CPKIFCertificatePtr& cert);
00131 size_t GetNumberOfSigners() const;
00132
00133 CPKIFSignerInfoPtr GetSignersInfo(int signerIndex);
00134
00135
00136 void ClearContent(bool removeMediatorAssociations = true);
00137
00138
00139 CPKIFBufferPtr GetSignersCert(CPKIFBufferPtr tmpSignerInfoBuf);
00140
00141 void AddMediator(IPKIFMediatorPtr& m);
00142 IPKIFMediatorPtr GetMediator();
00143
00144 private:
00146 CPKIFSignedData(const CPKIFSignedData& copy);
00148 CPKIFSignedData& operator=(const CPKIFSignedData& rhs);
00149
00150 enum {thisComponent=TOOLKIT_MESSAGE_SIGNED_DATA};
00151
00152 struct CPKIFSignedDataImpl *m_impl;
00153
00154 };
00155 DECLARE_SMART_POINTERS(CPKIFSignedData);
00156
00157 #endif