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
00024 struct CPKIFArchiveTimestampImpl;
00025
00026
00027
00028
00029
00030 typedef std::vector<CPKIFBufferPtr, PKIFAlloc<CPKIFBufferPtr> > CPKIFPartialHashtree;
00031 DECLARE_SMART_POINTERS(CPKIFPartialHashtree);
00032
00033
00034
00035 typedef std::vector<CPKIFPartialHashtreePtr, PKIFAlloc<CPKIFPartialHashtreePtr> > CPKIFPartialHashtreeList;
00036 DECLARE_SMART_POINTERS(CPKIFPartialHashtreeList);
00037
00038 enum ArchiveTimeStampType
00039 {
00040 iATS = 0,
00041 trATS,
00042 hrATS
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
00075
00076
00077 CPKIFAlgorithmIdentifierPtr GetDigestAlgorithm() const;
00078 CPKIFAlgorithmIdentifierPtr GetEffectiveDigestAlgorithm() const;
00079 CPKIFPartialHashtreeListPtr GetReducedHashtree() const;
00080 CPKIFContentInfoPtr GetTimestamp() const;
00081
00082
00083 void SetDigestAlgorithm(CPKIFAlgorithmIdentifierPtr& hashtree);
00084 void SetReducedHashtree(CPKIFPartialHashtreeListPtr& reducedHashtree);
00085 void SetTimestamp(CPKIFContentInfoPtr& timestamp);
00086
00087
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