#include #include #include #include #include int main() { Void::Security::SecretKeyRing ring; if (!ring.generate_and_add_key("v1", true).has_value()) { return 1; } const std::vector pt{'o', 'k'}; auto env = ring.seal(pt); if (!env.has_value()) { return 2; } auto dec = ring.open(*env); if (!dec.has_value() || dec->size() != pt.size()) { return 3; } auto policy = Void::Security::PolicySnapshot::create(1, {}); if (!policy.has_value()) { return 4; } const Void::Security::Principal p{.subject = "u1"}; const Void::Security::ResourceAttributes r{.resource_type = "doc"}; if (policy->authorize(p, "read", r).allowed) { return 5; } return 0; }