code: public void sign(PrivateKey key, String digest) throws NoSuchAlgorithmException, NoSuchPaddingException,
          InvalidKeyException, BadPaddingException, IllegalBlockSizeException {
          add(Feature.Create.stringFeature(DIGEST_KEY, digest));
          final var digester = MessageDigest.getInstance(digest);
          final var ser = unsigned();
          final var digestValue = digester.digest(ser);
          final var cipher = Cipher.getInstance(key.getAlgorithm());
          cipher.init(Cipher.ENCRYPT_MODE, key);
          final var signature = cipher.doFinal(digestValue);
          add(signature);
      }
docs: Sign the license.
  <p>
  The license is signed the following way:
  <ol>
  <li>Add the digest algorithm string to the license as a feature. The feature name is {@code signatureDigest}
  (name is defined in the constant {@link #DIGEST_KEY} in this class).
  </li>
  <li>The license is converted to binary format</li>
  <li>A digest is created from the binary license using the message digest algorithm named by the {@code digest}
  parameter</li>
  <li>The digest is encrypted using the key (which also has the information about the algorithm).</li>
  <li>The encrypted digest is added to the license as a new {@code BINARY} feature as signature.</li>
  </ol>
  
  @param key    the private key to be used to create the signature
  @param digest the name of the digest algorithm
  @throws NoSuchAlgorithmException  this exception comes from the underlying encryption library
  @throws NoSuchPaddingException    this exception comes from the underlying encryption library
  @throws InvalidKeyException       this exception comes from the underlying encryption library
  @throws BadPaddingException       this exception comes from the underlying encryption library
  @throws IllegalBlockSizeException this exception comes from the underlying encryption library