rsahelper

package
v0.0.0-...-37ac4d5 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT 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 Generate_rsa_pey_kair

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

func Rsa_Sign

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

func Rsa_Verify

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

Returns true if success

func Rsa_dec

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

func Rsa_enc

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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