Documentation ¶
Overview ¶
Package walletauth implements the wallet authentication scheme.
Index ¶
Constants ¶
View Source
const SkewWindow = 3600
SkewWindow is the resolution of the logintime.
View Source
const TokenSize = 144
TokenSize is the size of a token.
Variables ¶
View Source
var ( // ErrBadToken signals that the token is invalid. ErrBadToken = errors.New("walletauth: bad token") // ErrBadSignature signals that a token signature does not verify. ErrBadSignature = errors.New("walletauth: bad signature") // ErrReplay is returned if a replay was detected in authentication. ErrReplay = errors.New("walletauth: replay on authentication") )
View Source
var Rand = rand.Reader
Rand is the random source.
Functions ¶
Types ¶
type AuthToken ¶
type AuthToken []byte
AuthToken is an authentication token.
func CreateToken ¶
func CreateToken(pubkey *[ed25519.PublicKeySize]byte, privkey *[ed25519.PrivateKeySize]byte, counter uint64) AuthToken
CreateToken generates an authentication token.
func (AuthToken) CheckToken ¶
func (token AuthToken) CheckToken() (pubkey *[ed25519.PublicKeySize]byte, ltime, lcounter uint64, err error)
CheckToken verifies a token signature and returns publickey, logintime and logincounter.
Click to show internal directories.
Click to hide internal directories.