2017-07-17 08:21:39 +00:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include <nx/AciBinary.h>
|
|
|
|
#include <crypto/rsa.h>
|
|
|
|
|
|
|
|
namespace nx
|
|
|
|
{
|
|
|
|
class AcidBinary :
|
|
|
|
public AciBinary
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
AcidBinary();
|
|
|
|
AcidBinary(const AcidBinary& other);
|
|
|
|
|
2018-06-24 08:18:54 +00:00
|
|
|
void operator=(const AcidBinary& other);
|
2017-07-17 08:21:39 +00:00
|
|
|
bool operator==(const AcidBinary& other) const;
|
|
|
|
bool operator!=(const AcidBinary& other) const;
|
|
|
|
|
|
|
|
// export/import binary
|
2018-06-24 08:18:54 +00:00
|
|
|
void toBytes();
|
2017-07-17 08:21:39 +00:00
|
|
|
void signBinary(const crypto::rsa::sRsa2048Key& key);
|
2018-06-24 08:18:54 +00:00
|
|
|
void fromBytes(const byte_t* bytes, size_t len);
|
2018-04-21 09:19:12 +00:00
|
|
|
void verifyBinary(const crypto::rsa::sRsa2048Key& key) const;
|
2018-06-24 08:18:54 +00:00
|
|
|
const fnd::Vec<byte_t>& getBytes() const;
|
2017-07-17 08:21:39 +00:00
|
|
|
|
|
|
|
// variables
|
|
|
|
virtual void clear();
|
|
|
|
|
2017-07-18 14:17:32 +00:00
|
|
|
const crypto::rsa::sRsa2048Key& getNcaHeader2RsaKey() const;
|
|
|
|
void setNcaHeader2RsaKey(const crypto::rsa::sRsa2048Key& key);
|
2017-07-17 08:21:39 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
const std::string kModuleName = "ACID_BINARY";
|
|
|
|
|
|
|
|
// raw binary
|
2018-06-24 08:18:54 +00:00
|
|
|
fnd::Vec<byte_t> mRawBinary;
|
2017-07-17 08:21:39 +00:00
|
|
|
|
|
|
|
// variables
|
|
|
|
crypto::rsa::sRsa2048Key mEmbeddedPublicKey;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|