10ec8b83dSEd Tanous #pragma once 20ec8b83dSEd Tanous #include <nlohmann/json.hpp> 30ec8b83dSEd Tanous 40ec8b83dSEd Tanous namespace certificate 50ec8b83dSEd Tanous { 60ec8b83dSEd Tanous // clang-format off 70ec8b83dSEd Tanous 80ec8b83dSEd Tanous enum class CertificateType{ 90ec8b83dSEd Tanous Invalid, 100ec8b83dSEd Tanous PEM, 110ec8b83dSEd Tanous PEMchain, 120ec8b83dSEd Tanous PKCS7, 130ec8b83dSEd Tanous }; 140ec8b83dSEd Tanous 150ec8b83dSEd Tanous enum class KeyUsage{ 160ec8b83dSEd Tanous Invalid, 170ec8b83dSEd Tanous DigitalSignature, 180ec8b83dSEd Tanous NonRepudiation, 190ec8b83dSEd Tanous KeyEncipherment, 200ec8b83dSEd Tanous DataEncipherment, 210ec8b83dSEd Tanous KeyAgreement, 220ec8b83dSEd Tanous KeyCertSign, 230ec8b83dSEd Tanous CRLSigning, 240ec8b83dSEd Tanous EncipherOnly, 250ec8b83dSEd Tanous DecipherOnly, 260ec8b83dSEd Tanous ServerAuthentication, 270ec8b83dSEd Tanous ClientAuthentication, 280ec8b83dSEd Tanous CodeSigning, 290ec8b83dSEd Tanous EmailProtection, 300ec8b83dSEd Tanous Timestamping, 310ec8b83dSEd Tanous OCSPSigning, 320ec8b83dSEd Tanous }; 330ec8b83dSEd Tanous 340ec8b83dSEd Tanous enum class CertificateUsageType{ 350ec8b83dSEd Tanous Invalid, 360ec8b83dSEd Tanous User, 370ec8b83dSEd Tanous Web, 380ec8b83dSEd Tanous SSH, 390ec8b83dSEd Tanous Device, 400ec8b83dSEd Tanous Platform, 410ec8b83dSEd Tanous BIOS, 42e9cc1bc9SEd Tanous IDevID, 43e9cc1bc9SEd Tanous LDevID, 44e9cc1bc9SEd Tanous IAK, 45e9cc1bc9SEd Tanous LAK, 46*dd5c81e9SGunnar Mills EK, 470ec8b83dSEd Tanous }; 480ec8b83dSEd Tanous 490ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(CertificateType, { 500ec8b83dSEd Tanous {CertificateType::Invalid, "Invalid"}, 510ec8b83dSEd Tanous {CertificateType::PEM, "PEM"}, 520ec8b83dSEd Tanous {CertificateType::PEMchain, "PEMchain"}, 530ec8b83dSEd Tanous {CertificateType::PKCS7, "PKCS7"}, 540ec8b83dSEd Tanous }); 550ec8b83dSEd Tanous 560ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(KeyUsage, { 570ec8b83dSEd Tanous {KeyUsage::Invalid, "Invalid"}, 580ec8b83dSEd Tanous {KeyUsage::DigitalSignature, "DigitalSignature"}, 590ec8b83dSEd Tanous {KeyUsage::NonRepudiation, "NonRepudiation"}, 600ec8b83dSEd Tanous {KeyUsage::KeyEncipherment, "KeyEncipherment"}, 610ec8b83dSEd Tanous {KeyUsage::DataEncipherment, "DataEncipherment"}, 620ec8b83dSEd Tanous {KeyUsage::KeyAgreement, "KeyAgreement"}, 630ec8b83dSEd Tanous {KeyUsage::KeyCertSign, "KeyCertSign"}, 640ec8b83dSEd Tanous {KeyUsage::CRLSigning, "CRLSigning"}, 650ec8b83dSEd Tanous {KeyUsage::EncipherOnly, "EncipherOnly"}, 660ec8b83dSEd Tanous {KeyUsage::DecipherOnly, "DecipherOnly"}, 670ec8b83dSEd Tanous {KeyUsage::ServerAuthentication, "ServerAuthentication"}, 680ec8b83dSEd Tanous {KeyUsage::ClientAuthentication, "ClientAuthentication"}, 690ec8b83dSEd Tanous {KeyUsage::CodeSigning, "CodeSigning"}, 700ec8b83dSEd Tanous {KeyUsage::EmailProtection, "EmailProtection"}, 710ec8b83dSEd Tanous {KeyUsage::Timestamping, "Timestamping"}, 720ec8b83dSEd Tanous {KeyUsage::OCSPSigning, "OCSPSigning"}, 730ec8b83dSEd Tanous }); 740ec8b83dSEd Tanous 750ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(CertificateUsageType, { 760ec8b83dSEd Tanous {CertificateUsageType::Invalid, "Invalid"}, 770ec8b83dSEd Tanous {CertificateUsageType::User, "User"}, 780ec8b83dSEd Tanous {CertificateUsageType::Web, "Web"}, 790ec8b83dSEd Tanous {CertificateUsageType::SSH, "SSH"}, 800ec8b83dSEd Tanous {CertificateUsageType::Device, "Device"}, 810ec8b83dSEd Tanous {CertificateUsageType::Platform, "Platform"}, 820ec8b83dSEd Tanous {CertificateUsageType::BIOS, "BIOS"}, 83e9cc1bc9SEd Tanous {CertificateUsageType::IDevID, "IDevID"}, 84e9cc1bc9SEd Tanous {CertificateUsageType::LDevID, "LDevID"}, 85e9cc1bc9SEd Tanous {CertificateUsageType::IAK, "IAK"}, 86e9cc1bc9SEd Tanous {CertificateUsageType::LAK, "LAK"}, 87*dd5c81e9SGunnar Mills {CertificateUsageType::EK, "EK"}, 880ec8b83dSEd Tanous }); 890ec8b83dSEd Tanous 900ec8b83dSEd Tanous } 910ec8b83dSEd Tanous // clang-format on 92