e2e

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToPrivateKey

func BytesToPrivateKey(priv []byte) *rsa.PrivateKey

BytesToPrivateKey bytes to private key

func DecryptBytes

func DecryptBytes(encrypted []byte) ([]byte, error)

DecryptBytes decrypts json body to bytes

func DecryptWithPrivateKey

func DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) ([]byte, error)

DecryptWithPrivateKey decrypts data with private key

func GenerateRSA_Keys

func GenerateRSA_Keys(bits int) (*rsa.PrivateKey, *rsa.PublicKey)

This function generates RSA public and private keys for end to end encryption

func PrivateKeyToBytes

func PrivateKeyToBytes(priv *rsa.PrivateKey) []byte

This function parses the private key to bytes

func PublicKeyToBytes

func PublicKeyToBytes(pub *rsa.PublicKey) []byte

PublicKeyToBytes public key to bytes

func SaveKeys

func SaveKeys()

This function generates a new key pair if not exists and saves them into pem files

Types

This section is empty.

Jump to

Keyboard shortcuts

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