Class AbstractPrivacyEncryptor

java.lang.Object
com.wechat.pay.java.core.cipher.AbstractPrivacyEncryptor
All Implemented Interfaces:
PrivacyEncryptor
Direct Known Subclasses:
RSAPkcs1v15Encryptor, RSAPrivacyEncryptor

public abstract class AbstractPrivacyEncryptor extends Object implements PrivacyEncryptor
  • Constructor Details

    • AbstractPrivacyEncryptor

      protected AbstractPrivacyEncryptor(String transformation, PublicKey publicKey, String wechatPaySerial)
  • Method Details

    • encrypt

      public String encrypt(String plaintext)
      Description copied from interface: PrivacyEncryptor
      加密并转换为字符串
      Specified by:
      encrypt in interface PrivacyEncryptor
      Parameters:
      plaintext - 明文
      Returns:
      Base64编码的密文
    • getWechatpaySerial

      public String getWechatpaySerial()
      Description copied from interface: PrivacyEncryptor
      获取加密使用公钥所属证书的证书序列号,可设置到请求的 HTTP 头部 Wechatpay-Serial
      Specified by:
      getWechatpaySerial in interface PrivacyEncryptor
      Returns:
      证书序列号