mirror of
https://github.com/therootcompany/keypairs
synced 2025-04-20 14:30:43 +00:00
bugfix nil interface
This commit is contained in:
parent
84b07108b6
commit
f5cec1b18e
@ -85,7 +85,7 @@ func NewPublicKey(pub crypto.PublicKey, kid ...string) PublicKey {
|
|||||||
if 0 != len(kid) {
|
if 0 != len(kid) {
|
||||||
eckey.KID = kid[0]
|
eckey.KID = kid[0]
|
||||||
} else {
|
} else {
|
||||||
eckey.KID = k.Thumbprint()
|
eckey.KID = ThumbprintECPublicKey(p)
|
||||||
}
|
}
|
||||||
k = eckey
|
k = eckey
|
||||||
case *rsa.PublicKey:
|
case *rsa.PublicKey:
|
||||||
@ -95,7 +95,7 @@ func NewPublicKey(pub crypto.PublicKey, kid ...string) PublicKey {
|
|||||||
if 0 != len(kid) {
|
if 0 != len(kid) {
|
||||||
rsakey.KID = kid[0]
|
rsakey.KID = kid[0]
|
||||||
} else {
|
} else {
|
||||||
rsakey.KID = k.Thumbprint()
|
rsakey.KID = ThumbprintRSAPublicKey(p)
|
||||||
}
|
}
|
||||||
k = rsakey
|
k = rsakey
|
||||||
case *ecdsa.PrivateKey:
|
case *ecdsa.PrivateKey:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user