Class PKCS7Encoder

java.lang.Object
com.bytedesk.wechat.common.aes.PKCS7Encoder

class PKCS7Encoder extends Object
提供基于PKCS7算法的加解密接口.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static int
     
    (package private) static Charset
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static char
    chr(int a)
    将数字转化成ASCII码对应的字符,用于对明文进行补码
    (package private) static byte[]
    decode(byte[] decrypted)
    删除解密后明文的补位字符
    (package private) static byte[]
    encode(int count)
    获得对明文进行补位填充的字节.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CHARSET

      static Charset 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:
      转化得到的字符