diff --git a/pkg/object/fmt.go b/pkg/object/fmt.go index 04cb5f41..637fa229 100644 --- a/pkg/object/fmt.go +++ b/pkg/object/fmt.go @@ -119,7 +119,7 @@ func VerifyIDSignature(obj *Object) error { func() ([]byte, []byte) { sig := obj.GetSignature() - return sig.GetKey(), sig.GetSign() + return sig.Key(), sig.Sign() }, ) } diff --git a/pkg/object/fmt_test.go b/pkg/object/fmt_test.go index 5a65e492..2f94b371 100644 --- a/pkg/object/fmt_test.go +++ b/pkg/object/fmt_test.go @@ -51,18 +51,18 @@ func TestVerificationFields(t *testing.T) { }, { corrupt: func() { - obj.GetSignature().GetKey()[0]++ + obj.GetSignature().Key()[0]++ }, restore: func() { - obj.GetSignature().GetKey()[0]-- + obj.GetSignature().Key()[0]-- }, }, { corrupt: func() { - obj.GetSignature().GetSign()[0]++ + obj.GetSignature().Sign()[0]++ }, restore: func() { - obj.GetSignature().GetSign()[0]-- + obj.GetSignature().Sign()[0]-- }, }, } diff --git a/pkg/signature.go b/pkg/signature.go index 992b183e..7cf318d6 100644 --- a/pkg/signature.go +++ b/pkg/signature.go @@ -19,8 +19,8 @@ func NewSignature() *Signature { return NewSignatureFromV2(new(refs.Signature)) } -// GetKey sets binary public key. -func (s *Signature) GetKey() []byte { +// Key sets binary public key. +func (s *Signature) Key() []byte { return (*refs.Signature)(s).GetKey() } @@ -29,8 +29,8 @@ func (s *Signature) SetKey(v []byte) { (*refs.Signature)(s).SetKey(v) } -// GetSign return signature value. -func (s *Signature) GetSign() []byte { +// Sign return signature value. +func (s *Signature) Sign() []byte { return (*refs.Signature)(s).GetSign() }