Files
swift-certificates/Sources
Justin OrozandCory Benfield 24ccdeeeed Custom private key (#282)
## 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>
2026-02-10 14:29:41 +00:00
..
2026-02-10 14:29:41 +00:00
2023-06-20 01:51:53 -07:00