Skip to content

Commit 6f0f54f

Browse files
authored
Merge pull request #56 from cashapp/fix-sign-cast
fix: cast to crypto.Signer instead of ecdsa.PrivateKey
2 parents 3b5a1af + a37b3dc commit 6f0f54f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ build
33
.DS_Store
44
result
55
*~
6+
/cover.out

pkg/pivit/pivit.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package pivit
22

33
import (
44
"crypto"
5-
"crypto/ecdsa"
65
"crypto/x509"
76
"fmt"
87
"io"
@@ -93,7 +92,7 @@ func (y signer) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]b
9392
}
9493

9594
switch priv := private.(type) {
96-
case *ecdsa.PrivateKey:
95+
case crypto.Signer:
9796
return priv.Sign(rand, digest, opts)
9897
default:
9998
return nil, fmt.Errorf("invalid key type")

0 commit comments

Comments
 (0)