2#ifndef ZT_POLICY_ENGINE_H
3#define ZT_POLICY_ENGINE_H
6#include <unordered_map>
7#include <unordered_set>
9#include <cryptopp/rsa.h>
11using namespace CryptoPP;
43 bool Authorize(uint32_t nodeId,
const std::string& role);
55 void Revoke(uint32_t nodeId);
71 bool AuthorizeWithCert(uint32_t nodeId,
const std::string& role,
const std::string& certStr);
74 std::unordered_map<uint32_t, std::string>
authTable;
Implements policy enforcement for Zero Trust security in NS-3 simulations.
void AddAuthorized(uint32_t nodeId, const std::string &role)
Add a node to the authorized list with a specified role.
std::unordered_set< uint32_t > revoke
List of revoked node IDs.
std::unordered_map< uint32_t, std::string > authTable
Maps node ID to assigned role.
static TypeId GetTypeId()
Get the TypeId for ZtPolicyEngine.
void Revoke(uint32_t nodeId)
Add a node ID to the revocation list.
bool Authorize(uint32_t nodeId, const std::string &role)
Check if a node is authorized for a given role.
RSA::PublicKey caPublicKey
Public key for certificate signature verification.
void SetCaPublicKey(RSA::PublicKey pub)
Set the Certificate Authority's public key for verifying digital signatures.
bool AuthorizeWithCert(uint32_t nodeId, const std::string &role, const std::string &certStr)
Perform certificate-based authorization for a node.