rsa

package
v0.0.0-...-6113c70 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(ciphertext string, privateKey string) (string, error)

Decrypt RSA解密 privateKey 解密时候用到的秘钥

func Encrypt

func Encrypt(origData string, publicKey string) (string, error)

Encrypt RSA加密 publicKey 加密时候用到的公钥

func GenRsaKey

func GenRsaKey() (privKey, pubKey string, err error)

GenRsaKey RSA公钥/私钥对生成,默认长度4096

func RsaSign

func RsaSign(message string, privateKey string, mode string) (string, error)

RsaSign 使用RSA生成签名 privateKey 加密时使用的秘钥 mode 加密的模式[目前只支持MD5,SHA1,不区分大小写]

func RsaVerify

func RsaVerify(src string, sign string, publicKey string, mode string) (pass bool, err error)

RsaVerify 校验签名 publicKey 验证签名的公钥 mode 加密的模式[目前只支持MD5,SHA1,不区分大小写]

Types

This section is empty.

Jump to

Keyboard shortcuts

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