forked from TrueCloudLab/frostfs-sdk-go
[#190] Refactor cryptographic functionality
Remove `signature` and `util/signature` packages. Re-implement their functionality in new `crypto` package. Generalize the approach of digital signature computation and verification by adding `Signer` and `PublicKey` primitives similar to standard `crypto` package. Support already exising in protocol signature schemes. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
2deaaeef05
commit
ea043f4ca3
33 changed files with 728 additions and 627 deletions
|
@ -11,7 +11,6 @@ import (
|
|||
oid "github.com/nspcc-dev/neofs-sdk-go/object/id"
|
||||
ownertest "github.com/nspcc-dev/neofs-sdk-go/owner/test"
|
||||
sessiontest "github.com/nspcc-dev/neofs-sdk-go/session/test"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/signature"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/version"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
@ -49,18 +48,6 @@ func TestObject_SetID(t *testing.T) {
|
|||
require.Equal(t, id, oID)
|
||||
}
|
||||
|
||||
func TestObject_SetSignature(t *testing.T) {
|
||||
obj := New()
|
||||
|
||||
sig := signature.New()
|
||||
sig.SetKey([]byte{1, 2, 3})
|
||||
sig.SetSign([]byte{4, 5, 6})
|
||||
|
||||
obj.SetSignature(sig)
|
||||
|
||||
require.Equal(t, sig, obj.Signature())
|
||||
}
|
||||
|
||||
func TestObject_SetPayload(t *testing.T) {
|
||||
obj := New()
|
||||
|
||||
|
@ -208,7 +195,6 @@ func TestObject_SetParent(t *testing.T) {
|
|||
par := New()
|
||||
par.SetID(randID(t))
|
||||
par.SetContainerID(cidtest.ID())
|
||||
par.SetSignature(signature.New())
|
||||
|
||||
obj.SetParent(par)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue