Version: v0.0.0-...-9c5d08f Latest Latest

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

Go to latest
Published: Nov 21, 2013 License: BSD-2-Clause Imports: 8 Imported by: 0




This section is empty.


UserKeys is the set of decrypted keys in memory, indexed by name.


func AddKeyFromRecord

func AddKeyFromRecord(record passvault.PasswordRecord, name string, password string, uses int, durationString string) (err error)

AddKeyFromRecord decrypts a key for a given record and adds it to the cache.

func DecryptKey

func DecryptKey(in []byte, name string, rsaEncryptedKey []byte) (out []byte, err error)

DecryptKey decrypts a 16 byte key using the key corresponding to the name parameter for AES keys, the cached AES key is used directly to decrypt in for RSA keys, the cached RSA key is used to decrypt the rsaEncryptedKey which is then used to decrypt the input buffer.

func EncryptKey

func EncryptKey(in []byte, name string, override []byte) (out []byte, err error)

EncryptKey encrypts a 16 byte key using the cached key corresponding to name. For AES keys, use the cached key. For RSA keys, the cache is not necessary use the override key instead.

func FlushCache

func FlushCache()

FlushCache removes all delegated keys.

func GetSummary

func GetSummary() map[string]ActiveUser

GetSummary returns the list of active user keys.

func Refresh

func Refresh()

Refresh purges all expired or used up keys.


type ActiveUser

type ActiveUser struct {
	Admin  bool
	Type   string
	Expiry time.Time
	Uses   int
	// contains filtered or unexported fields

ActiveUser holds the information about an actively delegated key.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL