EvidenceRecord.h

Go to the documentation of this file.
00001 
00011 #ifndef __EvidenceRecord_H__
00012 #define __EvidenceRecord_H__
00013 
00014 //PKIF includes
00015 #include "PKIFdll.h"
00016 #include "components.h"
00017 #include "AlgorithmIdentifier.h"
00018 
00019 //PKIFERS includes
00020 #include "PKIFERSLib.h"
00021 #include "IPKIFCryptoInfo.h"
00022 #include "ArchiveTimestamp.h"
00023 
00024 //PKIFTSP components
00025 #define TOOLKIT_ERS                         TOOLKIT_TAP                     //reuse TAP value since it is dead and this is the replacement
00026 #define TOOLKIT_ERS_ERROR_BASE              TOOLKIT_TAP_ERROR_BASE
00027 #define TOOLKIT_ERS_SUBCOMPONENT            TOOLKIT_TAP_SUBCOMPONENT
00028 #define TOOLKIT_ERS_ASN                     TOOLKIT_ERS_SUBCOMPONENT + 1    //DER encode/decode wrapper classes
00029 
00030 // forward declaration
00031 struct CPKIFEvidenceRecordImpl;
00032 
00033 enum PKIFERSv1
00034 {
00035     PKIFERSv1 = 1
00036 };
00037 
00093 class PKIFERS_API CPKIFEvidenceRecord
00094 {
00095 public:
00097     CPKIFEvidenceRecord(void);
00098 
00100     virtual ~CPKIFEvidenceRecord(void);
00101 
00103     //in the ArchiveTimestampSequence passed to 
00104     CPKIFBufferPtr Encode() const;
00105 
00107     void Decode(CPKIFBufferPtr& msg);
00108 
00110     int GetVersion() const;
00111 
00113     //When decoding an EvidenceRecord, the list returned by this function may differ from the the list encoded by the evidence record 
00114     //creator (for example, if the creator omitted a digest algorithm or included an additional algorithm).  When encoding an evidence record
00115     //the list returned is the list that corresponds to the values collected when SetArchiveTimestampSequence was last invoked.  The list
00116     //is a copy of the algorithm identifiers included in the evidence records.  Edits to the list or members in the list have no effect
00117     //on subsequent calls to Encode or GetDigestAlgorithms.
00118     CPKIFAlgorithmIdentifierListPtr GetDigestAlgorithms() const;
00119 
00121     //in the evidence record.  The pointer is a live pointer to the archive timestamp sequence held by the CPKIFEvidenceRecord instance.  Thus,
00122     //it can be used to update an evidence record and re-encode a new evidence without call SetArchiveTimestampSequence.
00123     CPKIFArchiveTimestampSequencePtr GetArchiveTimestampSequence() const;
00124 
00126     //the next call to Encode.
00127     void SetArchiveTimestampSequence(CPKIFArchiveTimestampSequencePtr& ats);
00128 
00129 private:
00131     CPKIFEvidenceRecord(const CPKIFEvidenceRecord& copy);
00133     CPKIFEvidenceRecord& operator=(const CPKIFEvidenceRecord& rhs); 
00134 
00135     struct CPKIFEvidenceRecordImpl *m_impl;
00136 };
00137 DECLARE_SMART_POINTERS(CPKIFEvidenceRecord);
00138 typedef std::vector<CPKIFEvidenceRecordPtr, PKIFAlloc<CPKIFEvidenceRecordPtr> > CPKIFEvidenceRecordList;
00139 DECLARE_SMART_POINTERS(CPKIFEvidenceRecordList);
00140 
00141 #endif

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