blob: fc8525801949e1fc4b8db76be179f5cfbd4cd635 [file] [log] [blame]
// NOLINTBEGIN
#pragma once
#include <cstdint>
#include <nlohmann/json.hpp>
namespace certificate
{
// clang-format off
enum class CertificateType : std::uint8_t{
Invalid,
PEM,
PEMchain,
PKCS7,
};
enum class KeyUsage : std::uint8_t{
Invalid,
DigitalSignature,
NonRepudiation,
KeyEncipherment,
DataEncipherment,
KeyAgreement,
KeyCertSign,
CRLSigning,
EncipherOnly,
DecipherOnly,
ServerAuthentication,
ClientAuthentication,
CodeSigning,
EmailProtection,
Timestamping,
OCSPSigning,
};
enum class CertificateUsageType : std::uint8_t{
Invalid,
User,
Web,
SSH,
Device,
Platform,
BIOS,
};
NLOHMANN_JSON_SERIALIZE_ENUM(CertificateType, {
{CertificateType::Invalid, "Invalid"},
{CertificateType::PEM, "PEM"},
{CertificateType::PEMchain, "PEMchain"},
{CertificateType::PKCS7, "PKCS7"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(KeyUsage, {
{KeyUsage::Invalid, "Invalid"},
{KeyUsage::DigitalSignature, "DigitalSignature"},
{KeyUsage::NonRepudiation, "NonRepudiation"},
{KeyUsage::KeyEncipherment, "KeyEncipherment"},
{KeyUsage::DataEncipherment, "DataEncipherment"},
{KeyUsage::KeyAgreement, "KeyAgreement"},
{KeyUsage::KeyCertSign, "KeyCertSign"},
{KeyUsage::CRLSigning, "CRLSigning"},
{KeyUsage::EncipherOnly, "EncipherOnly"},
{KeyUsage::DecipherOnly, "DecipherOnly"},
{KeyUsage::ServerAuthentication, "ServerAuthentication"},
{KeyUsage::ClientAuthentication, "ClientAuthentication"},
{KeyUsage::CodeSigning, "CodeSigning"},
{KeyUsage::EmailProtection, "EmailProtection"},
{KeyUsage::Timestamping, "Timestamping"},
{KeyUsage::OCSPSigning, "OCSPSigning"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(CertificateUsageType, {
{CertificateUsageType::Invalid, "Invalid"},
{CertificateUsageType::User, "User"},
{CertificateUsageType::Web, "Web"},
{CertificateUsageType::SSH, "SSH"},
{CertificateUsageType::Device, "Device"},
{CertificateUsageType::Platform, "Platform"},
{CertificateUsageType::BIOS, "BIOS"},
});
} // namespace certificate
// clang-format on
// NOLINTEND