nstool/src/PkiCertProcess.h

42 lines
954 B
C
Raw Normal View History

#pragma once
#include "types.h"
#include "KeyBag.h"
2018-08-07 07:17:51 +00:00
#include <nn/pki/SignedData.h>
#include <nn/pki/CertificateBody.h>
namespace nstool {
class PkiCertProcess
{
public:
PkiCertProcess();
void process();
void setInputFile(const std::shared_ptr<tc::io::IStream>& file);
void setKeyCfg(const KeyBag& keycfg);
void setCliOutputMode(CliOutputMode type);
void setVerifyMode(bool verify);
private:
2021-10-10 09:22:55 +00:00
std::string mModuleName;
std::shared_ptr<tc::io::IStream> mFile;
KeyBag mKeyCfg;
CliOutputMode mCliOutputMode;
bool mVerify;
std::vector<nn::pki::SignedData<nn::pki::CertificateBody>> mCert;
void importCerts();
void validateCerts();
void displayCerts();
2018-08-07 08:13:18 +00:00
void displayCert(const nn::pki::SignedData<nn::pki::CertificateBody>& cert);
2021-10-10 09:22:55 +00:00
std::string getSignTypeStr(nn::pki::sign::SignatureId type) const;
std::string getEndiannessStr(bool isLittleEndian) const;
std::string getPublicKeyTypeStr(nn::pki::cert::PublicKeyType type) const;
};
}