service: defined OwnerKeyContainer and embed it to SessionInfo interface

This commit is contained in:
Leonard Lyubich 2020-05-15 16:03:47 +03:00
parent c8625b2c86
commit bc413f6280
2 changed files with 19 additions and 1 deletions

View file

@ -103,6 +103,11 @@ func (m *Token_Info) SetSessionKey(key []byte) {
m.SessionKey = key
}
// SetOwnerKey is an OwnerKey field setter.
func (m *Token_Info) SetOwnerKey(key []byte) {
m.OwnerKey = key
}
// SetSignature is a Signature field setter.
func (m *Token) SetSignature(sig []byte) {
m.Signature = sig

View file

@ -158,6 +158,17 @@ type SignatureContainer interface {
SetSignature([]byte)
}
// OwnerKeySource is an interface of the container of owner key bytes with read access.
type OwnerKeySource interface {
GetOwnerKey() []byte
}
// OwnerKeyContainer is an interface of the container of owner key bytes.
type OwnerKeyContainer interface {
OwnerKeySource
SetOwnerKey([]byte)
}
// SessionTokenSource is an interface of the container of a SessionToken with read access.
type SessionTokenSource interface {
GetSessionToken() SessionToken
@ -170,7 +181,8 @@ type SessionTokenSource interface {
// - verb of the session;
// - address of the session object;
// - token lifetime;
// - public session key bytes.
// - public session key bytes;
// - owner's public key bytes.
type SessionTokenInfo interface {
TokenIDContainer
OwnerIDContainer
@ -178,6 +190,7 @@ type SessionTokenInfo interface {
AddressContainer
LifetimeContainer
SessionKeyContainer
OwnerKeyContainer
}
// SessionToken is an interface of token information and signature pair.