|
@@ -64,7 +64,7 @@ func NewECDSAPrivateKey(currentTime time.Time, priv *ecdsa.PrivateKey) *PrivateK
|
|
|
return pk
|
|
return pk
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// NewSignerPrivateKey creates a sign-only PrivateKey from a crypto.Signer that
|
|
|
|
|
|
|
+// NewSignerPrivateKey creates a PrivateKey from a crypto.Signer that
|
|
|
// implements RSA or ECDSA.
|
|
// implements RSA or ECDSA.
|
|
|
func NewSignerPrivateKey(currentTime time.Time, signer crypto.Signer) *PrivateKey {
|
|
func NewSignerPrivateKey(currentTime time.Time, signer crypto.Signer) *PrivateKey {
|
|
|
pk := new(PrivateKey)
|
|
pk := new(PrivateKey)
|
|
@@ -73,10 +73,8 @@ func NewSignerPrivateKey(currentTime time.Time, signer crypto.Signer) *PrivateKe
|
|
|
switch pubkey := signer.Public().(type) {
|
|
switch pubkey := signer.Public().(type) {
|
|
|
case *rsa.PublicKey:
|
|
case *rsa.PublicKey:
|
|
|
pk.PublicKey = *NewRSAPublicKey(currentTime, pubkey)
|
|
pk.PublicKey = *NewRSAPublicKey(currentTime, pubkey)
|
|
|
- pk.PubKeyAlgo = PubKeyAlgoRSASignOnly
|
|
|
|
|
case rsa.PublicKey:
|
|
case rsa.PublicKey:
|
|
|
pk.PublicKey = *NewRSAPublicKey(currentTime, &pubkey)
|
|
pk.PublicKey = *NewRSAPublicKey(currentTime, &pubkey)
|
|
|
- pk.PubKeyAlgo = PubKeyAlgoRSASignOnly
|
|
|
|
|
case *ecdsa.PublicKey:
|
|
case *ecdsa.PublicKey:
|
|
|
pk.PublicKey = *NewECDSAPublicKey(currentTime, pubkey)
|
|
pk.PublicKey = *NewECDSAPublicKey(currentTime, pubkey)
|
|
|
case ecdsa.PublicKey:
|
|
case ecdsa.PublicKey:
|