Class SignOptions

java.lang.Object
co.ankatech.ankasecure.sdk.model.SignOptions

public final class SignOptions extends Object
Options of an operation that produces a signature: sign, signFileCompact, signThenEncrypt, signThenEncryptFileCompact and resignFileStream.

An option left unset is not sent, so the server applies its own default: a signature with no validityDays does not expire. New options are added to this type rather than as new method overloads.


 SignResult signed = sdk.sign("my-ml-dsa-key", data, null,
         SignOptions.builder().validityDays(365).build());
 
  • Field Details

    • MIN_VALIDITY_DAYS

      public static final long MIN_VALIDITY_DAYS
      The smallest validity the API accepts, in days.
      See Also:
    • MAX_VALIDITY_DAYS

      public static final long MAX_VALIDITY_DAYS
      The largest validity the API accepts, in days. A deployment may configure a lower maximum (ankasecure.jws.local-clock.max-validity-days, 730 by default); the server refuses a value above it with 400 naming validityDays.
      See Also:
  • Method Details

    • none

      public static SignOptions none()
      Returns:
      the options that set nothing: the server's defaults apply
    • builder

      public static SignOptions.Builder builder()
      Returns:
      a builder with nothing set
    • validityDays

      public OptionalLong validityDays()
      Returns:
      the signature's validity in days (its exp is iat plus this many days), or empty when the signature does not expire
    • toString

      public String toString()
      Overrides:
      toString in class Object