blob: 0873e1b071e26643d7f91d0f2ab07a901f6762da [file] [log] [blame]
Adrien Béraud612b55b2023-05-29 10:42:04 -04001/*
2 * Copyright (C) 2004-2023 Savoir-faire Linux Inc.
3 *
Adrien Béraudcb753622023-07-17 22:32:49 -04004 * This program is free software: you can redistribute it and/or modify
Adrien Béraud612b55b2023-05-29 10:42:04 -04005 * it under the terms of the GNU General Public License as published by
Adrien Béraudcb753622023-07-17 22:32:49 -04006 * the Free Software Foundation, either version 3 of the License, or
Adrien Béraud612b55b2023-05-29 10:42:04 -04007 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Adrien Béraudcb753622023-07-17 22:32:49 -040011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Adrien Béraud612b55b2023-05-29 10:42:04 -040012 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
Adrien Béraudcb753622023-07-17 22:32:49 -040015 * along with this program. If not, see <https://www.gnu.org/licenses/>.
Adrien Béraud612b55b2023-05-29 10:42:04 -040016 */
17#pragma once
18
Adrien Béraud1ae60aa2023-07-07 09:55:09 -040019namespace libdhtnet {
Adrien Béraud612b55b2023-05-29 10:42:04 -040020
21namespace Certificate {
22
23namespace Status {
24constexpr static char UNDEFINED[] = "UNDEFINED";
25constexpr static char ALLOWED[] = "ALLOWED";
26constexpr static char BANNED[] = "BANNED";
27} // namespace Status
28
29namespace TrustStatus {
30constexpr static char UNTRUSTED[] = "UNTRUSTED";
31constexpr static char TRUSTED[] = "TRUSTED";
32} // namespace TrustStatus
33
34/**
35 * Those constantes are used by the ConfigurationManager.validateCertificate method
36 */
37namespace ChecksNames {
38constexpr static char HAS_PRIVATE_KEY[] = "HAS_PRIVATE_KEY";
39constexpr static char EXPIRED[] = "EXPIRED";
40constexpr static char STRONG_SIGNING[] = "STRONG_SIGNING";
41constexpr static char NOT_SELF_SIGNED[] = "NOT_SELF_SIGNED";
42constexpr static char KEY_MATCH[] = "KEY_MATCH";
43constexpr static char PRIVATE_KEY_STORAGE_PERMISSION[] = "PRIVATE_KEY_STORAGE_PERMISSION";
44constexpr static char PUBLIC_KEY_STORAGE_PERMISSION[] = "PUBLIC_KEY_STORAGE_PERMISSION";
45constexpr static char PRIVATE_KEY_DIRECTORY_PERMISSIONS[] = "PRIVATEKEY_DIRECTORY_PERMISSIONS";
46constexpr static char PUBLIC_KEY_DIRECTORY_PERMISSIONS[] = "PUBLICKEY_DIRECTORY_PERMISSIONS";
47constexpr static char PRIVATE_KEY_STORAGE_LOCATION[] = "PRIVATE_KEY_STORAGE_LOCATION";
48constexpr static char PUBLIC_KEY_STORAGE_LOCATION[] = "PUBLIC_KEY_STORAGE_LOCATION";
49constexpr static char PRIVATE_KEY_SELINUX_ATTRIBUTES[] = "PRIVATE_KEY_SELINUX_ATTRIBUTES";
50constexpr static char PUBLIC_KEY_SELINUX_ATTRIBUTES[] = "PUBLIC_KEY_SELINUX_ATTRIBUTES";
51constexpr static char EXIST[] = "EXIST";
52constexpr static char VALID[] = "VALID";
53constexpr static char VALID_AUTHORITY[] = "VALID_AUTHORITY";
54constexpr static char KNOWN_AUTHORITY[] = "KNOWN_AUTHORITY";
55constexpr static char NOT_REVOKED[] = "NOT_REVOKED";
56constexpr static char AUTHORITY_MISMATCH[] = "AUTHORITY_MISMATCH";
57constexpr static char UNEXPECTED_OWNER[] = "UNEXPECTED_OWNER";
58constexpr static char NOT_ACTIVATED[] = "NOT_ACTIVATED";
59} // namespace ChecksNames
60
61/**
62 * Those constants are used by the ConfigurationManager.getCertificateDetails method
63 */
64namespace DetailsNames {
65constexpr static char EXPIRATION_DATE[] = "EXPIRATION_DATE";
66constexpr static char ACTIVATION_DATE[] = "ACTIVATION_DATE";
67constexpr static char REQUIRE_PRIVATE_KEY_PASSWORD[] = "REQUIRE_PRIVATE_KEY_PASSWORD";
68constexpr static char PUBLIC_SIGNATURE[] = "PUBLIC_SIGNATURE";
69constexpr static char VERSION_NUMBER[] = "VERSION_NUMBER";
70constexpr static char SERIAL_NUMBER[] = "SERIAL_NUMBER";
71constexpr static char ISSUER[] = "ISSUER";
72constexpr static char SUBJECT_KEY_ALGORITHM[] = "SUBJECT_KEY_ALGORITHM";
73constexpr static char CN[] = "CN";
74constexpr static char N[] = "N";
75constexpr static char O[] = "O";
76constexpr static char SIGNATURE_ALGORITHM[] = "SIGNATURE_ALGORITHM";
77constexpr static char MD5_FINGERPRINT[] = "MD5_FINGERPRINT";
78constexpr static char SHA1_FINGERPRINT[] = "SHA1_FINGERPRINT";
79constexpr static char PUBLIC_KEY_ID[] = "PUBLIC_KEY_ID";
80constexpr static char ISSUER_DN[] = "ISSUER_DN";
81constexpr static char NEXT_EXPECTED_UPDATE_DATE[] = "NEXT_EXPECTED_UPDATE_DATE";
82constexpr static char OUTGOING_SERVER[] = "OUTGOING_SERVER";
83constexpr static char IS_CA[] = "IS_CA";
84} // namespace DetailsNames
85
86/**
87 * Those constants are used by the ConfigurationManager.getCertificateDetails and
88 * ConfigurationManager.validateCertificate methods
89 */
90namespace ChecksValuesTypesNames {
91constexpr static char BOOLEAN[] = "BOOLEAN";
92constexpr static char ISO_DATE[] = "ISO_DATE";
93constexpr static char CUSTOM[] = "CUSTOM";
94constexpr static char NUMBER[] = "NUMBER";
95} // namespace ChecksValuesTypesNames
96
97/**
98 * Those constantes are used by the ConfigurationManager.validateCertificate method
99 */
100namespace CheckValuesNames {
101constexpr static char PASSED[] = "PASSED";
102constexpr static char FAILED[] = "FAILED";
103constexpr static char UNSUPPORTED[] = "UNSUPPORTED";
104constexpr static char ISO_DATE[] = "ISO_DATE";
105constexpr static char CUSTOM[] = "CUSTOM";
106constexpr static char DATE[] = "DATE";
107} // namespace CheckValuesNames
108
109} // namespace Certificate
110
111namespace TlsTransport {
112constexpr static char TLS_PEER_CERT[] = "TLS_PEER_CERT";
113constexpr static char TLS_PEER_CA_NUM[] = "TLS_PEER_CA_NUM";
114constexpr static char TLS_PEER_CA_[] = "TLS_PEER_CA_";
115constexpr static char TLS_CIPHER[] = "TLS_CIPHER";
116} // namespace TlsTransport
117
Adrien Béraud1ae60aa2023-07-07 09:55:09 -0400118} // namespace libdhtnet