filestore

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package filestore implements a secure passmgr.Store. The contents are stored encrypted in a single file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeKey

func ChangeKey(store passmgr.Store, newPassphrase string) error

ChangeKey generates a new salt and key for a Store. This function will panic if store was not created by ReadFileStore.

func Read

func Read(filename, passphrase string) (passmgr.Store, error)

Read reads and decrypts the encrypted contents of a Store from the specified file.

The file starts with a magic number to identify the file format version. Currently only the format 'passmgr1' is supported.

 0      7 8                             39 40        51 52           n
+--------+--------------------------------+------------+-----    -----+
|passmgr1|              salt              |   nonce    |  ciphertext  |
+--------+--------------------------------+------------+-----    -----+

passmgr1:   70 61 73 73 6d 67 72 01
salt:       32 byte salt for scrypt key derivation
nonce:      12 byte random nonce for aes-gcm
ciphertext: aes256-gcm encrypted json encoded content of Store

func Write

func Write(store passmgr.Store) error

Write persists a Store to the file it was read from. This function will panic if store was not created by ReadFileStore.

Types

This section is empty.

Jump to

Keyboard shortcuts

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