Swiftpack.co - apple/swift-certificates as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by apple.
apple/swift-certificates 0.2.0
An implementation of X.509 for Swift
⭐️ 110
🕓 2 days ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/apple/swift-certificates.git", from: "0.2.0")


A library for working with X.509 certificates.


X.509 certificates are a commonly-used identity format to cryptographically attest to the identity of an actor in a system. They form part of the X.509 standard created by the ITU-T for defining a public key infrastructure (PKI). X.509-style PKIs are commonly used in cases where it is necessary to delegate the authority to attest to an actor's identity to a small number of trusted parties (called Certificate Authorities).

The most common usage of X.509 certificates today is as part of the WebPKI, where they are used to secure TLS connections to websites. X.509 certificates are also used in a wide range of other TLS-based communications, as well as in code signing infrastructure.

This module makes it possible to serialize, deserialize, create, and interact with X.509 certificates. This is an essential building-block for a wide range of PKI applications. It enables building verifiers, interacting with certificate authorities, authenticating peers, and more. It also ships with a default verifier and a number of built-in verifier policies.

Supported Swift Versions

This library was introduced with support for Swift 5.7 or later. This library will support the latest stable Swift version and the two versions prior.

Getting Started

To use swift-certificates, add the following dependency to your Package.swift:

dependencies: [
    .package(url: "https://github.com/apple/swift-certificates.git", upToNextMinor(from: "0.1.0"))

Note that this repository does not have a 1.0 tag yet, so the API is not stable.

You can then add the specific product dependency to your target:

dependencies: [
    .product(name: "X509", package: "swift-certificates"),

For detailed usage and API documentation, check the documentation.


Stars: 110
Last commit: 15 hours ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Swift Certificates 0.2.0
2 days ago

SemVer Minor

  • Follow casing from Swift API Design Guidelines (#46)
  • Add support for policing critical extensions (#47)

SemVer Patch

  • Add BasicConstraints enforcement to RF5280Policy (#36)
  • Add support for handling domain name constraints. (#37)
  • Add support for IP address constraints. (#38)
  • Update Swift Crypto and fix RSA keys (#39)
  • Fix Certificate.SerialNumber.init() (#40)
  • Improve our handling of trailing periods. (#41)
  • Add support for name constraints on URIs (#42)
  • Build OCSP Response certificate chain and verify signature (#43)
  • Add directory name constraints. (#44)
  • Produce functional NameConstraints (#45)
  • Add leeway to the OCSP time verification (#48)

Other Changes

  • Parallelise test cases (#49)

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics