cryptService

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RSAKey struct {
	Public  []byte
	Private []byte
}

Functions

func AesDecrypt

func AesDecrypt(cipherText, key, iv []byte) ([]byte, error)

AesDecrypt AES解密CRT

func AesEncrypt

func AesEncrypt(plainText, key []byte, iv []byte) ([]byte, error)

AesEncrypt AES加密CRT

func GenKey

func GenKey(length int) (string, error)

func GenKeyByte

func GenKeyByte(length int) ([]byte, error)

func GenerateRSAKey

func GenerateRSAKey(bits int)

GenerateRSAKey 生成RSA私钥和公钥,保存到文件中 bits 证书大小

func RSADecrypt

func RSADecrypt(cipherText []byte, key []byte) []byte

RSADecrypt RSA解密 cipherText 需要解密的byte数据

func RSAEncrypt

func RSAEncrypt(plainText []byte, key []byte) []byte

RSAEncrypt RSA加密 plainText 要加密的数据

func ReadRSAKey

func ReadRSAKey(path string) []byte

func SetRsaKey

func SetRsaKey()

Types

This section is empty.

Jump to

Keyboard shortcuts

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