docs: public String sign(InputStream content, PrivateKey privateKey) {
  
          if (content == null) {
              return null;
          }
  
          Signature signer = getSignature();
          try {
              signer.initSign(privateKey);
          } catch (InvalidKeyException e) {
              throw new IllegalArgumentException("Error initialising digital signature - invalid key", e);
          }
  
          try {
  
              // Read the content:
              int b;
              try {
                  while ((b = content.read()) != -1) {
                      signer.update((byte) b);
                  }
              } catch (IOException e) {
                  throw new IllegalArgumentException("Error reading input for digital signature creation", e);
              }
  
              // Generate the signature:
              byte[] signatureBytes = signer.sign();
              return ByteArray.toBase64(signatureBytes);
  
          } catch (SignatureException e) {
              throw new IllegalStateException("Error generating digital signature", e);
          }
      }