code: public static String sign(PrivateKey key, String content) throws Exception {
          Signature signature = Signature.getInstance(SIGN_ALGORITHM);
          signature.initSign(key);
          signature.update(content.getBytes());
          return Base64.encodeBase64String(signature.sign());
      }
docs: Returns the digital signature for the specified content.
  
  @param key The private key to sign the content.
  @param content The content to sign.
  @return The digital signature.
  @throws Exception Unspecified exception.