code: public static String sign(byte[] data, String privateKey) throws Exception {
          String keyBytes = Base64Utils.decode(privateKey);
          PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes.getBytes());
          KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
          PrivateKey privateK = keyFactory.generatePrivate(pkcs8KeySpec);
          Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM);
          signature.initSign(privateK);
          signature.update(data);
          return String.valueOf(Base64Utils.encode(signature.sign()));
      }
docs: <p>
  用私钥对信息生成数字签名
  </p>
  
  @param data 已加密数据
  @param privateKey 私钥(BASE64编码)
  
  @return
  @throws Exception