Skip to content

Conversation

@Juice805
Copy link

@Juice805 Juice805 commented Nov 10, 2025

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

@Juice805 Juice805 force-pushed the custom-private-key branch 2 times, most recently from aa451de to 8a254cd Compare November 10, 2025 22:48
@Lukasa Lukasa added the 🆕 semver/minor Adds new public API. label Dec 12, 2025
@Juice805 Juice805 force-pushed the custom-private-key branch 2 times, most recently from 574eaa0 to 4d583ad Compare December 12, 2025 18:12
Motivation:

The new tests should be run

Modifications:

The new tests are missing the `@Test` macros

Result:

The new tests will have the `@Test` macros
Motivation:

Code should be clean

Modifications:

Removed `@inlinable` from protocol definition

Result:

protocol will not have `@inlinable`
Motivation:

Default implementation of signAsynchronously should be inlinable

Modifications:

adds `@inlinable` to default signAsynchronously implementation.

Result:

default signAsynchronously implementation will be `@inlinable`
Motivation:

`signAsynchronously` should not it is not mandatory to implement

Modifications:

Updated documentation

Result:

`signAsynchronously` has better docs
@Juice805 Juice805 force-pushed the custom-private-key branch from 9966a0c to 9b3c192 Compare January 9, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants