encryption

package
v0.0.0-...-9835270 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: AGPL-3.0, Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCrypto

func CheckCrypto(eventType string) bool

CheckCrypto check if need to use crypto

func CheckMirror

func CheckMirror(eventType string) bool

CheckMirror check if need to backup plaintext message events

func Decrypt

func Decrypt(data []byte) []byte

Decrypt decrypt []byte with key

func DecryptDebug

func DecryptDebug(data []byte) []byte

DecryptDebug decrypt data with key

func DecryptLicense

func DecryptLicense(license string) string

func Encrypt

func Encrypt(data []byte) []byte

Encrypt encrypt []byte with key

func EncryptDebug

func EncryptDebug(data []byte) []byte

EncryptDebug encrypt data with key

func Init

func Init(e bool, k string, m bool)

Init init encryption vars

func SetImpl

func SetImpl(_impl Encryption)

Types

type EmptyEncryption

type EmptyEncryption struct {
}

func (*EmptyEncryption) CheckCrypto

func (e *EmptyEncryption) CheckCrypto(eventType string) bool

CheckCrypto check if need to use crypto

func (*EmptyEncryption) CheckMirror

func (e *EmptyEncryption) CheckMirror(eventType string) bool

CheckMirror check if need to backup plaintext message events

func (*EmptyEncryption) Decrypt

func (e *EmptyEncryption) Decrypt(data []byte) []byte

Decrypt decrypt []byte with key

func (*EmptyEncryption) DecryptDebug

func (e *EmptyEncryption) DecryptDebug(data []byte) []byte

DecryptDebug decrypt data with key

func (*EmptyEncryption) DecryptLicense

func (e *EmptyEncryption) DecryptLicense(license string) string

func (*EmptyEncryption) Encrypt

func (e *EmptyEncryption) Encrypt(data []byte) []byte

Encrypt encrypt []byte with key

func (*EmptyEncryption) EncryptDebug

func (e *EmptyEncryption) EncryptDebug(data []byte) []byte

EncryptDebug encrypt data with key

func (*EmptyEncryption) Init

func (*EmptyEncryption) Init(e bool, k string, m bool)

Init init encryption vars

type Encryption

type Encryption interface {
	Init(e bool, k string, m bool)
	CheckCrypto(eventType string) bool
	CheckMirror(eventType string) bool
	Encrypt(data []byte) []byte
	Decrypt(data []byte) []byte
	DecryptLicense(license string) string
	EncryptDebug(data []byte) []byte
	DecryptDebug(data []byte) []byte
}

Jump to

Keyboard shortcuts

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