From 47ccf486823fc707139285e9cd30b4d06516bd36 Mon Sep 17 00:00:00 2001 From: "Sergey A. Novitsky" Date: Wed, 13 Dec 2017 16:23:30 +0100 Subject: [PATCH 1/3] Made ASN1Object an open class --- ASN1Decoder/ASN1Object.swift | 2 +- ASN1Decoder/Asn1Decoder.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ASN1Decoder/ASN1Object.swift b/ASN1Decoder/ASN1Object.swift index 077f4d3..9749725 100644 --- a/ASN1Decoder/ASN1Object.swift +++ b/ASN1Decoder/ASN1Object.swift @@ -25,7 +25,7 @@ import Foundation -public class ASN1Object : CustomStringConvertible { +open class ASN1Object : CustomStringConvertible { init() { } diff --git a/ASN1Decoder/Asn1Decoder.swift b/ASN1Decoder/Asn1Decoder.swift index 657b9cf..2466f22 100644 --- a/ASN1Decoder/Asn1Decoder.swift +++ b/ASN1Decoder/Asn1Decoder.swift @@ -24,7 +24,7 @@ import Foundation -public class ASN1DERDecoder { +open class ASN1DERDecoder { public static func decode(data: Data) throws -> [ASN1Object] { var iterator = data.makeIterator() From f17ba6c8f63748c6c285652d011a2ccbe14f1c06 Mon Sep 17 00:00:00 2001 From: "Sergey A. Novitsky" Date: Wed, 13 Dec 2017 17:47:20 +0100 Subject: [PATCH 2/3] Made some fields public --- ASN1Decoder/ASN1Identifier.swift | 4 ++-- ASN1Decoder/ASN1Object.swift | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ASN1Decoder/ASN1Identifier.swift b/ASN1Decoder/ASN1Identifier.swift index 1c36314..9afa36c 100644 --- a/ASN1Decoder/ASN1Identifier.swift +++ b/ASN1Decoder/ASN1Identifier.swift @@ -24,7 +24,7 @@ import Foundation -class ASN1Identifier : CustomStringConvertible { +public class ASN1Identifier : CustomStringConvertible { enum Class : UInt8 { case universal = 0x00 @@ -93,7 +93,7 @@ class ASN1Identifier : CustomStringConvertible { return TagNumber(rawValue: rawValue & 0x1F) ?? .endOfContent } - var description: String { + public var description: String { if typeClass() == .universal { return String(describing: tagNumber()) } diff --git a/ASN1Decoder/ASN1Object.swift b/ASN1Decoder/ASN1Object.swift index 9749725..520fbf5 100644 --- a/ASN1Decoder/ASN1Object.swift +++ b/ASN1Decoder/ASN1Object.swift @@ -30,15 +30,15 @@ open class ASN1Object : CustomStringConvertible { init() { } - var rawValue: Data? + public internal(set) var rawValue: Data? - var identifier: ASN1Identifier? + public internal(set) var identifier: ASN1Identifier? - var value: Any? + public internal(set) var value: Any? - var sub: [ASN1Object]? + public internal(set) var sub: [ASN1Object]? - weak var parent: ASN1Object? + public internal(set) weak var parent: ASN1Object? func sub(_ index: Int) -> ASN1Object? { From 13ed1ee0dbeb098ccc42af77b24ab83e01eb928d Mon Sep 17 00:00:00 2001 From: Werner Altewischer Date: Tue, 26 Mar 2019 10:31:16 +0100 Subject: [PATCH 3/3] Only allow APIs which are safe for use in application extensions --- ASN1Decoder.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ASN1Decoder.xcodeproj/project.pbxproj b/ASN1Decoder.xcodeproj/project.pbxproj index ceee68b..2a19c54 100644 --- a/ASN1Decoder.xcodeproj/project.pbxproj +++ b/ASN1Decoder.xcodeproj/project.pbxproj @@ -347,6 +347,7 @@ 412A9E4D1F55C6500099110C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -371,6 +372,7 @@ 412A9E4E1F55C6500099110C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";