code: public static String rsaDecrypt(String content, String privateKey,
                                      String charset) throws AlipayApiException {
          try {
              PrivateKey priKey = getPrivateKeyFromPKCS8(AlipayConstants.SIGN_TYPE_RSA,
                  new ByteArrayInputStream(privateKey.getBytes()));
              Cipher cipher = Cipher.getInstance(AlipayConstants.SIGN_TYPE_RSA);
              cipher.init(Cipher.DECRYPT_MODE, priKey);
              byte[] encryptedData = StringUtils.isEmpty(charset)
                  ? Base64.decodeBase64(content.getBytes())
                  : Base64.decodeBase64(content.getBytes(charset));
              int inputLen = encryptedData.length;
              ByteArrayOutputStream out = new ByteArrayOutputStream();
              int offSet = 0;
              byte[] cache;
              int i = 0;
              // 对数据分段解密  
              while (inputLen - offSet > 0) {
                  if (inputLen - offSet > MAX_DECRYPT_BLOCK) {
                      cache = cipher.doFinal(encryptedData, offSet, MAX_DECRYPT_BLOCK);
                  } else {
                      cache = cipher.doFinal(encryptedData, offSet, inputLen - offSet);
                  }
                  out.write(cache, 0, cache.length);
                  i++;
                  offSet = i * MAX_DECRYPT_BLOCK;
              }
              byte[] decryptedData = out.toByteArray();
              out.close();
  
              return StringUtils.isEmpty(charset) ? new String(decryptedData)
                  : new String(decryptedData, charset);
          } catch (Exception e) {
              throw new AlipayApiException("EncodeContent = " + content + ",charset = " + charset, e);
          }
      }
docs: 私钥解密
  
  @param content    待解密内容
  @param privateKey 私钥
  @param charset    字符集，如UTF-8, GBK, GB2312
  @return 明文内容
  @throws AlipayApiException