#ifndef NMR_ENCRYPTIONHEADER #define NMR_ENCRYPTIONHEADER #include #include #include "Common/NMR_Types.h" #include "Common/NMR_Local.h" namespace NMR { class CImportStream; using PImportStream = std::shared_ptr; class CExportStream; using PExportStream = std::shared_ptr; union uEncryptedFileHeader { nfByte bytes[12]; struct sHeaderStructure { union uMagic { nfByte bytes[5]; } Signature; nfByte majorVersion; nfByte minorVersion; nfByte unused; union uLength { nfByte bytes[4]; nfUint32 length; } Length; } Header; }; class CEncryptionHeader { std::vector m_rgAdditionalData; nfUint64 m_nfHeaderSize; public: CEncryptionHeader(std::vector const & additionalData = std::vector()); size_t readFrom(PImportStream from); size_t writeTo(PExportStream to); std::vector const & additionalData() const; nfUint64 headerSize() const; }; } #endif // !NMR_ENCRYPTIONHEADER