handlers

package
v0.0.0-...-f25d604 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IncorrectPassError = "incorrect pass"
)

IncorrectPassError defines the error message for incorrect password

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(note []byte, decryptedAAD []byte) (string, error)

Decrypt decrypts the provided note with the aad, returning decrypted note and errors, if any

func DecryptAAD

func DecryptAAD(data db.Data, pass string) ([]byte, error)

DecryptAAD checks if the data corresponds with the provided pass returns decrypted AAD and errors, if any

func Encrypt

func Encrypt(note string, password string) ([]byte, [32]byte, []byte, error)

Encrypt encrypts a note with the pass and returns an encrypted AAD and encrypted note

func RandString

func RandString(n int) string

RandString generates a random string of n letters long

func WithContentJSON

func WithContentJSON(next http.Handler) http.Handler

WithContentJSON middleware sets writer's Content-Type header to application/json

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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