Class AbstractSerializableSignatureParameters<TP extends SerializableTimestampParameters>

java.lang.Object
eu.europa.esig.dss.model.AbstractSerializableSignatureParameters<TP>
Type Parameters:
TP - implementation of SerializableTimestampParameters
All Implemented Interfaces:
SerializableSignatureParameters, Serializable
Direct Known Subclasses:
AbstractSignatureParameters

public abstract class AbstractSerializableSignatureParameters<TP extends SerializableTimestampParameters> extends Object implements SerializableSignatureParameters
Parameters for a Signature creation/extension
See Also:
  • Field Details

    • contentTimestampParameters

      protected TP extends SerializableTimestampParameters contentTimestampParameters
      The object representing the parameters related to the content timestamp (Baseline-B)
    • signatureTimestampParameters

      protected TP extends SerializableTimestampParameters signatureTimestampParameters
      The object representing the parameters related to the signature timestamp (Baseline-T)
    • archiveTimestampParameters

      protected TP extends SerializableTimestampParameters archiveTimestampParameters
      The object representing the parameters related to the archive timestamp (Baseline-LTA)
  • Constructor Details

    • AbstractSerializableSignatureParameters

      protected AbstractSerializableSignatureParameters()
      Default constructor instantiating object with default values
  • Method Details

    • isCheckCertificateRevocation

      public boolean isCheckCertificateRevocation()
      Description copied from interface: SerializableSignatureParameters
      Indicates whether a revocation check shall be performed before -LT level incorporation (i.e. on signing or T-level creation) for a signing certificate and a respectful certificate chain. When set to false, the revocation check is not performed. When set to true, a real-time revocation is being requested from external sources (shall be defined in CertificateVerifier) and processed according to alerts set within that CertificateVerifier.

      Default value : false (no revocation check is performed on signature creation or T-level extension)

      Specified by:
      isCheckCertificateRevocation in interface SerializableSignatureParameters
      Returns:
      if signature with a revoked certificate is allowed
    • setCheckCertificateRevocation

      public void setCheckCertificateRevocation(boolean checkCertificateRevocation)
      Allows setting whether a revocation status for a signing certificate should be checked on signature creation or T-level extension.

      NOTE: in order to specify a behavior for this check, the relevant alerts should be specified within a CertificateVerifier instance, used in a service for signing/extension

      Default : false (do not perform revocation data check on signature creation/T-level extension)

      Parameters:
      checkCertificateRevocation - indicated if a certificate revocation check shall be performed
    • isGenerateTBSWithoutCertificate

      public boolean isGenerateTBSWithoutCertificate()
      Indicates if it is possible to generate ToBeSigned data without the signing certificate. The default values is false.
      Specified by:
      isGenerateTBSWithoutCertificate in interface SerializableSignatureParameters
      Returns:
      true if signing certificate is not required when generating ToBeSigned data.
    • setGenerateTBSWithoutCertificate

      public void setGenerateTBSWithoutCertificate(boolean generateTBSWithoutCertificate)
      Allows to change the default behaviour regarding the requirements of signing certificate to generate ToBeSigned data. NOTE: when using this method, it is important to ensure the same EncryptionAlgorithm is provided within #setEncryptionAlgorithm as the one used on a signature value creation
      Parameters:
      generateTBSWithoutCertificate - true if it should be possible to generate ToBeSigned data without certificate.
    • getSignatureLevel

      public SignatureLevel getSignatureLevel()
      Get signature level: XAdES_BASELINE_T, CAdES_BASELINE_LTA...
      Returns:
      the expected signature level
    • setSignatureLevel

      public void setSignatureLevel(SignatureLevel signatureLevel)
      Set signature level. This field cannot be null.
      Parameters:
      signatureLevel - the expected signature level
    • getSignaturePackaging

      public SignaturePackaging getSignaturePackaging()
      Get Signature packaging
      Returns:
      the expected signature packaging
    • setSignaturePackaging

      public void setSignaturePackaging(SignaturePackaging signaturePackaging)
      Set Signature packaging
      Parameters:
      signaturePackaging - the expected signature packaging
    • getDigestAlgorithm

      public DigestAlgorithm getDigestAlgorithm()
      Description copied from interface: SerializableSignatureParameters
      Get the digest algorithm
      Specified by:
      getDigestAlgorithm in interface SerializableSignatureParameters
      Returns:
      the digest algorithm
    • setDigestAlgorithm

      public void setDigestAlgorithm(DigestAlgorithm digestAlgorithm)
      Set the digest algorithm
      Parameters:
      digestAlgorithm - the digest algorithm to set
    • getEncryptionAlgorithm

      public EncryptionAlgorithm getEncryptionAlgorithm()
      Description copied from interface: SerializableSignatureParameters
      Get the encryption algorithm
      Specified by:
      getEncryptionAlgorithm in interface SerializableSignatureParameters
      Returns:
      the encryption algorithm.
    • setEncryptionAlgorithm

      public void setEncryptionAlgorithm(EncryptionAlgorithm encryptionAlgorithm)
      This method sets encryption algorithm to be used on signature creation. The method is useful when a specific encryption algorithm is expected. The defined encryption algorithm shall be the one used to create the SignatureValue. Note: The encryption algorithm is automatically extracted from the certificate's key with #setSigningCertificate method.
      Parameters:
      encryptionAlgorithm - the encryption algorithm to use
    • getSignatureAlgorithm

      public SignatureAlgorithm getSignatureAlgorithm()
      Description copied from interface: SerializableSignatureParameters
      Gets the signature algorithm.
      Specified by:
      getSignatureAlgorithm in interface SerializableSignatureParameters
      Returns:
      the signature algorithm
    • getReferenceDigestAlgorithm

      public DigestAlgorithm getReferenceDigestAlgorithm()
      Get the digest algorithm for ds:Reference or message-digest attribute
      Returns:
      the digest algorithm for ds:Reference or message-digest attribute
    • setReferenceDigestAlgorithm

      public void setReferenceDigestAlgorithm(DigestAlgorithm referenceDigestAlgorithm)
      Sets the DigestAlgorithm to be used for reference digest calculation
      Parameters:
      referenceDigestAlgorithm - DigestAlgorithm
    • bLevel

      public BLevelParameters bLevel()
      Get Baseline B parameters (signed properties)
      Specified by:
      bLevel in interface SerializableSignatureParameters
      Returns:
      the Baseline B parameters
    • setBLevelParams

      public void setBLevelParams(BLevelParameters bLevelParams)
      Set the Baseline B parameters (signed properties)
      Parameters:
      bLevelParams - the baseline B properties
    • getValidationDataEncapsulationStrategy

      public ValidationDataEncapsulationStrategy getValidationDataEncapsulationStrategy()
      Gets the validation data encapsulation mechanism to be used on -LT and -LTA level augmentation
      Returns:
      ValidationDataEncapsulationStrategy
    • setValidationDataEncapsulationStrategy

      public void setValidationDataEncapsulationStrategy(ValidationDataEncapsulationStrategy validationDataEncapsulationStrategy)
      Sets the validation data encapsulation mechanism to be used on -LT and -LTA level augmentation

      Default: CERTIFICATE_REVOCATION_VALUES_AND_TIMESTAMP_VALIDATION_DATA_AND_ANY_VALIDATION_DATA (the validation data for a signature's certificate chain to be included within CertificateValues and RevocationValues elements on LT-level augmentation, and within AnyValidationData element on LTA-level augmentation. The validation data for all present timestamps will be included within TimeStampValidationData element.)

      NOTE: Applicable only for XAdES and JAdES signatures.

      Parameters:
      validationDataEncapsulationStrategy - ValidationDataEncapsulationStrategy
    • getContentTimestampParameters

      public TP getContentTimestampParameters()
      Get the parameters for content timestamp (Baseline-B)
      Returns:
      the parameters to produce a content timestamp
    • setContentTimestampParameters

      public void setContentTimestampParameters(TP contentTimestampParameters)
      Set the parameters to produce the content timestamp (Baseline-B)
      Parameters:
      contentTimestampParameters - the parameters to produce the content timestamp
    • getSignatureTimestampParameters

      public TP getSignatureTimestampParameters()
      Get the parameters for signature timestamp (Baseline-T)
      Returns:
      the parameters to produce a signature timestamp
    • setSignatureTimestampParameters

      public void setSignatureTimestampParameters(TP signatureTimestampParameters)
      Set the parameters to produce the signature timestamp (Baseline-T)
      Parameters:
      signatureTimestampParameters - the parameters to produce the signature timestamp
    • getArchiveTimestampParameters

      public TP getArchiveTimestampParameters()
      Get the parameters for archive timestamp (Baseline-LTA)
      Returns:
      the parameters to produce an archive timestamp
    • setArchiveTimestampParameters

      public void setArchiveTimestampParameters(TP archiveTimestampParameters)
      Set the parameters to produce the archive timestamp (Baseline-LTA)
      Parameters:
      archiveTimestampParameters - the parameters to produce the archive timestamp
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object