summaryrefslogtreecommitdiff
path: root/redfish-core/include/generated/enums/certificate.hpp
blob: 6c31b3a7eda4dc0c265451992d0625abe632910b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright OpenBMC Authors
#pragma once
#include <nlohmann/json.hpp>

namespace certificate
{
// clang-format off

enum class CertificateType{
    Invalid,
    PEM,
    PEMchain,
    PKCS7,
    PKCS12,
};

enum class CertificateUsageType{
    Invalid,
    User,
    Web,
    SSH,
    Device,
    Platform,
    BIOS,
    IDevID,
    LDevID,
    IAK,
    LAK,
    EK,
};

enum class KeyUsage{
    Invalid,
    DigitalSignature,
    NonRepudiation,
    KeyEncipherment,
    DataEncipherment,
    KeyAgreement,
    KeyCertSign,
    CRLSigning,
    EncipherOnly,
    DecipherOnly,
    ServerAuthentication,
    ClientAuthentication,
    CodeSigning,
    EmailProtection,
    Timestamping,
    OCSPSigning,
};

NLOHMANN_JSON_SERIALIZE_ENUM(CertificateType, {
    {CertificateType::Invalid, "Invalid"},
    {CertificateType::PEM, "PEM"},
    {CertificateType::PEMchain, "PEMchain"},
    {CertificateType::PKCS7, "PKCS7"},
    {CertificateType::PKCS12, "PKCS12"},
});

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"},
    {CertificateUsageType::IDevID, "IDevID"},
    {CertificateUsageType::LDevID, "LDevID"},
    {CertificateUsageType::IAK, "IAK"},
    {CertificateUsageType::LAK, "LAK"},
    {CertificateUsageType::EK, "EK"},
});

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"},
});

// clang-format on
} // namespace certificate