Versions in this module Expand all Collapse all v0 v0.1.1 Nov 26, 2022 v0.1.0 Jun 18, 2021 Changes in this version + func CryptRead(rd io.Reader, g KeyGenerator, passwd []byte) ([]byte, error) + func CryptReadFile(name string, g KeyGenerator, passwd []byte) ([]byte, error) + func CryptWrite(wr io.Writer, g KeyGenerator, passwd, data []byte) error + func CryptWriteFile(name string, g KeyGenerator, passwd, data []byte) error + func ReadAuthCreds(rd io.Reader, ac *AuthCreds) (err error) + func ReadAuthCredsFile(name string, ac *AuthCreds) error + func WriteAuthCreds(wr io.Writer, ac *AuthCreds) (err error) + func WriteAuthCredsFile(name string, ac *AuthCreds) error + type Argon2idKeyGen struct + KDFKeyLen uint32 + KDFMemory uint32 + KDFParallel uint8 + KDFTime uint32 + SaltSize int + func (a2k *Argon2idKeyGen) Generate(passwd, salt []byte) (key, nsalt []byte, err error) + type AuthCreds struct + func NewAuthCreds(keyGen KeyGenerator) *AuthCreds + func (ac *AuthCreds) Check(user string, passwd []byte) bool + func (ac *AuthCreds) CheckString(user, passwd string) bool + func (ac *AuthCreds) Set(user string, passwd []byte) (err error) + func (ac *AuthCreds) SetString(user, passwd string) (err error) + type BasicAuth struct + Creds *AuthCreds + FailMaxDelay time.Duration + FailMinDelay time.Duration + FailMsg func(user string, rq *http.Request) + Realm string + SuccessMsg func(user string, rq *http.Request) + func (ba *BasicAuth) Protect(h http.HandlerFunc) http.HandlerFunc + func (ba *BasicAuth) SetRealm(from string) error + type CertConfig struct + CommonName string + Valid time.Duration + type KeyGenerator interface + Generate func(passwd, salt []byte) (key, nsalt []byte, err error) + type TLSServer struct + Addr string + CertFile string + KeyFile string + KeyGen KeyGenerator + func (s *TLSServer) HasCert() bool + func (s *TLSServer) ListenAndServe(passphrase []byte, handler http.Handler) error + func (s *TLSServer) NewCert(passphrase []byte, cfg *CertConfig) (err error)