rsa

package
v0.0.0-...-d1e1ff0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RSA = &RSASecurity{}

Functions

func GenerateRSAKey

func GenerateRSAKey(bits int) (priKey, pubKey []byte, err error)

GenerateRSAKey 创建RSA 常用位数 1024 2048 4096

func GenerateRSAKeyInFile

func GenerateRSAKeyInFile(bits int, filePath string) (err error)

GenerateRSAKeyInFile 创建公私钥并写入文件

func GenerateRSAKeyWithPwd

func GenerateRSAKeyWithPwd(passwd string, bits int) (priKey, pubKey string, err error)

GenerateRSAKeyWithPwd 创建带密码的RSA

func RSADecryptOAEP

func RSADecryptOAEP(cipherText, privCipherKey []byte) (plainText []byte, err error)

RSADecryptOAEP 私钥解密

func RSAEncrypt

func RSAEncrypt(plainText, key []byte) (cryptText []byte, err error)

RSAEncrypt rsa加密

func RSAEncryptOAEP

func RSAEncryptOAEP(plainText []byte, pubCipherKey []byte) (cipherText []byte, err error)

RSAEncryptOAEP 公钥加密

func RsaDecrypt

func RsaDecrypt(cryptText, key []byte) (plainText []byte, err error)

RsaDecrypt rsa解密

func RsaSignPKCS1v15

func RsaSignPKCS1v15(msg, Key []byte) (cryptText []byte, err error)

RsaSignPKCS1v15 rsa签名

func RsaVerifySignPKCS1v15

func RsaVerifySignPKCS1v15(msg []byte, sign []byte, Key []byte) bool

RsaVerifySignPKCS1v15 rsa验证签名

Types

type RSASecurity

type RSASecurity struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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