nstool/lib/libpki/include/nn/pki/SignatureBlock.h

48 lines
1 KiB
C
Raw Normal View History

2018-06-22 12:54:35 +00:00
#pragma once
#include <string>
2018-06-24 04:46:11 +00:00
#include <fnd/ISerialisable.h>
#include <pki/sign.h>
2018-06-22 12:54:35 +00:00
namespace pki
2018-06-22 12:54:35 +00:00
{
class SignatureBlock
2018-06-24 04:46:11 +00:00
: public fnd::ISerialisable
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-06-24 04:46:11 +00:00
// export/import binary
void toBytes();
void fromBytes(const byte_t* src, size_t size);
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();
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
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
};
}