Class BasicSignatureOptions

java.lang.Object
xades4j.production.BasicSignatureOptions

public final class BasicSignatureOptions extends Object
Configuration of basic signature options such as whether ds:KeyInfo elements should be included.
Author:
luis
See Also:
  • Constructor Details

    • BasicSignatureOptions

      public BasicSignatureOptions()
  • Method Details

    • checkKeyUsage

      public BasicSignatureOptions checkKeyUsage(boolean enabled)
      Configures whether to check that the keyUsage of the signing certificate allows use for signing before creating a signature. If enabled (the default) signing will fail if the keyUsage of the certificate does not allow signing. You should only disable this for testing.
      Parameters:
      enabled - true to enable the check, false to disable
      Returns:
      the current instance
    • checkCertificateValidity

      public BasicSignatureOptions checkCertificateValidity(boolean enabled)
      Configures whether to check that an invalid (time) signing certificate is allowed for signing before creating a signature. If enabled (the default) signing will fail if the certificate is invalid in time (expired or not yet valid). You should only disable this for testing.
      Parameters:
      enabled - true to enable the check, false to disable
      Returns:
      the current instance
    • includeSigningCertificate

      public BasicSignatureOptions includeSigningCertificate(SigningCertificateMode includeSigningCertificateMode)
      Configures whether the signing certificate / chain should be included in ds:KeyInfo. Defauls to SigningCertificateMode.SIGNING_CERTIFICATE.
      Parameters:
      includeSigningCertificateMode - the include mode
      Returns:
      the current instance
    • includeSubjectName

      public BasicSignatureOptions includeSubjectName(boolean includeSubjectName)
      Configures whether the subject name should be included in ds:KeyInfo. Defaults to false.
      Parameters:
      includeSubjectName - true if the subject name should be included; false otherwise
      Returns:
      the current instance
    • includeIssuerSerial

      public BasicSignatureOptions includeIssuerSerial(boolean includeIssuerSerial)
      Configures whether the issuer/serial should be included in ds:KeyInfo. Defaults to false.
      Parameters:
      includeIssuerSerial - true if the issuer/serial should be included; false otherwise
      Returns:
      the current instance
    • includePublicKey

      public BasicSignatureOptions includePublicKey(boolean includePublicKey)
      Configures whether a ds:KeyValue element containing the public key's value should be included in ds:KeyInfo. Defaults to false.
      Parameters:
      includePublicKey - true if the public key should be included; false otherwise
      Returns:
      the current instance
    • signKeyInfo

      public BasicSignatureOptions signKeyInfo(boolean signKeyInfo)
      Configures whether the signature should cover the ds:KeyInfo element. Defaults to false.
      Parameters:
      signKeyInfo - true if the ds:KeyInfo should be signed; false otherwise
      Returns:
      the current instance