encrypt

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PEM_ENCRYPTION_KEY = "ENCRYPTION KEY"
	PEM_ENCRYPTED_DATA = "ENCRYPTED DATA"
)
View Source
const (
	AES_128 = algorithm(16)
	AES_192 = algorithm(24)
	AES_256 = algorithm(32)
)
View Source
const (
	ALGO_AES_128 = "AES-128"
	ALGO_AES_192 = "AES-192"
	ALGO_AES_256 = "AES-256"
)
View Source
const ALGO = "algorithm"

Variables

This section is empty.

Functions

func AlgoForKey

func AlgoForKey(key []byte) (algorithm, error)

func Decrypt

func Decrypt(key []byte, cipherText []byte) ([]byte, error)

func Encrypt

func Encrypt(key []byte, data []byte) ([]byte, error)

func EncryptedToPem

func EncryptedToPem(algo algorithm, data []byte) []byte

func GetEncyptedData

func GetEncyptedData(data []byte) ([]byte, algorithm)

func KeyFromAny

func KeyFromAny(k interface{}) ([]byte, error)

func KeyFromPem

func KeyFromPem(data []byte) ([]byte, error)

func KeyToPem

func KeyToPem(data []byte) []byte

func NewKey

func NewKey(t algorithm) ([]byte, error)

func OptionalDecrypt

func OptionalDecrypt(key []byte, data []byte) ([]byte, error)

func ReadKey

func ReadKey(path string, fss ...vfs.FileSystem) ([]byte, error)

func WriteKey

func WriteKey(key []byte, path string, fss ...vfs.FileSystem) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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