rsahelper

package
v0.0.0-...-4c74233 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptOAEP

func DecryptOAEP(hash hash.Hash, random io.Reader, private *rsa.PrivateKey, msg []byte, label []byte) ([]byte, error)

func EncryptOAEP

func EncryptOAEP(hash hash.Hash, random io.Reader, public *rsa.PublicKey, msg []byte, label []byte) ([]byte, error)

func ExportPEMStrToPrivKey

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

func ExportPEMStrToPubKey

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

func ExportPrivKeyAsPEMStr

func ExportPrivKeyAsPEMStr(privkey *rsa.PrivateKey) string

func ExportPubkeyAsPEMStr

func ExportPubkeyAsPEMStr(pubkey *rsa.PublicKey) string

func GenerateRsaKeyPair

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

func RsaDec

func RsaDec(pri *rsa.PrivateKey, dat []byte) []byte

func RsaEnc

func RsaEnc(pub *rsa.PublicKey, dat []byte) []byte

func RsaSign

func RsaSign(pri *rsa.PrivateKey, dat []byte) []byte

func RsaVerify

func RsaVerify(pub *rsa.PublicKey, sig []byte, dat []byte) bool

Returns true if success

Types

This section is empty.

Jump to

Keyboard shortcuts

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