docs: add doc comment for LoadPrivateKey
This commit is contained in:
parent
f707f6449c
commit
9f21fbbfd5
1 changed files with 4 additions and 0 deletions
4
load.go
4
load.go
|
@ -8,6 +8,10 @@ import (
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// LoadPrivateKey allows to load private key from various formats:
|
||||||
|
// - wif string
|
||||||
|
// - hex string
|
||||||
|
// - file path (D-bytes or SEC 1 / ASN.1 DER form)
|
||||||
func LoadPrivateKey(val string) (*ecdsa.PrivateKey, error) {
|
func LoadPrivateKey(val string) (*ecdsa.PrivateKey, error) {
|
||||||
if data, err := ioutil.ReadFile(val); err == nil {
|
if data, err := ioutil.ReadFile(val); err == nil {
|
||||||
return UnmarshalPrivateKey(data)
|
return UnmarshalPrivateKey(data)
|
||||||
|
|
Loading…
Reference in a new issue