Documentation ¶
Overview ¶
Package rotstore provides functions for working with a rot store. For details on rot stores, see the "doc" directory in the repository.
Index ¶
- Constants
- Variables
- func CreateEmptyStore(storepath string, key []byte, params keygen.Params, markerContent []byte) error
- func CreateKeyParams(storepath string, p keygen.Params) error
- func CreateMarker(storepath string, key, content []byte) error
- func EmptyTestStore(t *testing.T) (string, func())
- func GetKey(storepath string, password []byte) ([]byte, error)
- func ReadKeyParams(storepath string) (keygen.Params, error)
- func ReadMarker(storepath string, key []byte) error
- func WalkNames(storepath string, f WalkFunc) error
- type WalkFunc
Constants ¶
const ( DirInternal = "internal" DirData = "data" )
Store subdirectory names.
Variables ¶
var ( IgnoreFiles = []string{ ".DS_Store", } IgnoreFilesSet = setFromSlice(IgnoreFiles) )
Files with these base names should be ignored during store operations.
var ( TestPassword = []byte("p1") TestKeyParams = keygen.Params{ Salt: [16]byte{1, 2, 3}, Time: 1, MemKiB: 1, Threads: 1, } TestKey = keygen.Generate(TestPassword, rotfile.KeySize, TestKeyParams) )
Values for test stores created using EmptyTestStore.
var ErrKey = errors.New("invalid key")
ErrKey is returned by func ReadMarker. See the documentation of ReadMarker for details.
var SkipAll = errors.New("skip all")
Functions ¶
func CreateEmptyStore ¶
func CreateEmptyStore(storepath string, key []byte, params keygen.Params, markerContent []byte) error
CreateEmptyStore creates a new, empty store at storepath.
func CreateKeyParams ¶
CreateKeyParams creates the "internal/keyparams" file in the store.
func CreateMarker ¶
CreateMarker creates the "internal/marker" file in the store.
func EmptyTestStore ¶
EmptyTestStore creates an empty store that can be used in tests. It returns the path to the store root directory and a cleanup function to remove the store after use.
func ReadKeyParams ¶
ReadKeyParams file decodes the "internal/keyparams" file in the store.
func ReadMarker ¶
ReadMarker checks if the "internal/marker" file in the store can be decrypeted successfully with the given key. If the key is incorrect the error will be ErrKey. The function may return other generic errors.