From b1f2bf51efdf33848856fbd6684510708c633e17 Mon Sep 17 00:00:00 2001 From: Paul Flynn Date: Tue, 2 Jul 2024 23:45:41 -0400 Subject: [PATCH] Update Policy struct in NanoTDF.swift The Policy struct in the NanoTDF.swift file has been modified. The internal 'PolicyType' enum has been made public to increase its accessibility. Additionally, a public initializer has been introduced to streamline the creation of Policy instances. --- OpenTDFKit/NanoTDF.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OpenTDFKit/NanoTDF.swift b/OpenTDFKit/NanoTDF.swift index 4e8c9d3..3aa2c81 100644 --- a/OpenTDFKit/NanoTDF.swift +++ b/OpenTDFKit/NanoTDF.swift @@ -168,7 +168,7 @@ public struct ResourceLocator { } public struct Policy { - enum PolicyType: UInt8 { + public enum PolicyType: UInt8 { case remote = 0x00 case embeddedPlaintext = 0x01 case embeddedEncrypted = 0x02 @@ -180,6 +180,13 @@ public struct Policy { let body: EmbeddedPolicyBody? let remote: ResourceLocator? var binding: Data? + + public init(type: PolicyType, body: EmbeddedPolicyBody?, remote: ResourceLocator?, binding: Data? = nil) { + self.type = type + self.body = body + self.remote = remote + self.binding = binding + } func toData() -> Data { var data = Data()