Documentation ¶
Index ¶
- Constants
- Variables
- func Decrypt(key, message []byte) ([]byte, error)
- func Encrypt(key, message []byte) ([]byte, error)
- func GenRandPassword(len, uCaseLen, lCaseLen, numLen, puncLen int) string
- func Key(key string) []byte
- func Path() (string, error)
- type Entry
- type EntryMgr
- type EntryPersistant
- type FileEntryPersistant
- type Password
Constants ¶
View Source
const ( NonceSize = aes.BlockSize MACSize = 32 // Output size of HMAC-SHA-256 CKeySize = 32 // Cipher key size - AES-256 MKeySize = 32 // HMAC key size - HMAC-SHA-256 )
Variables ¶
View Source
var ( ErrEncrypt = errors.New("secret: encryption failed") ErrDecrypt = errors.New("secret: decryption failed") )
View Source
var KeySize = CKeySize + MKeySize
Functions ¶
func GenRandPassword ¶
Types ¶
type EntryMgr ¶
type EntryMgr struct { Entries map[string]map[string]Entry // contains filtered or unexported fields }
func NewEntryMgr ¶
func NewEntryMgr(persistance EntryPersistant) (*EntryMgr, error)
type EntryPersistant ¶
type EntryPersistant interface { Restore() (entries []Entry, err error) Save(entries []Entry) error }
func NewFileEntryPersistant ¶
func NewFileEntryPersistant(path string) EntryPersistant
type FileEntryPersistant ¶
type FileEntryPersistant struct {
// contains filtered or unexported fields
}
func (*FileEntryPersistant) Restore ¶
func (f *FileEntryPersistant) Restore() (entries []Entry, err error)
func (*FileEntryPersistant) Save ¶
func (f *FileEntryPersistant) Save(entries []Entry) error
Click to show internal directories.
Click to hide internal directories.