mirror of
https://github.com/apple/swift-certificates
synced 2026-11-24 04:27:49 +00:00
## Motivation: In some cases a developer may want to sign a certificate using a method other than a private key. For example: if a private key is protected by hardware which signs asynchronously. ## Modifications: - Create `CustomPrivateKey` protocol - Create `async` initializers for `Certificate` and `CertificateSigningRequest`. - `CustomPrivateKey` can now back a`Certificate.PrivateKey` - Make `Certificate.Signature` initializer public ## Result: Developers can now sign a certificate with greater flexibility. ## Alternatives Considered: ### Implementations #### Pass the `CustomPrivateKey` into `Certificate` and `CertificateSigningRequest` initializers directly. There is concern this could add too much duplication of api. ### Various names for the protocol: - `Certificate.PrivateKeyProtocol` and `Certificate.AsyncPrivateKeyProtocol` - `Certificate.Signer`/`Certificate.AsyncSigner` - `Certificate.SignatureProvider`/`Certificate.AsyncSignatureProvider` --------- Co-authored-by: Cory Benfield <cbenfield@apple.com>