keys: rename New*FromRawBytes to New*FromASN1

RawBytes is too confusing and may be read as being compatible with
NEO-serialized format.
This commit is contained in:
Roman Khimov 2019-10-10 16:45:30 +03:00
parent 782ca64d92
commit 6b70c5f2bd
2 changed files with 4 additions and 4 deletions

View file

@ -47,8 +47,8 @@ func NewPrivateKeyFromBytes(b []byte) (*PrivateKey, error) {
return &PrivateKey{b}, nil return &PrivateKey{b}, nil
} }
// NewPrivateKeyFromRawBytes returns a NEO PrivateKey from the ASN.1 serialized keys. // NewPrivateKeyFromASN1 returns a NEO PrivateKey from the ASN.1 serialized key.
func NewPrivateKeyFromRawBytes(b []byte) (*PrivateKey, error) { func NewPrivateKeyFromASN1(b []byte) (*PrivateKey, error) {
privkey, err := x509.ParseECPrivateKey(b) privkey, err := x509.ParseECPrivateKey(b)
if err != nil { if err != nil {
return nil, err return nil, err

View file

@ -78,8 +78,8 @@ func (p *PublicKey) Bytes() []byte {
return append([]byte{prefix}, paddedX...) return append([]byte{prefix}, paddedX...)
} }
// NewPublicKeyFromRawBytes returns a NEO PublicKey from the ASN.1 serialized keys. // NewPublicKeyFromASN1 returns a NEO PublicKey from the ASN.1 serialized key.
func NewPublicKeyFromRawBytes(data []byte) (*PublicKey, error) { func NewPublicKeyFromASN1(data []byte) (*PublicKey, error) {
var ( var (
err error err error
pubkey interface{} pubkey interface{}