diff --git a/Sources/X509/CMakeLists.txt b/Sources/X509/CMakeLists.txt index a0ee553..b048e08 100644 --- a/Sources/X509/CMakeLists.txt +++ b/Sources/X509/CMakeLists.txt @@ -118,6 +118,7 @@ add_library(X509 "X509BaseTypes/Time.swift" "X509BaseTypes/TimeCalculations.swift" "X509BaseTypes/Validity.swift" + "X509SendableMetatype.swift" ) target_link_libraries(X509 PUBLIC diff --git a/Sources/X509/Verifier/VerifierPolicy.swift b/Sources/X509/Verifier/VerifierPolicy.swift index c1c4e71..2826407 100644 --- a/Sources/X509/Verifier/VerifierPolicy.swift +++ b/Sources/X509/Verifier/VerifierPolicy.swift @@ -28,8 +28,9 @@ import SwiftASN1 /// the basic checks from that RFC. Other objects are less common, such as ``OCSPVerifierPolicy``, which performs live /// revocation checking. Users can also implement their own policies to enable swift-certificates to support other /// use-cases. +@preconcurrency @available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *) -public protocol VerifierPolicy { +public protocol VerifierPolicy: _X509SendableMetatype { /// The X.509 extension types that this policy understands and enforces. /// /// X.509 certificates can have extensions marked as `critical`. These extensions _must_ be understood and enforced by the diff --git a/Sources/X509/X509SendableMetatype.swift b/Sources/X509/X509SendableMetatype.swift new file mode 100644 index 0000000..c5aba0d --- /dev/null +++ b/Sources/X509/X509SendableMetatype.swift @@ -0,0 +1,19 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the SwiftCertificates open source project +// +// Copyright (c) 2025 Apple Inc. and the SwiftCertificates project authors +// Licensed under Apache License v2.0 +// +// See LICENSE.txt for license information +// See CONTRIBUTORS.txt for the list of SwiftCertificates project authors +// +// SPDX-License-Identifier: Apache-2.0 +// +//===----------------------------------------------------------------------===// + +#if compiler(>=6.2) +public typealias _X509SendableMetatype = SendableMetatype +#else +public typealias _X509SendableMetatype = Any +#endif