Documentation ¶
Index ¶
- Variables
- func BytesToECDSA(b []byte) (*btcec.PrivateKey, error)
- func FromECDSA(key *btcec.PrivateKey) ([]byte, error)
- func HexToECDSA(hexkey string) (*btcec.PrivateKey, error)
- func LoadECDSA(file string) (*btcec.PrivateKey, error)
- func NewKey() (*btcec.PrivateKey, error)
- func NewToken(token TokenFormat) *jwt.Token
- func NewWallet(rpcnode, keystore string, tgunclient *tgun.Client) *aquawallet
- func S256() elliptic.Curve
- func SaveKey(key *btcec.PrivateKey, file string) error
- type Config
- type Permissions
- type System
- func (s *System) AddPerm(u, perm string) error
- func (s *System) AuthenticateSession(r *http.Request) (*TokenFormat, error)
- func (s *System) ParseTokenForm(r *http.Request) (*jwt.Token, *TokenFormat, error)
- func (s *System) ParseTokenString(tokenString string) (*jwt.Token, *TokenFormat, error)
- func (s *System) Pubkey() ecdsa.PublicKey
- func (s *System) RemovePerm(u, perm string) error
- func (s *System) Serve() error
- func (s *System) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type TokenFormat
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultExpired = time.Minute * 10 ErrNoToken = errors.New("no token") ErrTokenExpired = errors.New("expired token, yo") )
View Source
var (
ErrECDSAVerification = jwt.ErrECDSAVerification
)
Functions ¶
func BytesToECDSA ¶
func BytesToECDSA(b []byte) (*btcec.PrivateKey, error)
BytesToECDSA returns *btcec.PrivateKey from b
func FromECDSA ¶
func FromECDSA(key *btcec.PrivateKey) ([]byte, error)
FromECDSA serializes private key to bytes
func HexToECDSA ¶
func HexToECDSA(hexkey string) (*btcec.PrivateKey, error)
HexToECDSA parses a hex encoded private key
func LoadECDSA ¶
func LoadECDSA(file string) (*btcec.PrivateKey, error)
LoadECDSA loads a secp256k1 private key from the given file made with SaveKey
func NewToken ¶
func NewToken(token TokenFormat) *jwt.Token
Types ¶
type Permissions ¶
func NewPermissions ¶
func NewPermissions(perm ...string) Permissions
type System ¶
type System struct { Config *Config // contains filtered or unexported fields }
func (*System) AuthenticateSession ¶
func (s *System) AuthenticateSession(r *http.Request) (*TokenFormat, error)
AuthenticateSession returns error if session can not be verified
func (*System) ParseTokenForm ¶
ParseTokenForm from a form["token"], parse the form before calling
func (*System) ParseTokenString ¶
ParseTokenString from a string
func (*System) RemovePerm ¶
RemovePerm removes a permission from user u. 1 READ 1 WRITE
type TokenFormat ¶
type UserInfo ¶
type UserInfo struct {
Permissions Permissions
}
Click to show internal directories.
Click to hide internal directories.