Documentation ¶
Index ¶
Constants ¶
const KeySize = 4096
Variables ¶
This section is empty.
Functions ¶
func CreateFiles ¶
CreateFiles creates the temporary directory and database file
Types ¶
type CryptoStorage ¶
type CryptoStorage struct {
// contains filtered or unexported fields
}
cryptoStorage is a helper struct to create an instance of SQLite-cypher that implements fiber.Storage interface.
func CreateCryptoStorage ¶
func CreateCryptoStorage(dbFile string) (conn *CryptoStorage, err error)
CreateCryptoStorage creates a SQLite-cypher encrypted storage for X25519 keys It needs to be called inside main function so that the temporary directory it uses is not discarded upon return.
func (*CryptoStorage) Conn ¶
func (s *CryptoStorage) Conn() *sql.DB
func (*CryptoStorage) Delete ¶
func (s *CryptoStorage) Delete(key string) error
Delete deletes a key in the storage.
func (*CryptoStorage) Get ¶
func (s *CryptoStorage) Get(key string) ([]byte, error)
Get returns the value of a key in the storage.
func (*CryptoStorage) Reset ¶
func (s *CryptoStorage) Reset() error
Reset resets the storage, removing all keys.
type Keys ¶
type Keys struct { Identifier uuid.UUID Private *age.X25519Identity Public *age.X25519Recipient }
Keys holds the information used for volatile identification of a particular user
func GenerateKeys ¶
@function GenerateKeys @description Generates a (volatile) public and private key pair to be used for intermediary encryption in the frontend @returns Keys, error NOTE: should probably also expect some persistent key based identification to be passed as a parameter to make impersonation harder