aes_gcm

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AESGCM

type AESGCM struct {
	// contains filtered or unexported fields
}

AESGCM is used to en-/decrypt the generated jwks with AES-GCM

func NewAESGCM

func NewAESGCM(keys []string) (*AESGCM, error)

Construct a AES GCM encrypter/decrypter and check the keys as a prerequisite

func (*AESGCM) Decrypt

func (a *AESGCM) Decrypt(ciphertext string) (plaintext []byte, err error)

Decrypt tries to decrypt with every key in the list

func (*AESGCM) Encrypt

func (a *AESGCM) Encrypt(plaintext []byte) (string, error)

Encrypt encrypts some data with the first key in list and base64 encodes it for storage in database. mostly copy/pasted from https://github.com/gtank/cryptopasta/blob/master/encrypt.go

Jump to

Keyboard shortcuts

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