rsa

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodePrivateKey

func DecodePrivateKey(pemkey string) (*rsa.PrivateKey, error)

func DecodePublicKey

func DecodePublicKey(pemkey string) (*rsa.PublicKey, error)

func Decrypt

func Decrypt(input []byte, privateKey *rsa.PrivateKey) ([]byte, error)

func Encrypt

func Encrypt(input []byte, publicKey *rsa.PublicKey) ([]byte, error)

func GenerateKeysPair

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

func LoadPrivateKey

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

func LoadPublicKey

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

func PrivateKeyPem

func PrivateKeyPem(key *rsa.PrivateKey) string

func PublicKeyPem

func PublicKeyPem(key *rsa.PublicKey) string

func SavePrivateKey

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

func SavePublicKey

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

func Sign

func Sign(message []byte, privateKey *rsa.PrivateKey) ([]byte, error)

func Verify

func Verify(message []byte, signature []byte, publicKey *rsa.PublicKey) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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