Commit graph

7 commits

Author SHA1 Message Date
Leonard Lyubich
291d512840 session: implement function for receiving session public key bytes
After recent changes PrivateToken cannot directly return public key
bytes. In order to provide this ability, this commit implements
a function over PrivateToken interface.
2020-05-18 16:47:15 +03:00
Leonard Lyubich
af28735ca6 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.
2020-05-18 16:47:15 +03:00
Leonard Lyubich
af73d958a1 session: add OwnerID to a private token storage key 2020-05-08 13:23:30 +03:00
Leonard Lyubich
4fa7360cd1 session: support the expiration of private tokens
All sessions in NeoFS has limited in epochs lifetime. There is a need
to limit the lifetime of private session tokens.

This commmit:

  * extends PrivateToken interface with Expired method;

  * defines EpochLifetimeStore interface with RemoveExpired method
    and embeds it to PrivateTokenStore interface;

  * adds epoch value parameter to private token constructor.
2020-04-29 14:11:19 +03:00
Leonard Lyubich
ffd4338eb3 session: fix NewPrivateToken function doc 2020-04-29 12:59:58 +03:00
Leonard Lyubich
f0867036fb session: remove trivial defaultCurve function 2020-04-29 12:46:05 +03:00
Leonard Lyubich
dfc2dd8a78 session: replace PToken structure with PrivateToken interface
In previous implementation PToken contained the full Token structure.
Since private token is used for data signature only, storing unused
fields of a user token is impractical. To emphasize the purpose of
the private part of the session, it makes sense to provide the user
of the session package with its interface. The interface will only provide
the functionality of data signing with private session key.

This commit:

  * removes PToken structure from session package;

  * defines PrivateToken interface of private session part;

  * adds the implementation of PrivateToken on unexported struct;

  * provides the constructor that generates session key internally.
2020-04-29 11:52:05 +03:00