rsa

package
v0.0.0-...-51ab043 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptWithPrivateKey

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

DecryptWithPrivateKey decrypts data with private key

func EncryptWithPublicKey

func EncryptWithPublicKey(ciphertext []byte, pubKey *rsa.PublicKey) []byte

EncryptWithPublicKey function

func GeneratePEMKeys

func GeneratePEMKeys(priKeyPath string, pubKeyPath string)

GeneratePEMKeys and save them

func LoadPemKeyFromFile

func LoadPemKeyFromFile(fileName string) (privateKey *rsa.PrivateKey, err error)

LoadPemKeyFromFile function

func LoadPemPubKeyFromFile

func LoadPemPubKeyFromFile(fileName string) (publicKey *rsa.PublicKey, err error)

LoadPemPubKeyFromFile function

func LoadPrivKeyFromString

func LoadPrivKeyFromString(privKey []byte) (privateKey *rsa.PrivateKey, err error)

LoadPrivKeyFromString function

func LoadPubKeyFromString

func LoadPubKeyFromString(pubKey string) (publicKey *rsa.PublicKey, err error)

LoadPubKeyFromString function

func SavePEMKey

func SavePEMKey(fileName string, key *rsa.PrivateKey)

SavePEMKey to file

func SavePublicPEMKey

func SavePublicPEMKey(fileName string, pubKey rsa.PublicKey)

SavePublicPEMKey to file

Types

This section is empty.

Jump to

Keyboard shortcuts

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