keystore

package
v0.0.0-...-56ad08b Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyStore

type KeyStore struct {
	Values map[string]string
	// contains filtered or unexported fields
}

KeyStore represents the encrypted keystore.

func GetKeyStore

func GetKeyStore(key, path string) (*KeyStore, error)

GetKeyStore opens an already existing keystore.

func MakeKeyStore

func MakeKeyStore(key, path string) (*KeyStore, error)

MakeKeyStore creates a new keystore.

func (*KeyStore) Decrypt

func (k *KeyStore) Decrypt(ciphertext []byte) (string, error)

Decrypt performs decryption using the keystore's key and iv.

func (*KeyStore) Decrypter

func (k *KeyStore) Decrypter(r io.Reader) (*cipher.StreamReader, error)

Decrypter wants to do interface chaining for io.Reader.

func (*KeyStore) Delete

func (k *KeyStore) Delete(key string)

Delete removes a key from values.

func (*KeyStore) Encrypt

func (k *KeyStore) Encrypt(plaintext string) ([]byte, error)

Encrypt performs encryption using the keystore's key and IV.

func (*KeyStore) Encrypter

func (k *KeyStore) Encrypter(w io.Writer) (*cipher.StreamWriter, error)

Encrypter wants to do interface chaining for io.Writer.

func (*KeyStore) Get

func (k *KeyStore) Get(key string) (string, error)

Get returns the value of a specific key.

func (*KeyStore) List

func (k *KeyStore) List() []string

List returns a string listing all valid keys.

func (*KeyStore) SaveKeyStore

func (k *KeyStore) SaveKeyStore() error

SaveKeyStore save the keystore to disk.

func (*KeyStore) Set

func (k *KeyStore) Set(key, val string) error

Set assigns a value to a key, if key does not exist, it's added.

func (KeyStore) String

func (k KeyStore) String() string

String() is the stringer for KeyStore.

Jump to

Keyboard shortcuts

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