Package eu.europa.esig.dss.signature
Class SignatureRequirementsChecker
java.lang.Object
eu.europa.esig.dss.signature.SignatureRequirementsChecker
- Direct Known Subclasses:
PAdESSignatureRequirementsChecker
This class is used to verify if the signature can be created according to the provided requirements
in a signature parameters instance
-
Field Summary
Modifier and TypeFieldDescriptionprotected final CertificateVerifier
CertificateVerifier to be used for certificates validationprotected final AbstractSignatureParameters
<?> The signature parameters used for signature creation/extension -
Constructor Summary
ConstructorDescriptionSignatureRequirementsChecker
(CertificateVerifier certificateVerifier, AbstractSignatureParameters<?> signatureParameters) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
assertCertificateChainValidForCLevel
(List<AdvancedSignature> signatures) Checks whether acrosssignatures
the corresponding certificate chains require revocation data for C-level augmentationvoid
assertCertificateChainValidForLTLevel
(List<AdvancedSignature> signatures) Checks whether acrosssignatures
the corresponding certificate chains require revocation data for LT-level augmentationvoid
assertCertificateChainValidForXLLevel
(List<AdvancedSignature> signatures) Checks whether acrosssignatures
the corresponding certificate chains require revocation data for XL-level augmentationprotected void
assertCLevelIsHighest
(List<AdvancedSignature> signatures) Checks whether acrosssignatures
the C-level is highest and C-level augmentation can be performedvoid
assertExtendToCLevelPossible
(List<AdvancedSignature> signatures) Verifies whether extension ofsignatures
to C-level is possiblevoid
assertExtendToLTLevelPossible
(List<AdvancedSignature> signatures) Verifies whether extension ofsignatures
to LT-level is possiblevoid
assertExtendToTLevelPossible
(List<AdvancedSignature> signatures) Verifies whether extension ofsignatures
to T-level is possiblevoid
assertExtendToXLevelPossible
(List<AdvancedSignature> signatures) Verifies whether extension ofsignatures
to X-level is possiblevoid
assertExtendToXLLevelPossible
(List<AdvancedSignature> signatures) Verifies whether extension ofsignatures
to XL-level is possibleprotected void
assertLTLevelIsHighest
(List<AdvancedSignature> signatures) Checks whether acrosssignatures
the LT-level is highest and LT-level augmentation can be performedvoid
assertSignaturesValid
(Collection<AdvancedSignature> signatures) Verifies cryptographical validity of the signaturesvoid
assertSigningCertificateIsValid
(CertificateToken certificateToken) This method verifies whether the provided certificate token is acceptable for a signature creation against the providedsignatureParameters
void
assertSigningCertificateIsValid
(AdvancedSignature signature) This method verifies a signing certificate of the givensignature
void
assertSigningCertificateIsValid
(Collection<AdvancedSignature> signatures) This method verifies a signing certificate for a collection of the givensignatures
protected void
assertTLevelIsHighest
(List<AdvancedSignature> signatures) Checks whether acrosssignatures
the T-level is highest and T-level augmentation can be performedprotected void
assertXLevelIsHighest
(List<AdvancedSignature> signatures) Checks whether acrosssignatures
the X-level is highest and X-level augmentation can be performedprotected void
assertXLLevelIsHighest
(List<AdvancedSignature> signatures) Checks whether acrosssignatures
the XL-level is highest and XL-level augmentation can be performedprotected void
checkCLevelIsHighest
(AdvancedSignature signature, SignatureStatus status) Verifies whether thesignature
has maximum B-, T- or LT-levelprotected void
checkLTLevelIsHighest
(AdvancedSignature signature, SignatureStatus status) Verifies whether thesignature
has maximum B-, T- or LT-levelprotected void
checkTLevelIsHighest
(AdvancedSignature signature, SignatureStatus status) Verifies whether thesignature
has maximum B- or T-levelprotected void
checkXLevelIsHighest
(AdvancedSignature signature, SignatureStatus status) Verifies whether thesignature
has maximum B-, T- or LT-levelprotected void
checkXLLevelIsHighest
(AdvancedSignature signature, SignatureStatus status) Verifies whether thesignature
has maximum X-levelboolean
hasALevelOrHigher
(AdvancedSignature signature) Checks if the signature has A-levelboolean
hasLTALevelOrHigher
(AdvancedSignature signature) Checks if the signature has LTA-levelboolean
hasLTLevelOrHigher
(AdvancedSignature signature) Checks if the signature has LTA-levelboolean
hasXLevelOrHigher
(AdvancedSignature signature) Checks if the signature has LTA-levelboolean
hasXLLevelOrHigher
(AdvancedSignature signature) Checks if the signature has LTA-level
-
Field Details
-
certificateVerifier
CertificateVerifier to be used for certificates validation -
signatureParameters
The signature parameters used for signature creation/extension
-
-
Constructor Details
-
SignatureRequirementsChecker
public SignatureRequirementsChecker(CertificateVerifier certificateVerifier, AbstractSignatureParameters<?> signatureParameters) Default constructor- Parameters:
certificateVerifier
-CertificateVerifier
signatureParameters
-AbstractSignatureParameters
-
-
Method Details
-
assertSigningCertificateIsValid
This method verifies whether the provided certificate token is acceptable for a signature creation against the providedsignatureParameters
- Parameters:
certificateToken
-CertificateToken
-
assertSigningCertificateIsValid
This method verifies a signing certificate of the givensignature
- Parameters:
signature
-AdvancedSignature
to verify
-
assertSigningCertificateIsValid
This method verifies a signing certificate for a collection of the givensignatures
- Parameters:
signatures
- a collection ofAdvancedSignature
s to verify signing-certificate for
-
assertExtendToTLevelPossible
Verifies whether extension ofsignatures
to T-level is possible- Parameters:
signatures
- a list ofAdvancedSignature
s
-
assertTLevelIsHighest
Checks whether acrosssignatures
the T-level is highest and T-level augmentation can be performed- Parameters:
signatures
- a list ofAdvancedSignature
s
-
checkTLevelIsHighest
Verifies whether thesignature
has maximum B- or T-level- Parameters:
signature
-AdvancedSignature
to be verifiesstatus
-SignatureStatus
to fill in case of error
-
hasLTLevelOrHigher
Checks if the signature has LTA-level- Parameters:
signature
-AdvancedSignature
to be validated- Returns:
- TRUE if the signature has LTA-level, FALSE otherwise
-
assertExtendToLTLevelPossible
Verifies whether extension ofsignatures
to LT-level is possible- Parameters:
signatures
- a list ofAdvancedSignature
s
-
assertLTLevelIsHighest
Checks whether acrosssignatures
the LT-level is highest and LT-level augmentation can be performed- Parameters:
signatures
- a list ofAdvancedSignature
s
-
checkLTLevelIsHighest
Verifies whether thesignature
has maximum B-, T- or LT-level- Parameters:
signature
-AdvancedSignature
to be verifiesstatus
-SignatureStatus
to fill in case of error
-
hasLTALevelOrHigher
Checks if the signature has LTA-level- Parameters:
signature
-AdvancedSignature
to be validated- Returns:
- TRUE if the signature has LTA-level, FALSE otherwise
-
assertCertificateChainValidForLTLevel
Checks whether acrosssignatures
the corresponding certificate chains require revocation data for LT-level augmentation- Parameters:
signatures
- a list ofAdvancedSignature
s
-
assertCertificateChainValidForCLevel
Checks whether acrosssignatures
the corresponding certificate chains require revocation data for C-level augmentation- Parameters:
signatures
- a list ofAdvancedSignature
s
-
assertCertificateChainValidForXLLevel
Checks whether acrosssignatures
the corresponding certificate chains require revocation data for XL-level augmentation- Parameters:
signatures
- a list ofAdvancedSignature
s
-
assertExtendToCLevelPossible
Verifies whether extension ofsignatures
to C-level is possible- Parameters:
signatures
- a list ofAdvancedSignature
s
-
assertCLevelIsHighest
Checks whether acrosssignatures
the C-level is highest and C-level augmentation can be performed- Parameters:
signatures
- a list ofAdvancedSignature
s
-
checkCLevelIsHighest
Verifies whether thesignature
has maximum B-, T- or LT-level- Parameters:
signature
-AdvancedSignature
to be verifiesstatus
-SignatureStatus
to fill in case of error
-
hasXLevelOrHigher
Checks if the signature has LTA-level- Parameters:
signature
-AdvancedSignature
to be validated- Returns:
- TRUE if the signature has LTA-level, FALSE otherwise
-
assertExtendToXLevelPossible
Verifies whether extension ofsignatures
to X-level is possible- Parameters:
signatures
- a list ofAdvancedSignature
s
-
assertXLevelIsHighest
Checks whether acrosssignatures
the X-level is highest and X-level augmentation can be performed- Parameters:
signatures
- a list ofAdvancedSignature
s
-
checkXLevelIsHighest
Verifies whether thesignature
has maximum B-, T- or LT-level- Parameters:
signature
-AdvancedSignature
to be verifiesstatus
-SignatureStatus
to fill in case of error
-
hasXLLevelOrHigher
Checks if the signature has LTA-level- Parameters:
signature
-AdvancedSignature
to be validated- Returns:
- TRUE if the signature has LTA-level, FALSE otherwise
-
assertExtendToXLLevelPossible
Verifies whether extension ofsignatures
to XL-level is possible- Parameters:
signatures
- a list ofAdvancedSignature
s
-
assertXLLevelIsHighest
Checks whether acrosssignatures
the XL-level is highest and XL-level augmentation can be performed- Parameters:
signatures
- a list ofAdvancedSignature
s
-
checkXLLevelIsHighest
Verifies whether thesignature
has maximum X-level- Parameters:
signature
-AdvancedSignature
to be verifiesstatus
-SignatureStatus
to fill in case of error
-
hasALevelOrHigher
Checks if the signature has A-level- Parameters:
signature
-AdvancedSignature
to be validated- Returns:
- TRUE if the signature has A-level, FALSE otherwise
-
assertSignaturesValid
Verifies cryptographical validity of the signatures- Parameters:
signatures
- a collection ofAdvancedSignature
s
-