2018-07-10 15:01:34 +00:00
|
|
|
#pragma once
|
2021-09-28 11:15:54 +00:00
|
|
|
#include "types.h"
|
|
|
|
#include "KeyBag.h"
|
|
|
|
|
2022-06-29 13:19:36 +00:00
|
|
|
#include <pietendo/hac/es/SignedData.h>
|
|
|
|
#include <pietendo/hac/es/CertificateBody.h>
|
2021-09-28 11:15:54 +00:00
|
|
|
|
|
|
|
namespace nstool {
|
2018-07-10 15:01:34 +00:00
|
|
|
|
2021-10-16 08:00:17 +00:00
|
|
|
class EsCertProcess
|
2018-07-10 15:01:34 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-10-16 08:00:17 +00:00
|
|
|
EsCertProcess();
|
2018-07-10 15:01:34 +00:00
|
|
|
|
|
|
|
void process();
|
|
|
|
|
2021-09-28 11:15:54 +00:00
|
|
|
void setInputFile(const std::shared_ptr<tc::io::IStream>& file);
|
|
|
|
void setKeyCfg(const KeyBag& keycfg);
|
2018-07-10 15:01:34 +00:00
|
|
|
void setCliOutputMode(CliOutputMode type);
|
|
|
|
void setVerifyMode(bool verify);
|
|
|
|
|
|
|
|
private:
|
2021-10-10 09:22:55 +00:00
|
|
|
std::string mModuleName;
|
2018-07-10 15:01:34 +00:00
|
|
|
|
2021-09-28 11:15:54 +00:00
|
|
|
std::shared_ptr<tc::io::IStream> mFile;
|
|
|
|
KeyBag mKeyCfg;
|
2018-07-10 15:01:34 +00:00
|
|
|
CliOutputMode mCliOutputMode;
|
|
|
|
bool mVerify;
|
|
|
|
|
2022-06-29 13:19:36 +00:00
|
|
|
std::vector<pie::hac::es::SignedData<pie::hac::es::CertificateBody>> mCert;
|
2018-07-10 15:01:34 +00:00
|
|
|
|
|
|
|
void importCerts();
|
|
|
|
void validateCerts();
|
|
|
|
void displayCerts();
|
2022-06-29 13:19:36 +00:00
|
|
|
void displayCert(const pie::hac::es::SignedData<pie::hac::es::CertificateBody>& cert);
|
2018-07-10 15:01:34 +00:00
|
|
|
|
2022-06-29 13:19:36 +00:00
|
|
|
std::string getSignTypeStr(pie::hac::es::sign::SignatureId type) const;
|
2021-10-10 09:22:55 +00:00
|
|
|
std::string getEndiannessStr(bool isLittleEndian) const;
|
2022-06-29 13:19:36 +00:00
|
|
|
std::string getPublicKeyTypeStr(pie::hac::es::cert::PublicKeyType type) const;
|
2021-09-28 11:15:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|