1 #pragma once 2 #include <nlohmann/json.hpp> 3 4 namespace key_policy 5 { 6 // clang-format off 7 8 enum class KeyPolicyType{ 9 Invalid, 10 NVMeoF, 11 }; 12 13 enum class NVMeoFSecurityProtocolType{ 14 Invalid, 15 DHHC, 16 TLS_PSK, 17 OEM, 18 }; 19 20 enum class NVMeoFSecureHashType{ 21 Invalid, 22 SHA256, 23 SHA384, 24 SHA512, 25 }; 26 27 enum class NVMeoFSecurityTransportType{ 28 Invalid, 29 TLSv2, 30 TLSv3, 31 }; 32 33 enum class NVMeoFCipherSuiteType{ 34 Invalid, 35 TLS_AES_128_GCM_SHA256, 36 TLS_AES_256_GCM_SHA384, 37 }; 38 39 enum class NVMeoFDHGroupType{ 40 Invalid, 41 FFDHE2048, 42 FFDHE3072, 43 FFDHE4096, 44 FFDHE6144, 45 FFDHE8192, 46 }; 47 48 NLOHMANN_JSON_SERIALIZE_ENUM(KeyPolicyType, { 49 {KeyPolicyType::Invalid, "Invalid"}, 50 {KeyPolicyType::NVMeoF, "NVMeoF"}, 51 }); 52 53 NLOHMANN_JSON_SERIALIZE_ENUM(NVMeoFSecurityProtocolType, { 54 {NVMeoFSecurityProtocolType::Invalid, "Invalid"}, 55 {NVMeoFSecurityProtocolType::DHHC, "DHHC"}, 56 {NVMeoFSecurityProtocolType::TLS_PSK, "TLS_PSK"}, 57 {NVMeoFSecurityProtocolType::OEM, "OEM"}, 58 }); 59 60 NLOHMANN_JSON_SERIALIZE_ENUM(NVMeoFSecureHashType, { 61 {NVMeoFSecureHashType::Invalid, "Invalid"}, 62 {NVMeoFSecureHashType::SHA256, "SHA256"}, 63 {NVMeoFSecureHashType::SHA384, "SHA384"}, 64 {NVMeoFSecureHashType::SHA512, "SHA512"}, 65 }); 66 67 NLOHMANN_JSON_SERIALIZE_ENUM(NVMeoFSecurityTransportType, { 68 {NVMeoFSecurityTransportType::Invalid, "Invalid"}, 69 {NVMeoFSecurityTransportType::TLSv2, "TLSv2"}, 70 {NVMeoFSecurityTransportType::TLSv3, "TLSv3"}, 71 }); 72 73 NLOHMANN_JSON_SERIALIZE_ENUM(NVMeoFCipherSuiteType, { 74 {NVMeoFCipherSuiteType::Invalid, "Invalid"}, 75 {NVMeoFCipherSuiteType::TLS_AES_128_GCM_SHA256, "TLS_AES_128_GCM_SHA256"}, 76 {NVMeoFCipherSuiteType::TLS_AES_256_GCM_SHA384, "TLS_AES_256_GCM_SHA384"}, 77 }); 78 79 NLOHMANN_JSON_SERIALIZE_ENUM(NVMeoFDHGroupType, { 80 {NVMeoFDHGroupType::Invalid, "Invalid"}, 81 {NVMeoFDHGroupType::FFDHE2048, "FFDHE2048"}, 82 {NVMeoFDHGroupType::FFDHE3072, "FFDHE3072"}, 83 {NVMeoFDHGroupType::FFDHE4096, "FFDHE4096"}, 84 {NVMeoFDHGroupType::FFDHE6144, "FFDHE6144"}, 85 {NVMeoFDHGroupType::FFDHE8192, "FFDHE8192"}, 86 }); 87 88 } 89 // clang-format on 90