Package eu.europa.esig.dss.policy
Interface ValidationPolicy
-
- All Known Implementing Classes:
EtsiValidationPolicy
public interface ValidationPolicyThis class encapsulates the constraint file that controls the policy to be used during the validation process. This is the base class used to implement a specific validation policy
-
-
Method Summary
-
-
-
Method Detail
-
getAlgorithmExpirationDate
Date getAlgorithmExpirationDate(String algorithm, Context context, SubContext subContext)
This function returns the algorithm expiration date extracted from the 'constraint.xml' file. If the TAG AlgoExpirationDate is not present within the constraintsnullis returned.- Parameters:
algorithm- algorithm (SHA1, SHA256, RSA2048...) to be checked- Returns:
- expiration date or null
-
getSignaturePolicyConstraint
MultiValuesConstraint getSignaturePolicyConstraint(Context context)
Indicates if the signature policy should be checked. If AcceptablePolicies element is absent within the constraint file then null is returned, otherwise the list of identifiers is initialised.- Returns:
LevelConstraintif SigningTime element is present in the constraint file, null otherwise.
-
getSignaturePolicyIdentifiedConstraint
LevelConstraint getSignaturePolicyIdentifiedConstraint(Context context)
-
getSignaturePolicyPolicyHashValid
LevelConstraint getSignaturePolicyPolicyHashValid(Context context)
-
getStructuralValidationConstraint
LevelConstraint getStructuralValidationConstraint(Context context)
Indicates if the structural validation should be checked. If StructuralValidation element is absent within the constraint file then null is returned.- Returns:
LevelConstraintif StructuralValidation element is present in the constraint file, null otherwise.
-
getSigningTimeConstraint
LevelConstraint getSigningTimeConstraint()
Indicates if the signed property: signing-time should be checked. If SigningTime element is absent within the constraint file then null is returned.- Returns:
LevelConstraintif SigningTime element is present in the constraint file, null otherwise.
-
getContentTypeConstraint
ValueConstraint getContentTypeConstraint()
Indicates if the signed property: content-type should be checked. If ContentType element is absent within the constraint file then null is returned.- Returns:
ValueConstraintif ContentType element is present in the constraint file, null otherwise.
-
getContentHintsConstraint
ValueConstraint getContentHintsConstraint()
Indicates if the signed property: content-hints should be checked. If ContentHints element is absent within the constraint file then null is returned.- Returns:
ValueConstraintif ContentHints element is present in the constraint file, null otherwise.
-
getContentIdentifierConstraint
ValueConstraint getContentIdentifierConstraint()
Indicates if the signed property: content-identifier should be checked. If ContentIdentifier element is absent within the constraint file then null is returned.- Returns:
ValueConstraintif ContentIdentifier element is present in the constraint file, null otherwise.
-
getMessageDigestOrSignedPropertiesConstraint
LevelConstraint getMessageDigestOrSignedPropertiesConstraint()
Indicates if the signed property: message-digest (for CAdES) or SignedProperties (for XAdES) should be checked. If the relative element is absent within the constraint file then null is returned.- Returns:
LevelConstraintif message-digests/SignedProperties element is present in the constraint file, null otherwise.
-
getCommitmentTypeIndicationConstraint
MultiValuesConstraint getCommitmentTypeIndicationConstraint()
Indicates if the signed property: commitment-type-indication should be checked. If CommitmentTypeIndication element is absent within the constraint file then null is returned, otherwise the list of identifiers is initialised.- Returns:
MultiValuesConstraintif CommitmentTypeIndication element is present in the constraint file, null otherwise.
-
getSignerLocationConstraint
LevelConstraint getSignerLocationConstraint()
Indicates if the signed property: signer-location should be checked. If SignerLocation element is absent within the constraint file then null is returned.- Returns:
LevelConstraintif SignerLocation element is present in the constraint file, null otherwise.
-
getContentTimestampConstraint
LevelConstraint getContentTimestampConstraint()
Indicates if the signed property: content-time-stamp should be checked. If ContentTimeStamp element is absent within the constraint file then null is returned.- Returns:
LevelConstraintif ContentTimeStamp element is present in the constraint file, null otherwise.
-
getClaimedRoleConstraint
MultiValuesConstraint getClaimedRoleConstraint()
Indicates if the unsigned property: claimed-role should be checked. If ClaimedRoles element is absent within the constraint file then null is returned.- Returns:
MultiValuesConstraintif ClaimedRoles element is present in the constraint file, null otherwise.
-
getCertifiedRolesConstraint
MultiValuesConstraint getCertifiedRolesConstraint()
Return the mandated signer role.- Returns:
-
getPolicyName
String getPolicyName()
Returns the name of the policy.- Returns:
-
getPolicyDescription
String getPolicyDescription()
Returns the policy description.- Returns:
-
getSignatureCryptographicConstraint
CryptographicConstraint getSignatureCryptographicConstraint(Context context)
This method creates theSignatureCryptographicConstraintcorresponding to the context parameter. If AcceptableEncryptionAlgo is not present in the constraint file the null is returned.- Parameters:
context- The context of the signature cryptographic constraints: MainSignature, Timestamp, Revocation- Returns:
SignatureCryptographicConstraintif AcceptableEncryptionAlgo for a given context element is present in the constraint file, null otherwise.
-
getCertificateCryptographicConstraint
CryptographicConstraint getCertificateCryptographicConstraint(Context context, SubContext subContext)
This method creates theSignatureCryptographicConstraintcorresponding to the context parameter. If AcceptableEncryptionAlgo is not present in the constraint file the null is returned.- Parameters:
context- The context of the signature cryptographic constraints: MainSignature, Timestamp, RevocationsubContext- the sub context of the signature cryptographic constraints: EMPTY (signature itself), SigningCertificate, CACertificate- Returns:
SignatureCryptographicConstraintif AcceptableEncryptionAlgo for a given context element is present in the constraint file, null otherwise.
-
getCertificateKeyUsageConstraint
MultiValuesConstraint getCertificateKeyUsageConstraint(Context context, SubContext subContext)
- Parameters:
context-subContext-- Returns:
LevelConstraintif key-usage for a given context element is present in the constraint file, null otherwise.
-
getCertificateExtendedKeyUsageConstraint
MultiValuesConstraint getCertificateExtendedKeyUsageConstraint(Context context, SubContext subContext)
-
getCertificateNotExpiredConstraint
LevelConstraint getCertificateNotExpiredConstraint(Context context, SubContext subContext)
- Parameters:
context-subContext-- Returns:
LevelConstraintif Expiration for a given context element is present in the constraint file, null otherwise.
-
getProspectiveCertificateChainConstraint
LevelConstraint getProspectiveCertificateChainConstraint(Context context)
This constraint requests the presence of the trust anchor in the certificate chain.- Parameters:
context-- Returns:
LevelConstraintif ProspectiveCertificateChain element for a given context element is present in the constraint file, null otherwise.
-
getCertificateSignatureConstraint
LevelConstraint getCertificateSignatureConstraint(Context context, SubContext subContext)
- Parameters:
context-subContext-- Returns:
LevelConstraintif Signature for a given context element is present in the constraint file, null otherwise.
-
getRevocationDataAvailableConstraint
LevelConstraint getRevocationDataAvailableConstraint(Context context, SubContext subContext)
- Parameters:
context-- Returns:
LevelConstraintif RevocationDataAvailable for a given context element is present in the constraint file, null otherwise.
-
getRevocationDataNextUpdatePresentConstraint
LevelConstraint getRevocationDataNextUpdatePresentConstraint(Context context, SubContext subContext)
-
getCertificateRevocationFreshnessConstraint
LevelConstraint getCertificateRevocationFreshnessConstraint(Context context, SubContext subContext)
-
getCertificateNotRevokedConstraint
LevelConstraint getCertificateNotRevokedConstraint(Context context, SubContext subContext)
- Returns:
LevelConstraintif Revoked for a given context element is present in the constraint file, null otherwise.
-
getCertificateNotOnHoldConstraint
LevelConstraint getCertificateNotOnHoldConstraint(Context context, SubContext subContext)
- Returns:
LevelConstraintif OnHold for a given context element is present in the constraint file, null otherwise.
-
getCertificateNotSelfSignedConstraint
LevelConstraint getCertificateNotSelfSignedConstraint(Context context, SubContext subContext)
-
getCertificateSelfSignedConstraint
LevelConstraint getCertificateSelfSignedConstraint(Context context, SubContext subContext)
-
getTrustedServiceTypeIdentifierConstraint
MultiValuesConstraint getTrustedServiceTypeIdentifierConstraint(Context context)
-
getTrustedServiceStatusConstraint
MultiValuesConstraint getTrustedServiceStatusConstraint(Context context)
-
getCertificateQualificationConstraint
LevelConstraint getCertificateQualificationConstraint(Context context, SubContext subContext)
- Returns:
LevelConstraintif Qualification for a given context element is present in the constraint file, null otherwise.
-
getCertificateSupportedByQSCDConstraint
LevelConstraint getCertificateSupportedByQSCDConstraint(Context context, SubContext subContext)
Indicates if the end user certificate used in validating the signature is mandated to be supported by a secure signature creation device (QSCD).- Returns:
LevelConstraintif SupportedByQSCD for a given context element is present in the constraint file, null otherwise.
-
getCertificateIssuedToLegalPersonConstraint
LevelConstraint getCertificateIssuedToLegalPersonConstraint(Context context, SubContext subContext)
- Returns:
LevelConstraintif IssuedToLegalPerson for a given context element is present in the constraint file, null otherwise.
-
getSigningCertificateRecognitionConstraint
LevelConstraint getSigningCertificateRecognitionConstraint(Context context)
- Returns:
LevelConstraintif Recognition for a given context element is present in the constraint file, null otherwise.
-
getSigningCertificateAttributePresentConstraint
LevelConstraint getSigningCertificateAttributePresentConstraint(Context context)
- Returns:
LevelConstraintif SigningCertificateAttribute for a given context element is present in the constraint file, null otherwise.
-
getSigningCertificateDigestValuePresentConstraint
LevelConstraint getSigningCertificateDigestValuePresentConstraint(Context context)
- Returns:
LevelConstraintif DigestValuePresent for a given context element is present in the constraint file, null otherwise.
-
getSigningCertificateDigestValueMatchConstraint
LevelConstraint getSigningCertificateDigestValueMatchConstraint(Context context)
- Returns:
LevelConstraintif DigestValueMatch for a given context element is present in the constraint file, null otherwise.
-
getSigningCertificateIssuerSerialMatchConstraint
LevelConstraint getSigningCertificateIssuerSerialMatchConstraint(Context context)
- Returns:
LevelConstraintif IssuerSerialMatch for a given context element is present in the constraint file, null otherwise.
-
getReferenceDataExistenceConstraint
LevelConstraint getReferenceDataExistenceConstraint(Context context)
- Returns:
LevelConstraintif ReferenceDataExistence for a given context element is present in the constraint file, null otherwise.
-
getReferenceDataIntactConstraint
LevelConstraint getReferenceDataIntactConstraint(Context context)
- Returns:
LevelConstraintif ReferenceDataIntact for a given context element is present in the constraint file, null otherwise.
-
getManifestEntryObjectExistenceConstraint
LevelConstraint getManifestEntryObjectExistenceConstraint(Context context)
- Returns:
LevelConstraintif ManifestEntryObjectExistence for a given context element is present in the constraint file, null otherwise.
-
getSignatureIntactConstraint
LevelConstraint getSignatureIntactConstraint(Context context)
- Returns:
ReferenceDataIntactif SignatureIntact for a given context element is present in the constraint file, null otherwise.
-
getBestSignatureTimeBeforeIssuanceDateOfSigningCertificateConstraint
LevelConstraint getBestSignatureTimeBeforeIssuanceDateOfSigningCertificateConstraint()
-
getTimestampCoherenceConstraint
LevelConstraint getTimestampCoherenceConstraint()
-
getTimestampDelayConstraint
TimeConstraint getTimestampDelayConstraint()
-
getRevocationTimeAgainstBestSignatureTime
LevelConstraint getRevocationTimeAgainstBestSignatureTime()
-
getRevocationFreshnessConstraint
TimeConstraint getRevocationFreshnessConstraint()
-
getCounterSignatureConstraint
LevelConstraint getCounterSignatureConstraint()
-
getSignatureFormatConstraint
MultiValuesConstraint getSignatureFormatConstraint(Context context)
-
getCertificateCountryConstraint
MultiValuesConstraint getCertificateCountryConstraint(Context context, SubContext subContext)
-
getCertificateOrganizationNameConstraint
MultiValuesConstraint getCertificateOrganizationNameConstraint(Context context, SubContext subContext)
-
getCertificateOrganizationUnitConstraint
MultiValuesConstraint getCertificateOrganizationUnitConstraint(Context context, SubContext subContext)
-
getCertificateSurnameConstraint
MultiValuesConstraint getCertificateSurnameConstraint(Context context, SubContext subContext)
-
getCertificateGivenNameConstraint
MultiValuesConstraint getCertificateGivenNameConstraint(Context context, SubContext subContext)
-
getCertificateCommonNameConstraint
MultiValuesConstraint getCertificateCommonNameConstraint(Context context, SubContext subContext)
-
getCertificatePseudonymConstraint
MultiValuesConstraint getCertificatePseudonymConstraint(Context context, SubContext subContext)
-
getCertificatePseudoUsageConstraint
LevelConstraint getCertificatePseudoUsageConstraint(Context context, SubContext subContext)
-
getCertificateSerialNumberConstraint
LevelConstraint getCertificateSerialNumberConstraint(Context context, SubContext subContext)
-
getCertificateAuthorityInfoAccessPresentConstraint
LevelConstraint getCertificateAuthorityInfoAccessPresentConstraint(Context context, SubContext subContext)
-
getCertificateRevocationInfoAccessPresentConstraint
LevelConstraint getCertificateRevocationInfoAccessPresentConstraint(Context context, SubContext subContext)
-
getRevocationCertHashMatchConstraint
LevelConstraint getRevocationCertHashMatchConstraint(Context context, SubContext subContext)
-
getCertificatePolicyIdsConstraint
MultiValuesConstraint getCertificatePolicyIdsConstraint(Context context, SubContext subContext)
-
getCertificateQCStatementIdsConstraint
MultiValuesConstraint getCertificateQCStatementIdsConstraint(Context context, SubContext subContext)
-
getCertificateIssuedToNaturalPersonConstraint
LevelConstraint getCertificateIssuedToNaturalPersonConstraint(Context context, SubContext subContext)
-
getAcceptedContainerTypesConstraint
MultiValuesConstraint getAcceptedContainerTypesConstraint()
-
getZipCommentPresentConstraint
LevelConstraint getZipCommentPresentConstraint()
-
getAcceptedZipCommentsConstraint
MultiValuesConstraint getAcceptedZipCommentsConstraint()
-
getMimeTypeFilePresentConstraint
LevelConstraint getMimeTypeFilePresentConstraint()
-
getAcceptedMimeTypeContentsConstraint
MultiValuesConstraint getAcceptedMimeTypeContentsConstraint()
-
getAllFilesSignedConstraint
LevelConstraint getAllFilesSignedConstraint()
-
getManifestFilePresentConstraint
LevelConstraint getManifestFilePresentConstraint()
-
getFullScopeConstraint
LevelConstraint getFullScopeConstraint()
-
isEIDASConstraintPresent
boolean isEIDASConstraintPresent()
-
getTLFreshnessConstraint
TimeConstraint getTLFreshnessConstraint()
-
getTLWellSignedConstraint
LevelConstraint getTLWellSignedConstraint()
-
getTLNotExpiredConstraint
LevelConstraint getTLNotExpiredConstraint()
-
getTLVersionConstraint
ValueConstraint getTLVersionConstraint()
-
getTLConsistencyConstraint
LevelConstraint getTLConsistencyConstraint()
-
getValidationModel
Model getValidationModel()
Returns the used validation model (default is SHELL). Alternatives are CHAIN and HYBRID- Returns:
- the validation model to be used
-
getSignatureConstraints
SignatureConstraints getSignatureConstraints()
-
getCryptographic
CryptographicConstraint getCryptographic()
-
-