2018-07-10 15:01:34 +00:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include <fnd/types.h>
|
|
|
|
#include <fnd/IFile.h>
|
2018-09-23 03:29:22 +00:00
|
|
|
#include <fnd/SharedPtr.h>
|
2018-07-10 15:01:34 +00:00
|
|
|
#include <fnd/Vec.h>
|
2018-08-07 07:17:51 +00:00
|
|
|
#include <nn/pki/SignedData.h>
|
|
|
|
#include <nn/pki/CertificateBody.h>
|
|
|
|
#include <nn/es/TicketBody_V2.h>
|
2018-08-21 12:03:19 +00:00
|
|
|
#include "KeyConfiguration.h"
|
2018-09-13 11:06:48 +00:00
|
|
|
#include "common.h"
|
2018-07-10 15:01:34 +00:00
|
|
|
|
|
|
|
class EsTikProcess
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
EsTikProcess();
|
|
|
|
|
|
|
|
void process();
|
|
|
|
|
2018-09-23 03:29:22 +00:00
|
|
|
void setInputFile(const fnd::SharedPtr<fnd::IFile>& file);
|
2018-08-21 12:03:19 +00:00
|
|
|
void setKeyCfg(const KeyConfiguration& keycfg);
|
2018-08-07 08:13:18 +00:00
|
|
|
void setCertificateChain(const fnd::List<nn::pki::SignedData<nn::pki::CertificateBody>>& certs);
|
2018-07-10 15:01:34 +00:00
|
|
|
void setCliOutputMode(CliOutputMode mode);
|
|
|
|
void setVerifyMode(bool verify);
|
|
|
|
|
|
|
|
private:
|
|
|
|
const std::string kModuleName = "EsTikProcess";
|
|
|
|
|
2018-09-23 03:29:22 +00:00
|
|
|
fnd::SharedPtr<fnd::IFile> mFile;
|
2018-08-21 12:03:19 +00:00
|
|
|
KeyConfiguration mKeyCfg;
|
2018-07-10 15:01:34 +00:00
|
|
|
CliOutputMode mCliOutputMode;
|
|
|
|
bool mVerify;
|
2018-08-06 11:36:42 +00:00
|
|
|
|
2018-08-07 08:13:18 +00:00
|
|
|
fnd::List<nn::pki::SignedData<nn::pki::CertificateBody>> mCerts;
|
2018-07-10 15:01:34 +00:00
|
|
|
|
2018-08-07 08:13:18 +00:00
|
|
|
nn::pki::SignedData<nn::es::TicketBody_V2> mTik;
|
2018-07-10 15:01:34 +00:00
|
|
|
|
2018-08-06 11:36:42 +00:00
|
|
|
void importTicket();
|
|
|
|
void verifyTicket();
|
2018-07-10 15:01:34 +00:00
|
|
|
void displayTicket();
|
2018-07-29 12:01:11 +00:00
|
|
|
const char* getSignTypeStr(uint32_t type) const;
|
2018-07-10 15:01:34 +00:00
|
|
|
const char* getTitleKeyPersonalisationStr(byte_t flag) const;
|
|
|
|
const char* getLicenseTypeStr(byte_t flag) const;
|
|
|
|
const char* getPropertyFlagStr(byte_t flag) const;
|
|
|
|
};
|