aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/crypto/ecdsa/ecdsa.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/crypto/ecdsa/ecdsa.go b/core/crypto/ecdsa/ecdsa.go
index 0196c47..9556981 100644
--- a/core/crypto/ecdsa/ecdsa.go
+++ b/core/crypto/ecdsa/ecdsa.go
@@ -57,6 +57,15 @@ func NewPrivateKey() (*PrivateKey, error) {
}, nil
}
+// NewPrivateKeyFromECDSA creates a new PrivateKey structure from
+// ecdsa.PrivateKey.
+func NewPrivateKeyFromECDSA(key *ecdsa.PrivateKey) *PrivateKey {
+ return &PrivateKey{
+ privateKey: *key,
+ publicKey: *newPublicKey(key),
+ }
+}
+
// newPublicKey creates a new PublicKey structure.
func newPublicKey(prvKey *ecdsa.PrivateKey) *publicKey {
return &publicKey{