mirror of
https://github.com/go-acme/lego
synced 2026-03-14 14:35:48 +01:00
feat: use the public key corresponding to the opaque (#2899)
This commit is contained in:
parent
3dfdeb0ac6
commit
2bfa88a4c9
1 changed files with 3 additions and 3 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue