crypto

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTooShort = errors.New("SealedSecret data is too short")

ErrTooShort indicates the provided data is too short to be valid

Functions

func HybridDecrypt

func HybridDecrypt(rnd io.Reader, privKey *rsa.PrivateKey, ciphertext, label []byte) ([]byte, error)

HybridDecrypt performs a regular AES-GCM + RSA-OAEP decryption

func HybridEncrypt

func HybridEncrypt(rnd io.Reader, pubKey *rsa.PublicKey, plaintext, label []byte) ([]byte, error)

HybridEncrypt performs a regular AES-GCM + RSA-OAEP encryption. The output bytestring is:

RSA ciphertext length || RSA ciphertext || AES ciphertext

Types

This section is empty.

Jump to

Keyboard shortcuts

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