Skip to content

Conversation

@aead
Copy link
Owner

@aead aead commented Dec 22, 2025

This commit adds support for RSA private keys.
See the mtls.RSAPrivateKey struct.

RSA keys use the k3: prefix and are significantly larger than EdDSA / ECDSA keys. Currently, their text representation includes the private key parameter D which is not strictly required since it can be re-computed using the public exponent E. However, due to FIPS 140, D would have to be computed not using the typical φ(N) where φ(N) = (p-1)(q-1) but using E⁻¹ mod λ(N) where λ(N) = lcm(p-1, q-1).

This commit also adds an RSA certificate used for tests generated with OpenSSL 3.6.0

This commit adds support for RSA private keys.
See the `mtls.RSAPrivateKey` struct.

RSA keys use the `k3:` prefix and are significantly
larger than EdDSA / ECDSA keys. Currently, their text
representation includes the private key parameter `D`
which is not strictly required since it can be re-computed
using the public exponent `E`. However, due to FIPS 140, `D`
would have to be computed not using the typical φ(N) where
φ(N) = (p-1)(q-1) but using E⁻¹ mod λ(N) where λ(N) = lcm(p-1, q-1).

This commit also adds an RSA certificate used for tests generated
with OpenSSL 3.6.0

Signed-off-by: Andreas Auernhammer <github@aead.dev>
@aead aead self-assigned this Dec 22, 2025
@aead aead merged commit 7d178d8 into main Dec 22, 2025
5 checks passed
@aead aead deleted the rsa branch December 22, 2025 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants