Documentation
¶
Index ¶
- func AesCBCEncryptToBytes(jsonData []byte, secretKey string) ([]byte, error)
- func AesCBCEncryptToString(originData []byte, secretKey string) (string, error)
- func AesDecryptToBytes(data, secretKey string) ([]byte, error)
- func AesDecryptToMap(data, secretKey string) (mapData map[string]interface{}, err error)
- func AesDecryptToStruct(data, secretKey string, beanPtr interface{}) (err error)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(origData []byte) (bs []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesCBCEncryptToBytes ¶ added in v1.0.2
加密后的Bytes数组
func AesCBCEncryptToString ¶ added in v1.0.2
加密后转成Base64字符串
func AesDecryptToBytes ¶ added in v1.0.2
解密数据的Bytes数组
func AesDecryptToMap ¶ added in v1.0.2
解密数据到Map集合
func AesDecryptToStruct ¶ added in v1.0.2
解密数据到结构体
func PKCS5Padding ¶
加密填充模式(添加补全码) PKCS5Padding 加密时,如果加密bytes的length不是blockSize的整数倍,需要在最后面添加填充byte
func PKCS5UnPadding ¶
解密填充模式(去除补全码) PKCS5UnPadding 解密时,需要在最后面去掉加密时添加的填充byte
func PKCS7Padding ¶
加密填充模式(添加补全码) PKCS5Padding 加密时,如果加密bytes的length不是blockSize的整数倍,需要在最后面添加填充byte
func PKCS7UnPadding ¶
解密填充模式(去除补全码) PKCS7UnPadding 解密时,需要在最后面去掉加密时添加的填充byte
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.