[#263] session: Add Sign / VerifySignature test

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-06-04 16:45:25 +03:00 committed by fyrchik
parent 0ef49cf851
commit bf8312a547
2 changed files with 16 additions and 0 deletions

View file

@ -535,3 +535,11 @@ func TestContainer_Issuer(t *testing.T) {
require.True(t, token.Issuer().Equals(issuer)) require.True(t, token.Issuer().Equals(issuer))
} }
func TestContainer_Sign(t *testing.T) {
val := sessiontest.Container()
require.NoError(t, val.Sign(randSigner()))
require.True(t, val.VerifySignature())
}

View file

@ -626,3 +626,11 @@ func TestObject_Issuer(t *testing.T) {
require.True(t, token.Issuer().Equals(issuer)) require.True(t, token.Issuer().Equals(issuer))
} }
func TestObject_Sign(t *testing.T) {
val := sessiontest.Object()
require.NoError(t, val.Sign(randSigner()))
require.True(t, val.VerifySignature())
}