Verifier
Verifier.swift:17- iOS
- 13+
- macOS
- 10.15+
- Mac Catalyst
- 13+
- tvOS
- 13+
- visionOS
- 1.0+
- watchOS
- 6+
struct Verifier<Policy> where Policy : VerifierPolicystruct Verifier<Policy> where Policy : VerifierPolicyimport X509A library for working with X.509 certificates.
@preconcurrency protocol VerifierPolicyA VerifierPolicy implements a series of checks on an UnverifiedCertificateChain in order to determine whether that chain should be trusted.
struct UnverifiedCertificateChain@resultBuilder struct PolicyBuilderProvides a result-builder style DSL for constructing a VerifierPolicy.
struct PolicyFailureReasonstruct AnyPolicyAnyPolicy can be used to erase the concrete type of some VerifierPolicy. Only use AnyPolicy if type erasure is necessary. Instead try to use conditional inclusion of different policies using PolicyBuilder.
@resultBuilder struct OneOfPolicyBuilderProvides a result-builder style DSL for constructing a VerifierPolicy in which one of the specified policies must match.
struct OneOfPolicies<Policy> where Policy : VerifierPolicyUse this to build a policy where any one of the sub-policies must be met for the overall policy to be met. For example, the following policy requires that RFC5280Policy is always met, and either PolicyA or PolicyB is met. It does not require that both PolicyA and PolicyB are met.
struct AllOfPolicies<Policy> where Policy : VerifierPolicyUse this to build a policy where all of the sub-policies must be met for the overall policy to be met. This is only useful within a OneOfPolicies block, because at the top-level, it is already required for all policies to be met, so adding this at the top-level is redundant. For example, the following policy requires that RFC5280Policy is always met, and then either policy C is met, or A and B are both met. If A and B are both met, then C does not have to be met. If C is met, then neither A nor B need to be met.
struct CertificateStoreA collection of Certificate objects for use in a verifier.
struct VerificationDiagnosticinit(rootCertificates: CertificateStore, @PolicyBuilder policy: () throws -> Policy) rethrows var policy: Policyvar rootCertificates: CertificateStoremutating func validate(leafCertificate: Certificate, intermediates: CertificateStore, diagnosticCallback: ((VerificationDiagnostic) -> Void)? = nil) async -> VerificationResult protocol SendableA thread-safe type whose values can be shared across arbitrary concurrent contexts without introducing a risk of data races. Values of the type may have no shared mutable state, or they may protect that state with a lock or by forcing it to only be accessed from a specific actor.