Refactor code - Add Signature class

This commit is contained in:
Pengfei
2021-07-30 14:47:53 +08:00
parent 15b1af7dd1
commit d14ea03271
11 changed files with 195 additions and 177 deletions
-28
View File
@@ -9,34 +9,6 @@
namespace Core {
enum TMDSignatureType : u32 {
Rsa4096Sha1 = 0x10000,
Rsa2048Sha1 = 0x10001,
EllipticSha1 = 0x10002,
Rsa4096Sha256 = 0x10003,
Rsa2048Sha256 = 0x10004,
EcdsaSha256 = 0x10005
};
inline u32 GetSignatureSize(u32 signature_type) {
switch (signature_type) {
case Rsa4096Sha1:
case Rsa4096Sha256:
return 0x200;
case Rsa2048Sha1:
case Rsa2048Sha256:
return 0x100;
case EllipticSha1:
case EcdsaSha256:
return 0x3C;
}
LOG_ERROR(Common_Filesystem, "Tried to read ticket with bad signature {}", signature_type);
return 0;
}
/// Full names of the certificates contained in a CIA.
constexpr std::array<const char*, 3> CIACertNames{{
"Root-CA00000003",