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 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. // SetSignature is a Signature field setter.
func (m *Token) SetSignature(sig []byte) { func (m *Token) SetSignature(sig []byte) {
m.Signature = sig m.Signature = sig

View file

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