Class SignatureRequirementsChecker

java.lang.Object
eu.europa.esig.dss.signature.SignatureRequirementsChecker
Direct Known Subclasses:
PAdESSignatureRequirementsChecker

public class SignatureRequirementsChecker extends Object
This class is used to verify if the signature can be created according to the provided requirements in a CertificateVerifier instance
  • Field Details

    • certificateVerifier

      protected final CertificateVerifier certificateVerifier
      CertificateVerifier to be used for certificates validation
    • signatureParameters

      protected final AbstractSignatureParameters<?> signatureParameters
      The signature parameters used for signature creation/extension
  • Constructor Details

  • Method Details

    • assertSigningCertificateIsValid

      public void assertSigningCertificateIsValid(CertificateToken certificateToken)
      This method verifies whether the provided certificate token is acceptable for a signature creation against the provided signatureParameters
      Parameters:
      certificateToken - CertificateToken
    • assertSigningCertificateIsValid

      public void assertSigningCertificateIsValid(Collection<AdvancedSignature> signatures)
      This method verifies a signing certificate for a collection of the given signatures
      Parameters:
      signatures - a collection of AdvancedSignatures to verify signing-certificate for
    • initValidationAlerter

      protected ValidationAlerter initValidationAlerter(CertificateToken certificateToken)
      Initializes the validation alerter for certificate validation
      Parameters:
      certificateToken - CertificateToken representing the signing-certificate to be validated
      Returns:
      ValidationAlerter
    • initValidationAlerter

      protected ValidationAlerter initValidationAlerter(Collection<AdvancedSignature> signatures)
      Initializes the validation alerter for signature validation
      Parameters:
      signatures - collection of AdvancedSignatures to be validated
      Returns:
      ValidationAlerter
    • getCertificateVerifier

      protected CertificateVerifier getCertificateVerifier()
      Gets CertificateVerifier to be used for validation context verification
      Returns:
      CertificateVerifier
    • assertExtendToTLevelPossible

      public void assertExtendToTLevelPossible(List<AdvancedSignature> signatures)
      Verifies whether extension of signatures to T-level is possible
      Parameters:
      signatures - a list of AdvancedSignatures
    • assertTLevelIsHighest

      protected void assertTLevelIsHighest(List<AdvancedSignature> signatures)
      Checks whether across signatures the T-level is highest and T-level augmentation can be performed
      Parameters:
      signatures - a list of AdvancedSignatures
    • checkTLevelIsHighest

      protected void checkTLevelIsHighest(AdvancedSignature signature, SignatureStatus status)
      Verifies whether the signature has maximum B- or T-level
      Parameters:
      signature - AdvancedSignature to be verified
      status - SignatureStatus to fill in case of error
    • hasLTLevelOrHigher

      public boolean hasLTLevelOrHigher(AdvancedSignature signature)
      Checks if the signature has LTA-level
      Parameters:
      signature - AdvancedSignature to be validated
      Returns:
      TRUE if the signature has LTA-level, FALSE otherwise
    • assertExtendToLTLevelPossible

      public void assertExtendToLTLevelPossible(List<AdvancedSignature> signatures)
      Verifies whether extension of signatures to LT-level is possible
      Parameters:
      signatures - a list of AdvancedSignatures
    • assertLTLevelIsHighest

      protected void assertLTLevelIsHighest(List<AdvancedSignature> signatures)
      Checks whether across signatures the LT-level is highest and LT-level augmentation can be performed
      Parameters:
      signatures - a list of AdvancedSignatures
    • checkLTLevelIsHighest

      protected void checkLTLevelIsHighest(AdvancedSignature signature, SignatureStatus status)
      Verifies whether the signature has maximum B-, T- or LT-level
      Parameters:
      signature - AdvancedSignature to be verified
      status - SignatureStatus to fill in case of error
    • hasLTALevelOrHigher

      public boolean hasLTALevelOrHigher(AdvancedSignature signature)
      Checks if the signature has LTA-level
      Parameters:
      signature - AdvancedSignature to be validated
      Returns:
      TRUE if the signature has LTA-level, FALSE otherwise
    • assertCertificateChainValidForLTLevel

      public void assertCertificateChainValidForLTLevel(List<AdvancedSignature> signatures)
      Checks whether across signatures the corresponding certificate chains require revocation data for LT-level augmentation
      Parameters:
      signatures - a list of AdvancedSignatures
    • assertCertificateChainValidForCLevel

      public void assertCertificateChainValidForCLevel(List<AdvancedSignature> signatures)
      Checks whether across signatures the corresponding certificate chains require revocation data for C-level augmentation
      Parameters:
      signatures - a list of AdvancedSignatures
    • assertCertificateChainValidForXLLevel

      public void assertCertificateChainValidForXLLevel(List<AdvancedSignature> signatures)
      Checks whether across signatures the corresponding certificate chains require revocation data for XL-level augmentation
      Parameters:
      signatures - a list of AdvancedSignatures
    • assertExtendToCLevelPossible

      public void assertExtendToCLevelPossible(List<AdvancedSignature> signatures)
      Verifies whether extension of signatures to C-level is possible
      Parameters:
      signatures - a list of AdvancedSignatures
    • assertCLevelIsHighest

      protected void assertCLevelIsHighest(List<AdvancedSignature> signatures)
      Checks whether across signatures the C-level is highest and C-level augmentation can be performed
      Parameters:
      signatures - a list of AdvancedSignatures
    • checkCLevelIsHighest

      protected void checkCLevelIsHighest(AdvancedSignature signature, SignatureStatus status)
      Verifies whether the signature has maximum B-, T- or LT-level
      Parameters:
      signature - AdvancedSignature to be verified
      status - SignatureStatus to fill in case of error
    • hasXLevelOrHigher

      public boolean hasXLevelOrHigher(AdvancedSignature signature)
      Checks if the signature has LTA-level
      Parameters:
      signature - AdvancedSignature to be validated
      Returns:
      TRUE if the signature has LTA-level, FALSE otherwise
    • assertExtendToXLevelPossible

      public void assertExtendToXLevelPossible(List<AdvancedSignature> signatures)
      Verifies whether extension of signatures to X-level is possible
      Parameters:
      signatures - a list of AdvancedSignatures
    • assertXLevelIsHighest

      protected void assertXLevelIsHighest(List<AdvancedSignature> signatures)
      Checks whether across signatures the X-level is highest and X-level augmentation can be performed
      Parameters:
      signatures - a list of AdvancedSignatures
    • checkXLevelIsHighest

      protected void checkXLevelIsHighest(AdvancedSignature signature, SignatureStatus status)
      Verifies whether the signature has maximum B-, T- or LT-level
      Parameters:
      signature - AdvancedSignature to be verified
      status - SignatureStatus to fill in case of error
    • hasXLLevelOrHigher

      public boolean hasXLLevelOrHigher(AdvancedSignature signature)
      Checks if the signature has LTA-level
      Parameters:
      signature - AdvancedSignature to be validated
      Returns:
      TRUE if the signature has LTA-level, FALSE otherwise
    • assertExtendToXLLevelPossible

      public void assertExtendToXLLevelPossible(List<AdvancedSignature> signatures)
      Verifies whether extension of signatures to XL-level is possible
      Parameters:
      signatures - a list of AdvancedSignatures
    • assertXLLevelIsHighest

      protected void assertXLLevelIsHighest(List<AdvancedSignature> signatures)
      Checks whether across signatures the XL-level is highest and XL-level augmentation can be performed
      Parameters:
      signatures - a list of AdvancedSignatures
    • checkXLLevelIsHighest

      protected void checkXLLevelIsHighest(AdvancedSignature signature, SignatureStatus status)
      Verifies whether the signature has maximum X-level
      Parameters:
      signature - AdvancedSignature to be verified
      status - SignatureStatus to fill in case of error
    • hasALevelOrHigher

      public boolean hasALevelOrHigher(AdvancedSignature signature)
      Checks if the signature has A-level
      Parameters:
      signature - AdvancedSignature to be validated
      Returns:
      TRUE if the signature has A-level, FALSE otherwise
    • assertExtendToLTALevelPossible

      public void assertExtendToLTALevelPossible(List<AdvancedSignature> signatures)
      Verifies whether extension of signatures to LTA-level is possible
      Parameters:
      signatures - a list of AdvancedSignatures
    • assertHasNoEmbeddedEvidenceRecords

      protected void assertHasNoEmbeddedEvidenceRecords(List<AdvancedSignature> signatures)
      Checks whether across signatures the T-level is highest and T-level augmentation can be performed
      Parameters:
      signatures - a list of AdvancedSignatures
    • checkHasEmbeddedEvidenceRecords

      protected void checkHasEmbeddedEvidenceRecords(AdvancedSignature signature, SignatureStatus status)
      Verifies whether the signature has an embedded evidence record
      Parameters:
      signature - AdvancedSignature to be verified
      status - SignatureStatus to fill in case of error
    • hasEmbeddedEvidenceRecords

      public boolean hasEmbeddedEvidenceRecords(AdvancedSignature signature)
      Checks if the signature has embedded evidence records
      Parameters:
      signature - AdvancedSignature to be validated
      Returns:
      TRUE if the signature has an embedded evidence record, FALSE otherwise
    • assertSignaturesValid

      public void assertSignaturesValid(Collection<AdvancedSignature> signatures)
      Verifies cryptographical validity of the signatures
      Parameters:
      signatures - a collection of AdvancedSignatures