2017-07-17 08:21:39 +00:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
2017-08-05 13:09:50 +00:00
|
|
|
#include <fnd/MemoryBlob.h>
|
2017-07-17 08:21:39 +00:00
|
|
|
#include <nx/AciBinary.h>
|
|
|
|
#include <crypto/rsa.h>
|
|
|
|
|
|
|
|
namespace nx
|
|
|
|
{
|
|
|
|
class AcidBinary :
|
|
|
|
public AciBinary
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
AcidBinary();
|
|
|
|
AcidBinary(const AcidBinary& other);
|
2018-03-22 05:26:22 +00:00
|
|
|
AcidBinary(const byte_t* bytes, size_t len);
|
2017-07-17 08:21:39 +00:00
|
|
|
|
|
|
|
bool operator==(const AcidBinary& other) const;
|
|
|
|
bool operator!=(const AcidBinary& other) const;
|
|
|
|
void operator=(const AcidBinary& other);
|
|
|
|
|
|
|
|
// to be used after export
|
2018-03-22 05:26:22 +00:00
|
|
|
const byte_t* getBytes() const;
|
2017-07-17 08:21:39 +00:00
|
|
|
size_t getSize() const;
|
|
|
|
|
|
|
|
// export/import binary
|
|
|
|
virtual void exportBinary();
|
|
|
|
void signBinary(const crypto::rsa::sRsa2048Key& key);
|
2018-03-22 05:26:22 +00:00
|
|
|
virtual void importBinary(const byte_t* bytes, size_t len);
|
2017-07-17 08:21:39 +00:00
|
|
|
void verifyBinary(const crypto::rsa::sRsa2048Key& key);
|
|
|
|
|
|
|
|
// 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
|
|
|
|
fnd::MemoryBlob mBinaryBlob;
|
|
|
|
|
|
|
|
// variables
|
|
|
|
crypto::rsa::sRsa2048Key mEmbeddedPublicKey;
|
|
|
|
|
|
|
|
bool isEqual(const AcidBinary& other) const;
|
|
|
|
void copyFrom(const AcidBinary& other);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|