rsa

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: GPL-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

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

Decrypt decrypts data with private key

func Encrypt

func Encrypt(msg []byte, pub *rsa.PublicKey) ([]byte, error)

Encrypt encrypts data with public key

func GenKeypair

func GenKeypair(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)

func ImportPrivPem

func ImportPrivPem(filename string) (*rsa.PrivateKey, error)

func ImportPubPem

func ImportPubPem(filename string) (*rsa.PublicKey, error)

func PemToPrivkey

func PemToPrivkey(privkeystr string) (*rsa.PrivateKey, error)

func PemToPubkey

func PemToPubkey(pubkeystr string) (*rsa.PublicKey, error)

func WritePrivPem

func WritePrivPem(key *rsa.PrivateKey, filename string) error

func WritePubPem

func WritePubPem(key *rsa.PublicKey, filename string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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