crypto

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AesKeyLength        = 32
	AnnotationBase64    = "@base64:"
	AnnotationEncrypted = "@encrypted:"
	HeaderLength        = 2
)

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(cipherBytes []byte, key *rsa.PrivateKey) ([]byte, error)

func Encrypt

func Encrypt(plainBytes []byte, pubKey *rsa.PublicKey) ([]byte, error)

func TryDecrypt

func TryDecrypt(payload string, key *rsa.PrivateKey) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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