Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( NONCE_SIZE = 12 KEY_ENTROPY_SIZE = 32 KEY_SIZE = 16 )
Functions ¶
func Decrypt ¶
Decrypt takes a Key and AESGCM encrypted IV+ciphertext data and returns the plaintext.
@callable: crypto.decrypt @param: key @Key @param: data @String @retval: plaintext @String @retval: err @Error
@usage: p, err = crypto.decrypt(key, data)
Types ¶
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key is a basic type alias for string that will let us provide linting within scripts WARNING: This is NOT how you should normally handle keys in go.
func CreateKey ¶
CreateKey creates a new Key object to be passed around given the value. Will also error if passed value is not valid base64/the key is not KEY_SIZE bytes.
func GenerateKey ¶
GenerateKey creates a new Key object to be passed around.
@callable: crypto.generateKey @retval: key @Key @retval: err @Error
@usage: k, err = crypto.generateKey()
func ParseParam ¶
ParseParam from starlark input
func (Key) Freeze ¶
func (k Key) Freeze()
Freeze is a no-op since the underlying file is safe for concurrent use.