From 13e5b3938bdbe305fcc7c8975327c5c4fe9ed9cf Mon Sep 17 00:00:00 2001 From: Lien Li Date: Mon, 7 Jun 2021 10:23:49 +0800 Subject: [PATCH] Update encryptor.go (#405) --- miniprogram/encryptor/encryptor.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/miniprogram/encryptor/encryptor.go b/miniprogram/encryptor/encryptor.go index 788054a..ea02415 100644 --- a/miniprogram/encryptor/encryptor.go +++ b/miniprogram/encryptor/encryptor.go @@ -74,8 +74,8 @@ func pkcs7Unpad(data []byte, blockSize int) ([]byte, error) { return data[:len(data)-n], nil } -// getCipherText returns slice of the cipher text -func getCipherText(sessionKey, encryptedData, iv string) ([]byte, error) { +// GetCipherText returns slice of the cipher text +func GetCipherText(sessionKey, encryptedData, iv string) ([]byte, error) { aesKey, err := base64.StdEncoding.DecodeString(sessionKey) if err != nil { return nil, err @@ -103,7 +103,7 @@ func getCipherText(sessionKey, encryptedData, iv string) ([]byte, error) { // Decrypt 解密数据 func (encryptor *Encryptor) Decrypt(sessionKey, encryptedData, iv string) (*PlainData, error) { - cipherText, err := getCipherText(sessionKey, encryptedData, iv) + cipherText, err := GetCipherText(sessionKey, encryptedData, iv) if err != nil { return nil, err }