Versions in this module Expand all Collapse all v0 v0.0.1 Feb 6, 2023 Changes in this version + const DefaultExpireTimeInterval + var ErrSignatureExpired = errors.New("signature expired") + var ErrSignatureInvalid = func(e error) SignatureInvalidError + var ErrUIDInvalid = errors.New("uid invalid") + type APIAuthenticator interface + Auth func(sig string) (string, error) + Request func(appId string, pubKey, privKey []byte) string + type APIRequest struct + func NewAPIRequest(signature, metadata string, pubKey []byte) *APIRequest + func NewAPIRequestFromToken(token string) (*APIRequest, error) + func (t *APIRequest) GetMetadata() string + func (t *APIRequest) GetPublicKey() []byte + func (t *APIRequest) GetSignature() string + func (t *APIRequest) GetToken() string + type DefaultAPIAuthenticator struct + func NewDefaultAPIAuthenticator() *DefaultAPIAuthenticator + func NewDefaultAPIAuthenticatorAsDriver(driver xcrypt.Encrypt) *DefaultAPIAuthenticator + func (d *DefaultAPIAuthenticator) Auth(token string) (string, error) + func (d *DefaultAPIAuthenticator) Request(appId string, pubKey, privKey []byte) string + type Signatory struct + func NewSignatory(crypt xcrypt.Encrypt, appId string, timestamp int64) *Signatory + func NewSignatoryFromMetadata(crypt xcrypt.Encrypt, metadata string) (*Signatory, error) + func (t *Signatory) DoSignature(privKey []byte) string + func (t *Signatory) GetMetadata() string + func (t *Signatory) IsExpire() bool + func (t *Signatory) Match(signature string, pubKey []byte) (bool, error) + type SignatureInvalidError struct + func (e SignatureInvalidError) Error() string + func (e SignatureInvalidError) Unwrap() error