CertificateStore
A collection of Certificate
objects for use in a verifier.
- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
struct CertificateStore
A collection of Certificate
objects for use in a verifier.
struct CertificateStore
import X509
A library for working with X.509 certificates.
struct Certificate
struct Verifier<Policy> where Policy : VerifierPolicy
protocol VerifierPolicy
A VerifierPolicy
implements a series of checks on an UnverifiedCertificateChain
in order to determine whether that chain should be trusted.
struct UnverifiedCertificateChain
@resultBuilder struct PolicyBuilder
Provides a result-builder style DSL for constructing a VerifierPolicy
.
struct PolicyFailureReason
struct AnyPolicy
AnyPolicy
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 OneOfPolicyBuilder
Provides a result-builder style DSL for constructing a VerifierPolicy
in which one of the specified policies must match.
struct OneOfPolicies<Policy> where Policy : VerifierPolicy
Use 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 : VerifierPolicy
Use 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 VerificationDiagnostic
protocol Equatable
A type that can be compared for value equality.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol Sendable
init()
init(_ certificates: some Sequence<Certificate>)
static let systemTrustRoots: CertificateStore
A CertificateStore
that includes all root Certificate Authorities (CAs) that are installed in the systems trust store.
static func loadTrustRoots(at searchPaths: [String]) throws -> [DistinguishedName : [Certificate]]
mutating func append(_ certificate: Certificate)
mutating func append(contentsOf certificates: some Sequence<Certificate>)
func appending(_ certificate: Certificate) -> CertificateStore
func appending(contentsOf certificates: some Sequence<Certificate>) -> CertificateStore
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.