feat: use the public key corresponding to the opaque (#2899)

This commit is contained in:
Ludovic Fernandez 2026-03-08 10:52:34 +01:00 committed by GitHub
commit 2bfa88a4c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -151,10 +151,10 @@ func sign(content []byte, signKey jose.SigningKey, options *jose.SignerOptions)
func signatureAlgorithm(privKey crypto.Signer) jose.SignatureAlgorithm {
var alg jose.SignatureAlgorithm
switch k := privKey.(type) {
case *rsa.PrivateKey:
switch k := privKey.Public().(type) {
case *rsa.PublicKey:
alg = jose.RS256
case *ecdsa.PrivateKey:
case *ecdsa.PublicKey:
if k.Curve == elliptic.P256() {
alg = jose.ES256
} else if k.Curve == elliptic.P384() {