Saleem AbdulrasoolandCory Benfield 35a7df2d9d X509: make the code more portable (#72)
* X509: make the code more portable

`CoreFoundation` is not available on all platforms.  It never was meant
to be available on Linux, but was accidentally pushed into the release
and is now stuck.  Windows intentionally did not make this module
visible.  With the future work with the Foundation rewrite
`CoreFoundation` will disappear in more locations.

Windows does not support `inet_pton` except unless the string is
explicitly ANSI and not UTF-8.  We must use the proper spelling of
`InetPtonW` which takes a UTF-16 string.

The import of `CoreFoundation` was more for the dependency on the C
library as a side-effect.  On Windows, the networking functions are
provided by a separate user space library rather than the C library.
This is now highlighted in the imports.

* Clean up indentation

* Re-add CoreFoundation on Linux

---------

Co-authored-by: Cory Benfield <lukasa@apple.com>
2023-04-21 18:22:18 +01:00
2023-03-02 14:11:09 -08:00
2023-03-01 21:41:15 -08:00
2023-03-02 14:11:09 -08:00
2023-03-02 14:11:09 -08:00
2023-03-01 10:35:09 +00:00
2023-03-01 21:41:15 -08:00
2022-11-16 15:50:52 +01:00
2023-04-19 17:58:32 +02:00
2023-03-01 10:35:09 +00:00

swift-certificates

A library for working with X.509 certificates.

Overview

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.4.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.

S
Description
Mirror of github.com/apple/swift-certificates
Readme Apache-2.0
3.1 MiB
0 Stars 1 Watchers 0 Forks
Languages
Swift 99.1%
CMake 0.8%