encryptionkeyrepo

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteEncryptionKey

func DeleteEncryptionKey(tx *sqlx.Tx, tokenID mtid.MTID) error

DeleteEncryptionKey deletes the encryption key for a mytoken.

func GetEncryptionKey

func GetEncryptionKey(tx *sqlx.Tx, tokenID mtid.MTID, jwt string) (key []byte, rtID uint64, err error)

GetEncryptionKey returns the encryption key and the rtid for a mytoken

func ReencryptEncryptionKey

func ReencryptEncryptionKey(tx *sqlx.Tx, tokenID mtid.MTID, oldJWT, newJWT string) error

ReencryptEncryptionKey re-encrypts the encryption key for a mytoken. This is needed when the mytoken changes, e.g. on token rotation

Types

type EncryptionKey

type EncryptionKey string

EncryptionKey is a type for the encryption key stored in the db

func (EncryptionKey) Decrypt

func (k EncryptionKey) Decrypt(jwt string) ([]byte, error)

Decrypt returns the decrypted encryption key

Jump to

Keyboard shortcuts

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