Adrien Béraud | 612b55b | 2023-05-29 10:42:04 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2004-2023 Savoir-faire Linux Inc. |
| 3 | * |
Adrien Béraud | cb75362 | 2023-07-17 22:32:49 -0400 | [diff] [blame] | 4 | * This program is free software: you can redistribute it and/or modify |
Adrien Béraud | 612b55b | 2023-05-29 10:42:04 -0400 | [diff] [blame] | 5 | * it under the terms of the GNU General Public License as published by |
Adrien Béraud | cb75362 | 2023-07-17 22:32:49 -0400 | [diff] [blame] | 6 | * the Free Software Foundation, either version 3 of the License, or |
Adrien Béraud | 612b55b | 2023-05-29 10:42:04 -0400 | [diff] [blame] | 7 | * (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éraud | cb75362 | 2023-07-17 22:32:49 -0400 | [diff] [blame] | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Adrien Béraud | 612b55b | 2023-05-29 10:42:04 -0400 | [diff] [blame] | 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
Adrien Béraud | cb75362 | 2023-07-17 22:32:49 -0400 | [diff] [blame] | 15 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
Adrien Béraud | 612b55b | 2023-05-29 10:42:04 -0400 | [diff] [blame] | 16 | */ |
| 17 | #pragma once |
| 18 | |
Adrien Béraud | 1ae60aa | 2023-07-07 09:55:09 -0400 | [diff] [blame] | 19 | namespace libdhtnet { |
Adrien Béraud | 612b55b | 2023-05-29 10:42:04 -0400 | [diff] [blame] | 20 | |
| 21 | namespace Certificate { |
| 22 | |
| 23 | namespace Status { |
| 24 | constexpr static char UNDEFINED[] = "UNDEFINED"; |
| 25 | constexpr static char ALLOWED[] = "ALLOWED"; |
| 26 | constexpr static char BANNED[] = "BANNED"; |
| 27 | } // namespace Status |
| 28 | |
| 29 | namespace TrustStatus { |
| 30 | constexpr static char UNTRUSTED[] = "UNTRUSTED"; |
| 31 | constexpr static char TRUSTED[] = "TRUSTED"; |
| 32 | } // namespace TrustStatus |
| 33 | |
| 34 | /** |
| 35 | * Those constantes are used by the ConfigurationManager.validateCertificate method |
| 36 | */ |
| 37 | namespace ChecksNames { |
| 38 | constexpr static char HAS_PRIVATE_KEY[] = "HAS_PRIVATE_KEY"; |
| 39 | constexpr static char EXPIRED[] = "EXPIRED"; |
| 40 | constexpr static char STRONG_SIGNING[] = "STRONG_SIGNING"; |
| 41 | constexpr static char NOT_SELF_SIGNED[] = "NOT_SELF_SIGNED"; |
| 42 | constexpr static char KEY_MATCH[] = "KEY_MATCH"; |
| 43 | constexpr static char PRIVATE_KEY_STORAGE_PERMISSION[] = "PRIVATE_KEY_STORAGE_PERMISSION"; |
| 44 | constexpr static char PUBLIC_KEY_STORAGE_PERMISSION[] = "PUBLIC_KEY_STORAGE_PERMISSION"; |
| 45 | constexpr static char PRIVATE_KEY_DIRECTORY_PERMISSIONS[] = "PRIVATEKEY_DIRECTORY_PERMISSIONS"; |
| 46 | constexpr static char PUBLIC_KEY_DIRECTORY_PERMISSIONS[] = "PUBLICKEY_DIRECTORY_PERMISSIONS"; |
| 47 | constexpr static char PRIVATE_KEY_STORAGE_LOCATION[] = "PRIVATE_KEY_STORAGE_LOCATION"; |
| 48 | constexpr static char PUBLIC_KEY_STORAGE_LOCATION[] = "PUBLIC_KEY_STORAGE_LOCATION"; |
| 49 | constexpr static char PRIVATE_KEY_SELINUX_ATTRIBUTES[] = "PRIVATE_KEY_SELINUX_ATTRIBUTES"; |
| 50 | constexpr static char PUBLIC_KEY_SELINUX_ATTRIBUTES[] = "PUBLIC_KEY_SELINUX_ATTRIBUTES"; |
| 51 | constexpr static char EXIST[] = "EXIST"; |
| 52 | constexpr static char VALID[] = "VALID"; |
| 53 | constexpr static char VALID_AUTHORITY[] = "VALID_AUTHORITY"; |
| 54 | constexpr static char KNOWN_AUTHORITY[] = "KNOWN_AUTHORITY"; |
| 55 | constexpr static char NOT_REVOKED[] = "NOT_REVOKED"; |
| 56 | constexpr static char AUTHORITY_MISMATCH[] = "AUTHORITY_MISMATCH"; |
| 57 | constexpr static char UNEXPECTED_OWNER[] = "UNEXPECTED_OWNER"; |
| 58 | constexpr static char NOT_ACTIVATED[] = "NOT_ACTIVATED"; |
| 59 | } // namespace ChecksNames |
| 60 | |
| 61 | /** |
| 62 | * Those constants are used by the ConfigurationManager.getCertificateDetails method |
| 63 | */ |
| 64 | namespace DetailsNames { |
| 65 | constexpr static char EXPIRATION_DATE[] = "EXPIRATION_DATE"; |
| 66 | constexpr static char ACTIVATION_DATE[] = "ACTIVATION_DATE"; |
| 67 | constexpr static char REQUIRE_PRIVATE_KEY_PASSWORD[] = "REQUIRE_PRIVATE_KEY_PASSWORD"; |
| 68 | constexpr static char PUBLIC_SIGNATURE[] = "PUBLIC_SIGNATURE"; |
| 69 | constexpr static char VERSION_NUMBER[] = "VERSION_NUMBER"; |
| 70 | constexpr static char SERIAL_NUMBER[] = "SERIAL_NUMBER"; |
| 71 | constexpr static char ISSUER[] = "ISSUER"; |
| 72 | constexpr static char SUBJECT_KEY_ALGORITHM[] = "SUBJECT_KEY_ALGORITHM"; |
| 73 | constexpr static char CN[] = "CN"; |
| 74 | constexpr static char N[] = "N"; |
| 75 | constexpr static char O[] = "O"; |
| 76 | constexpr static char SIGNATURE_ALGORITHM[] = "SIGNATURE_ALGORITHM"; |
| 77 | constexpr static char MD5_FINGERPRINT[] = "MD5_FINGERPRINT"; |
| 78 | constexpr static char SHA1_FINGERPRINT[] = "SHA1_FINGERPRINT"; |
| 79 | constexpr static char PUBLIC_KEY_ID[] = "PUBLIC_KEY_ID"; |
| 80 | constexpr static char ISSUER_DN[] = "ISSUER_DN"; |
| 81 | constexpr static char NEXT_EXPECTED_UPDATE_DATE[] = "NEXT_EXPECTED_UPDATE_DATE"; |
| 82 | constexpr static char OUTGOING_SERVER[] = "OUTGOING_SERVER"; |
| 83 | constexpr 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 | */ |
| 90 | namespace ChecksValuesTypesNames { |
| 91 | constexpr static char BOOLEAN[] = "BOOLEAN"; |
| 92 | constexpr static char ISO_DATE[] = "ISO_DATE"; |
| 93 | constexpr static char CUSTOM[] = "CUSTOM"; |
| 94 | constexpr static char NUMBER[] = "NUMBER"; |
| 95 | } // namespace ChecksValuesTypesNames |
| 96 | |
| 97 | /** |
| 98 | * Those constantes are used by the ConfigurationManager.validateCertificate method |
| 99 | */ |
| 100 | namespace CheckValuesNames { |
| 101 | constexpr static char PASSED[] = "PASSED"; |
| 102 | constexpr static char FAILED[] = "FAILED"; |
| 103 | constexpr static char UNSUPPORTED[] = "UNSUPPORTED"; |
| 104 | constexpr static char ISO_DATE[] = "ISO_DATE"; |
| 105 | constexpr static char CUSTOM[] = "CUSTOM"; |
| 106 | constexpr static char DATE[] = "DATE"; |
| 107 | } // namespace CheckValuesNames |
| 108 | |
| 109 | } // namespace Certificate |
| 110 | |
| 111 | namespace TlsTransport { |
| 112 | constexpr static char TLS_PEER_CERT[] = "TLS_PEER_CERT"; |
| 113 | constexpr static char TLS_PEER_CA_NUM[] = "TLS_PEER_CA_NUM"; |
| 114 | constexpr static char TLS_PEER_CA_[] = "TLS_PEER_CA_"; |
| 115 | constexpr static char TLS_CIPHER[] = "TLS_CIPHER"; |
| 116 | } // namespace TlsTransport |
| 117 | |
Adrien Béraud | 1ae60aa | 2023-07-07 09:55:09 -0400 | [diff] [blame] | 118 | } // namespace libdhtnet |