Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrUnsecurePassphrase = fmt.Errorf("the passphrase does not meet the security requirements")
)
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is the struct that represents the command line interface of MyKeys. Ir has the filepath of the passwords file, the passphrase to encrypt and decrypt it and a password map.
func New ¶
New returns an empty API with the given passphrase. It also inits the passwords map. It converts the passphrase from string to a slice of bytes.
func (*API) Export ¶
Export encrypts with the CLI passphrase, and exports the passwords map to a base64url encoded string. It returns an error if the passwords encryption or the base64 encoding fails.
func (*API) Get ¶
Get returns the password with the given alias. If json is true, it will print the json representation of the password. If json is false, it will print the string representation of the password.
func (*API) Import ¶
Import imports the passwords from the base64url encoded string and passphrase provided. It returns an error if the base64url decoding, the passwords decryption or the passwords import fails.