ArchiveTimestamp.h

Go to the documentation of this file.
00001 
00011 #ifndef __ArchiveTimestamp_H__
00012 #define __ArchiveTimestamp_H__
00013 
00014 #include "PKIFdll.h"
00015 #include "PKIFERSLib.h"
00016 #include "PKIFCryptoConstants.h"
00017 
00018 FD_SMART_PTR(CPKIFAlgorithmIdentifier);
00019 FD_SMART_PTR(CPKIFBuffer);
00020 FD_SMART_PTR(CPKIFContentInfo);
00021 FD_MC_PTR();
00022 
00023 // forward declaration
00024 struct CPKIFArchiveTimestampImpl;
00025 
00026 //CPKIFPartialHashtree provides a name for a list of CPKIFBuffer objects that contains
00027 //hashes of objects.  A partial hashtree is a node in a hashtree.  Where the node is a leaf
00028 //node, the object hashes are those of the data objects being archived.  Where the node is an
00029 //interior node, the hashes are those of its children in the hashtree.
00030 typedef std::vector<CPKIFBufferPtr, PKIFAlloc<CPKIFBufferPtr> > CPKIFPartialHashtree;
00031 DECLARE_SMART_POINTERS(CPKIFPartialHashtree);
00032 
00033 //CPKIFPartialHashtreeList is a list of CPKIFPartialHashtree objects.  This is used for the reducedHashtree
00034 //field in an EvidenceRecord.
00035 typedef std::vector<CPKIFPartialHashtreePtr, PKIFAlloc<CPKIFPartialHashtreePtr> > CPKIFPartialHashtreeList;
00036 DECLARE_SMART_POINTERS(CPKIFPartialHashtreeList);
00037 
00038 enum ArchiveTimeStampType
00039 {
00040     iATS = 0,   //Initial ArchiveTimeStamp (covers data being archived)
00041     trATS,      //Timestamp Renewal ArchiveTimeStamp (covers ArchiveTimeStamp that precedes it in an ArchiveTimeStampChain)
00042     hrATS       //Hashtree Renewal ArchiveTimeStamp (covers ArchiveTimeStampChain that precedes it in an ArchiveTimeStampSequence)
00043 };
00044 
00065 class PKIFERS_API CPKIFArchiveTimestamp
00066 {
00067 public:
00068     CPKIFArchiveTimestamp(void);
00069     virtual ~CPKIFArchiveTimestamp(void);
00070 
00071     void SetArchiveTimeStampType(ArchiveTimeStampType atst);
00072     ArchiveTimeStampType GetArchiveTimeStampType() const;
00073 
00074     //XXX***NEED TO IMPLEMENT SUPPORT FOR THE ATTRIBUTES MEMBER
00075 
00076     //get methods
00077     CPKIFAlgorithmIdentifierPtr GetDigestAlgorithm() const;
00078     CPKIFAlgorithmIdentifierPtr GetEffectiveDigestAlgorithm() const;
00079     CPKIFPartialHashtreeListPtr GetReducedHashtree() const;
00080     CPKIFContentInfoPtr GetTimestamp() const;
00081 
00082     //set methods
00083     void SetDigestAlgorithm(CPKIFAlgorithmIdentifierPtr& hashtree);
00084     void SetReducedHashtree(CPKIFPartialHashtreeListPtr& reducedHashtree);
00085     void SetTimestamp(CPKIFContentInfoPtr& timestamp);
00086 
00087     //encode/decode methods
00088     CPKIFBufferPtr Encode() const;
00089     void Decode(CPKIFBufferPtr& msg);
00090 
00091 private:
00093     CPKIFArchiveTimestamp(const CPKIFArchiveTimestamp& copy);
00095     CPKIFArchiveTimestamp& operator=(const CPKIFArchiveTimestamp& rhs); 
00096 
00097     struct CPKIFArchiveTimestampImpl *m_impl;
00098 };
00099 DECLARE_SMART_POINTERS(CPKIFArchiveTimestamp);
00100 
00108 typedef std::vector<CPKIFArchiveTimestampPtr, PKIFAlloc<CPKIFArchiveTimestampPtr> > CPKIFArchiveTimestampChain;
00109 DECLARE_SMART_POINTERS(CPKIFArchiveTimestampChain);
00110 
00117 typedef std::vector<CPKIFArchiveTimestampChainPtr, PKIFAlloc<CPKIFArchiveTimestampChainPtr> > CPKIFArchiveTimestampSequence;
00118 DECLARE_SMART_POINTERS(CPKIFArchiveTimestampSequence);
00119 
00120 CPKIFBufferPtr PKIFERS_API CalculateHashOfTimestamp(
00122     CPKIFContentInfoPtr& timestamp, 
00124     IPKIFMediatorPtr& m, 
00126     PKIFCRYPTO::HASH_ALG ha);
00127 
00128 CPKIFBufferPtr PKIFERS_API CalculateHashOfArchiveTimestampChain(
00130     CPKIFArchiveTimestampChainPtr& archiveTimestampChain, 
00132     IPKIFMediatorPtr& m, 
00134     PKIFCRYPTO::HASH_ALG ha);
00135 
00136 #endif

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