2018-06-22 12:54:35 +00:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
2018-10-14 05:45:09 +00:00
|
|
|
#include <fnd/IByteModel.h>
|
2018-08-07 07:17:51 +00:00
|
|
|
#include <nn/pki/sign.h>
|
2018-06-22 12:54:35 +00:00
|
|
|
|
2018-08-07 07:17:51 +00:00
|
|
|
namespace nn
|
|
|
|
{
|
2018-08-06 08:59:56 +00:00
|
|
|
namespace pki
|
2018-06-22 12:54:35 +00:00
|
|
|
{
|
|
|
|
class SignatureBlock
|
2018-10-14 05:45:09 +00:00
|
|
|
: public fnd::IByteModel
|
2018-06-22 12:54:35 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
SignatureBlock();
|
|
|
|
SignatureBlock(const SignatureBlock& other);
|
|
|
|
|
|
|
|
void operator=(const SignatureBlock& other);
|
|
|
|
bool operator==(const SignatureBlock& other) const;
|
|
|
|
bool operator!=(const SignatureBlock& other) const;
|
|
|
|
|
2018-10-18 12:53:59 +00:00
|
|
|
// IByteModel
|
2018-06-24 04:46:11 +00:00
|
|
|
void toBytes();
|
|
|
|
void fromBytes(const byte_t* src, size_t size);
|
2018-06-24 15:01:16 +00:00
|
|
|
const fnd::Vec<byte_t>& getBytes() const;
|
2018-06-22 12:54:35 +00:00
|
|
|
|
2018-06-24 04:46:11 +00:00
|
|
|
// variables
|
2018-06-22 12:54:35 +00:00
|
|
|
void clear();
|
|
|
|
|
2018-08-06 08:59:56 +00:00
|
|
|
pki::sign::SignatureId getSignType() const;
|
|
|
|
void setSignType(pki::sign::SignatureId type);
|
2018-06-22 12:54:35 +00:00
|
|
|
|
|
|
|
bool isLittleEndian() const;
|
|
|
|
void setLittleEndian(bool isLE);
|
|
|
|
|
2018-06-24 04:46:11 +00:00
|
|
|
const fnd::Vec<byte_t>& getSignature() const;
|
|
|
|
void setSignature(const fnd::Vec<byte_t>& signature);
|
2018-06-22 12:54:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
const std::string kModuleName = "SIGNATURE_BLOCK";
|
|
|
|
|
|
|
|
// raw binary
|
2018-06-24 04:46:11 +00:00
|
|
|
fnd::Vec<byte_t> mRawBinary;
|
2018-06-22 12:54:35 +00:00
|
|
|
|
|
|
|
// variables
|
2018-08-06 08:59:56 +00:00
|
|
|
pki::sign::SignatureId mSignType;
|
2018-06-22 12:54:35 +00:00
|
|
|
bool mIsLittleEndian;
|
2018-06-24 04:46:11 +00:00
|
|
|
fnd::Vec<byte_t> mSignature;
|
2018-06-22 12:54:35 +00:00
|
|
|
};
|
2018-08-07 07:17:51 +00:00
|
|
|
}
|
2018-06-22 12:54:35 +00:00
|
|
|
}
|