auth

package
v0.2.10-0...-e52ecc5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnauthorized = errors.New("Invalid username or password")

Functions

func EncryptAndSave

func EncryptAndSave(auth *CachedAuth, username string, secretKey *[32]byte) error

func GeneratePassword

func GeneratePassword() (secretKey *[32]byte, password string, err error)

func ListUsernames

func ListUsernames() ([]string, error)

Types

type CachedAuth

type CachedAuth struct {
	protonmail.Auth
	LoginPassword   string
	MailboxPassword string
	KeySalts        map[string][]byte
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(newClient func() *protonmail.Client) *Manager

func (*Manager) Auth

func (m *Manager) Auth(username, password string) (*protonmail.Client, openpgp.EntityList, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL