encrypt

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encryptor

type Encryptor struct{}

func NewEncryptor

func NewEncryptor() *Encryptor

func (*Encryptor) DecryptAccessToken

func (e *Encryptor) DecryptAccessToken(ciphertext, keyString string) ([]byte, error)

DecryptAccessToken decrypts AES-GCM encoded ciphertext, returning a byte slice representing an access token

func (*Encryptor) EncryptAccessToken

func (e *Encryptor) EncryptAccessToken(plaintext []byte, keyString string) (string, error)

EncryptAccessToken securely encrypts the plaintext token using AES-GCM. The returned string is base64-encoded and safe to store.

type EncryptorService

type EncryptorService interface {
	EncryptAccessToken(plaintext []byte, keyString string) (string, error)
	DecryptAccessToken(ciphertext, keyString string) ([]byte, error)
}

Encryptor service interface

Jump to

Keyboard shortcuts

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