crypto

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: Apache-2.0 Imports: 12 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 ParseCertificate added in v0.6.0

func ParseCertificate(certPemBytes []byte) (*x509.Certificate, error)

func ParsePrivateKey added in v0.6.0

func ParsePrivateKey(keyPemBytes []byte) (*rsa.PrivateKey, 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