Package com.bytedesk.wechat.common.aes
Class PKCS7Encoder
java.lang.Object
com.bytedesk.wechat.common.aes.PKCS7Encoder
提供基于PKCS7算法的加解密接口.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
CHARSET
-
BLOCK_SIZE
static int BLOCK_SIZE
-
-
Constructor Details
-
PKCS7Encoder
PKCS7Encoder()
-
-
Method Details
-
encode
static byte[] encode(int count) 获得对明文进行补位填充的字节.- Parameters:
count
- 需要进行填充补位操作的明文字节个数- Returns:
- 补齐用的字节数组
-
decode
static byte[] decode(byte[] decrypted) 删除解密后明文的补位字符- Parameters:
decrypted
- 解密后的明文- Returns:
- 删除补位字符后的明文
-
chr
static char chr(int a) 将数字转化成ASCII码对应的字符,用于对明文进行补码- Parameters:
a
- 需要转化的数字- Returns:
- 转化得到的字符
-