add back from bytes
This commit is contained in:
parent
810aa02bdd
commit
1823aaa5e0
1 changed files with 9 additions and 8 deletions
17
sign/keys.go
17
sign/keys.go
|
@ -30,6 +30,7 @@ import (
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
Ed "crypto/ed25519"
|
Ed "crypto/ed25519"
|
||||||
|
|
||||||
"golang.org/x/crypto/scrypt"
|
"golang.org/x/crypto/scrypt"
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
)
|
)
|
||||||
|
@ -179,14 +180,14 @@ func makePrivateKeyFromBytes(sk *PrivateKey, buf []byte) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
// Make a private key from 64-bytes of extended Ed25519 key
|
// Make a private key from 64-bytes of extended Ed25519 key
|
||||||
func PrivateKeyFromBytes(buf []byte) (*PrivateKey, error) {
|
func PrivateKeyFromBytes(buf []byte) (*PrivateKey, error) {
|
||||||
var sk PrivateKey
|
var sk PrivateKey
|
||||||
|
if err := makePrivateKeyFromBytes(&sk, buf); err != nil {
|
||||||
return makePrivateKeyFromBytes(&sk, buf)
|
return nil, err
|
||||||
|
}
|
||||||
|
return &sk, nil
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
// Given a secret key, return the corresponding Public Key
|
// Given a secret key, return the corresponding Public Key
|
||||||
func (sk *PrivateKey) PublicKey() *PublicKey {
|
func (sk *PrivateKey) PublicKey() *PublicKey {
|
||||||
|
@ -404,14 +405,14 @@ func makePublicKeyFromBytes(pk *PublicKey, b []byte) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
// Make a public key from a byte string
|
// Make a public key from a byte string
|
||||||
func PublicKeyFromBytes(b []byte) (*PublicKey, error) {
|
func PublicKeyFromBytes(b []byte) (*PublicKey, error) {
|
||||||
var pk PublicKey
|
var pk PublicKey
|
||||||
|
if err := makePublicKeyFromBytes(&pk, b); err != nil {
|
||||||
makePublicKeyFromBytes(&pk, b)
|
return nil, err
|
||||||
|
}
|
||||||
|
return &pk, nil
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
// Serialize a PublicKey into file 'fn' with a human readable 'comment'.
|
// Serialize a PublicKey into file 'fn' with a human readable 'comment'.
|
||||||
// If 'ovwrite' is true, overwrite the file if it exists.
|
// If 'ovwrite' is true, overwrite the file if it exists.
|
||||||
|
|
Loading…
Add table
Reference in a new issue