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
}
// NewPrivateKeyFromRawBytes returns a NEO PrivateKey from the ASN.1 serialized keys.
func NewPrivateKeyFromRawBytes(b []byte) (*PrivateKey, error) {
// NewPrivateKeyFromASN1 returns a NEO PrivateKey from the ASN.1 serialized key.
func NewPrivateKeyFromASN1(b []byte) (*PrivateKey, error) {
privkey, err := x509.ParseECPrivateKey(b)
if err != nil {
return nil, err

View file

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