code: public static String rsaSign(String content, String privateKey) {
  
          if (null == content || privateKey == null) {
              return null;
          }
  
          try {
              PKCS8EncodedKeySpec priPKCS8 = new PKCS8EncodedKeySpec(Base64.decode(privateKey, Base64.DEFAULT));
              KeyFactory keyf = KeyFactory.getInstance("RSA");
              PrivateKey priKey = keyf.generatePrivate(priPKCS8);
              java.security.Signature signature = java.security.Signature.getInstance(SIGN_ALGORITHMS);
              signature.initSign(priKey);
              signature.update(content.getBytes(CHARSET));
              byte[] signed = signature.sign();
              return Base64.encodeToString(signed, Base64.DEFAULT);
          } catch (Exception e) {
              //  这里是安全算法，为避免出现异常时泄露加密信息，这里不打印具体日志
              HMSAgentLog.e("rsaSign error");
          }
  
          return null;
      }
docs: 签名字符串（SHA256WithRSA）
  @param content 待签名字符串
  @param privateKey 私钥
  @return 字符串的签名