docs: add doc comment for LoadPrivateKey

This commit is contained in:
Evgeniy Kulikov 2019-11-21 17:32:08 +03:00
parent f707f6449c
commit 9f21fbbfd5
No known key found for this signature in database
GPG key ID: BF6AEE0A2A699BF2

View file

@ -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)