session: change PrivateToken interface methods
This commit replaces PublicKey() and SignData() methods of PrivateToken with PrivateKey() in order to have the ability to sign data with session key using service package functions.
This commit is contained in:
parent
ba27e296c3
commit
af28735ca6
3 changed files with 7 additions and 39 deletions
|
@ -10,14 +10,8 @@ import (
|
|||
|
||||
// PrivateToken is an interface of session private part.
|
||||
type PrivateToken interface {
|
||||
// PublicKey must return a binary representation of session public key.
|
||||
PublicKey() []byte
|
||||
|
||||
// Sign must return the signature of passed data.
|
||||
//
|
||||
// Resulting signature must be verified by crypto.Verify function
|
||||
// with the session public key.
|
||||
Sign([]byte) ([]byte, error)
|
||||
// PrivateKey must return session private key.
|
||||
PrivateKey() *ecdsa.PrivateKey
|
||||
|
||||
// Expired must return true if and only if private token is expired in the given epoch number.
|
||||
Expired(uint64) bool
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue