lib

package module
v0.0.0-...-30c2940 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: BSD-2-Clause Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Name   string
	Master [3]string
	Data   string
	Dir    string
}

Container represents a password-containing file

func NewContainer

func NewContainer(name, dir, password string) (*Container, error)

NewContainer creates a new container encrypted with the given password, saved at the given file name and directory It then returns the derived container struct

func OpenContainer

func OpenContainer(name, dir string) (*Container, error)

OpenContainer returns a container struct derived from the given file name and directory

func (*Container) GetData

func (c *Container) GetData(password string) (map[string][]string, error)

GetData decrypts and returns the data that the container stores

func (*Container) GetPath

func (c *Container) GetPath() string

GetPath returns the path where the container is stored

func (*Container) SetData

func (c *Container) SetData(newData map[string][]string, password string) error

SetData encrypts the given data with the password and ensures it is the correct password, then it sets the containers .Data

func (*Container) Write

func (c *Container) Write() error

Write saves the container to its file

Jump to

Keyboard shortcuts

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