rsa

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodePrivateKey

func DecodePrivateKey(key []byte) (*rsa.PrivateKey, error)

Decode Key

func Decrypt

func Decrypt(ciphertext []byte, privateKey []byte) ([]byte, error)

RSA decrypt

func Encrypt

func Encrypt(plaintext []byte, publicKey []byte) ([]byte, error)

RSA encrypt

func GenerateRSAKey

func GenerateRSAKey(bits int) (*rsa.PrivateKey, error)

Generate new RSA keypair

func SaveRSAKey

func SaveRSAKey(privateKey *rsa.PrivateKey) error

save key

func Sign

func Sign(digest, privateKey []byte) ([]byte, error)

RSA sign

func Stringify

func Stringify(privateKey *rsa.PrivateKey) (pri string, pub string, err error)

Stringify private key

func Verify

func Verify(signature, digest, publicKey []byte) (bool, error)

RSA verify

Types

This section is empty.

Jump to

Keyboard shortcuts

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