Add support for Raw Public Key credentials - #103
Merged
rafaelcepeda merged 4 commits intoJul 30, 2026
Conversation
gjcairo
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
This PR decomposes the existing
TLSCredentialstype to separate out credential type (X509), source (file, byte array, or certificate reloader), and encoding (PEM or DER) from one another. This allows us to cleanly add support for a new TLS credential type, namely, Raw Public Keys (RFC 7250), which is currently only available over HTTP/3.Modifications:
Updated
TLSCredentialsto now be structured around "credential type" as the top-level.TLSCredentialsnow provides these static factory methods (public):.x509(X509Credentials).rawPublicKey(RawPublicKeyCredentials)Internal API:
X509Credentials.Backing:.certificates.reloading.serialized(SerializedCredentials).SerializedCredentials:.file/.bytes) combined with aSerializationFormat(.pem/.der).Internally, we can now represent TLS credentials in a more structured manner. These details are not exposed in the public API though. The public API just contains these convenience factory methods:
X509Credentials:.certificates(chain:privateKey:): in-memoryX509.Certificate/Certificate.PrivateKeyobjects;.reloading(_:): aCertificateReloader;.pemFile/.pemBytes/.derFile/.derBytes: a serialized certificate chain and private key.RawPublicKeyCredentials:.derFile.Result:
Configuration API improved and support for Raw Public Key credentials over HTTP/3 added.