Versions in this module Expand all Collapse all v0 v0.5.0 Feb 25, 2020 Changes in this version + const DIGITS + type HMAC struct + Required bool + func NewHMAC(required bool, key string) (*HMAC, error) + func (h *HMAC) MAC(message []byte) []byte + func (h *HMAC) Verify(message []byte, mac []byte) bool + type HOTP struct + func NewHOTP(increment uint64, secrets string, counters string, logger *log.Logger) (*HOTP, error) + func (hotp *HOTP) Validate(clientID, otp string) error + type Nonce struct + func NewNonce(verify bool, server, clients string, logger *log.Logger) (*Nonce, error) + func (n *Nonce) Next() uint64 + func (n *Nonce) Validate(clientID *string, nonce *uint64) error + type Permissions struct + Enabled bool + func NewPermissions(enabled bool, users, groups string, logger *log.Logger) (*Permissions, error) + func (p *Permissions) Validate(clientID, resource, action string) error + type RSA struct + func NewRSA(keydir string, logger *log.Logger) (*RSA, error) + func (r *RSA) Decrypt(ciphertext []byte, key []byte, label string) ([]byte, error) + func (r *RSA) Encrypt(plaintext []byte, clientID string, label string) ([]byte, []byte, error) + func (r *RSA) Sign(message []byte) ([]byte, error) + func (r *RSA) Validate(clientID string, request []byte, signature []byte) error