Module jpms_dss_validation
Class ValidationProcessUtils
java.lang.Object
eu.europa.esig.dss.validation.process.ValidationProcessUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildStringMessage(eu.europa.esig.dss.i18n.I18nProvider i18nProvider, eu.europa.esig.dss.i18n.MessageTag messageTag, Object... args) Builds a String message from the providedmessageTagstatic List<eu.europa.esig.dss.diagnostic.CertificateRevocationWrapper> getAcceptableRevocationDataForPSVIfExistOrReturnAll(eu.europa.esig.dss.diagnostic.TokenProxy token, eu.europa.esig.dss.diagnostic.CertificateWrapper certificate, Date currentTime, Map<String, eu.europa.esig.dss.detailedreport.jaxb.XmlBasicBuildingBlocks> bbbs, POEExtraction poe, eu.europa.esig.dss.policy.jaxb.LevelConstraint revocationIssuerSunsetDateConstraint) This method verifies if there is an acceptable revocation data according to rules defined in 5.6.2.4 step 1) and returns a list of the revocation data.static eu.europa.esig.dss.i18n.MessageTaggetCertificateChainCryptoPosition(eu.europa.esig.dss.enumerations.Context context) Returns the message tag for the certificate chain of the given contextstatic eu.europa.esig.dss.policy.jaxb.LevelConstraintgetConstraintOrMaxLevel(eu.europa.esig.dss.policy.jaxb.LevelConstraint constraint, eu.europa.esig.dss.policy.jaxb.Level maxLevel) This method is used to return the current level with a max limit of themaxLevelstatic eu.europa.esig.dss.i18n.MessageTaggetContextPosition(eu.europa.esig.dss.enumerations.Context context) Returns the message tag for the given contextstatic eu.europa.esig.dss.i18n.MessageTaggetCryptoPosition(eu.europa.esig.dss.enumerations.Context context) Returns the message tag for the given context (signature creation,...)static eu.europa.esig.dss.i18n.MessageTaggetDigestMatcherCryptoPosition(eu.europa.esig.dss.diagnostic.jaxb.XmlDigestMatcher digestMatcher) Returns crypto position MessageTag for the given XmlDigestMatcherstatic eu.europa.esig.dss.i18n.MessageTaggetDigestMatcherCryptoPosition(Collection<eu.europa.esig.dss.diagnostic.jaxb.XmlDigestMatcher> digestMatchers) Returns crypto position MessageTag for the given collection of XmlDigestMatchersstatic StringgetDomainName(String uri) This method returns a domain name for any given valid URIstatic StringgetFormattedDate(Date date) Returns a formatted String representation of a given Datestatic eu.europa.esig.dss.diagnostic.CertificateRevocationWrappergetLatestAcceptableRevocationData(eu.europa.esig.dss.diagnostic.TokenProxy token, eu.europa.esig.dss.diagnostic.CertificateWrapper certificate, Collection<eu.europa.esig.dss.diagnostic.CertificateRevocationWrapper> revocationData, Date controlTime, Map<String, eu.europa.esig.dss.detailedreport.jaxb.XmlBasicBuildingBlocks> bbbs, POEExtraction poe) Returns a revocation data used for basic signature validationstatic eu.europa.esig.dss.detailedreport.jaxb.XmlRACgetRevocationAcceptanceCheckerResult(eu.europa.esig.dss.detailedreport.jaxb.XmlBasicBuildingBlocks bbb, String certificateId, String revocationDataId) Return a correspondingXmlRACresult for the givencertificateandrevocationDatastatic eu.europa.esig.dss.i18n.MessageTaggetSubContextPosition(eu.europa.esig.dss.policy.SubContext subContext) Returns the message tag for the given subContextstatic eu.europa.esig.dss.i18n.MessageTaggetTimestampTypeMessageTag(eu.europa.esig.dss.enumerations.TimestampType timestampType) Returns MessageTag associated with the given timestamp typestatic eu.europa.esig.dss.i18n.MessageTaggetValidationTimeMessageTag(eu.europa.esig.dss.enumerations.ValidationTime validationTime) Returns aMessageTagcorresponding to the givenValidationTimetypestatic booleanisAllowedBasicRevocationDataValidation(eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusion) Checks if the given conclusion is allowed as a basic revocation validation in order to continue the validation process with Long-Term Validation Datastatic booleanisAllowedBasicSignatureValidation(eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusion) Checks if the given conclusion is allowed as a basic signature validation in order to continue the validation process with Long-Term Validation Datastatic booleanisAllowedBasicTimestampValidation(eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusion) Checks if the given conclusion is allowed as a basic timestamp validation in order to continue the validation process with Archival Datastatic booleanisAllowedValidationWithLongTermData(eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusion) Checks if the given conclusion is allowed as a validation process with a long-term validation data in order to continue the validation process with Archival Datastatic booleanisLongTermAvailabilityAndIntegrityMaterialPresent(eu.europa.esig.dss.diagnostic.SignatureWrapper signature) This method verifies if the signature contains long-term availability and integrity material within its structurestatic booleanisRevocationDataAcceptable(eu.europa.esig.dss.detailedreport.jaxb.XmlBasicBuildingBlocks bbb, eu.europa.esig.dss.diagnostic.CertificateWrapper certificate, eu.europa.esig.dss.diagnostic.RevocationWrapper revocationData) This method verifies if a revocation data is acceptable for the givencertificateaccording to the validation performed withinbbbstatic booleanisTrustAnchor(eu.europa.esig.dss.diagnostic.CertificateWrapper certificateWrapper, Date currentTime, eu.europa.esig.dss.policy.jaxb.LevelConstraint certificateSunsetDateConstraint) This method verifies whether the givencertificateWrappercan be considered as a trust anchor at thecurrentTimestatic booleanprocessValueCheck(String value, List<String> expectedValues) Checks the value against the list of expected valuesstatic booleanprocessValuesCheck(List<String> values, List<String> expectedValues) Checks the values against the expected valuesstatic StringTransforms the given OID to a URN format as per RFC 3061 e.g. "1.2.3" to "urn:oid:1.2.3"
-
Method Details
-
isAllowedBasicSignatureValidation
public static boolean isAllowedBasicSignatureValidation(eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusion) Checks if the given conclusion is allowed as a basic signature validation in order to continue the validation process with Long-Term Validation Data- Parameters:
conclusion-XmlConclusionto validate- Returns:
- TRUE if the result is allowed to continue the validation process, FALSE otherwise
-
isAllowedBasicRevocationDataValidation
public static boolean isAllowedBasicRevocationDataValidation(eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusion) Checks if the given conclusion is allowed as a basic revocation validation in order to continue the validation process with Long-Term Validation Data- Parameters:
conclusion-XmlConclusionto validate- Returns:
- TRUE if the result is allowed to continue the validation process, FALSE otherwise
-
isAllowedBasicTimestampValidation
public static boolean isAllowedBasicTimestampValidation(eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusion) Checks if the given conclusion is allowed as a basic timestamp validation in order to continue the validation process with Archival Data- Parameters:
conclusion-XmlConclusionto validate- Returns:
- TRUE if the result is allowed to continue the validation process, FALSE otherwise
-
isAllowedValidationWithLongTermData
public static boolean isAllowedValidationWithLongTermData(eu.europa.esig.dss.detailedreport.jaxb.XmlConclusion conclusion) Checks if the given conclusion is allowed as a validation process with a long-term validation data in order to continue the validation process with Archival Data- Parameters:
conclusion-XmlConclusionto validate- Returns:
- TRUE if the result is allowed to continue the validation process, FALSE otherwise
-
getLatestAcceptableRevocationData
public static eu.europa.esig.dss.diagnostic.CertificateRevocationWrapper getLatestAcceptableRevocationData(eu.europa.esig.dss.diagnostic.TokenProxy token, eu.europa.esig.dss.diagnostic.CertificateWrapper certificate, Collection<eu.europa.esig.dss.diagnostic.CertificateRevocationWrapper> revocationData, Date controlTime, Map<String, eu.europa.esig.dss.detailedreport.jaxb.XmlBasicBuildingBlocks> bbbs, POEExtraction poe) Returns a revocation data used for basic signature validation- Parameters:
token-TokenProxyused in the validation processcertificate-CertificateWrapperto get a latest applicable revocation data forrevocationData- a collection ofCertificateRevocationWrapperto return revocation fromcontrolTime-Datevalidation timebbbs- a map of executed Basic Building Blockspoe-POEExtractiona set of POEs- Returns:
CertificateRevocationWrapper
-
getAcceptableRevocationDataForPSVIfExistOrReturnAll
public static List<eu.europa.esig.dss.diagnostic.CertificateRevocationWrapper> getAcceptableRevocationDataForPSVIfExistOrReturnAll(eu.europa.esig.dss.diagnostic.TokenProxy token, eu.europa.esig.dss.diagnostic.CertificateWrapper certificate, Date currentTime, Map<String, eu.europa.esig.dss.detailedreport.jaxb.XmlBasicBuildingBlocks> bbbs, POEExtraction poe, eu.europa.esig.dss.policy.jaxb.LevelConstraint revocationIssuerSunsetDateConstraint) This method verifies if there is an acceptable revocation data according to rules defined in 5.6.2.4 step 1) and returns a list of the revocation data. If none of the revocation data found, the method returns all the available revocation data- Parameters:
token-TokenProxyused in the validation processcertificate-CertificateWrapperto get acceptable revocation data forcurrentTime-Datebbbs- a map ofXmlBasicBuildingBlockspoe-POEExtractionrevocationIssuerSunsetDateConstraint-LevelConstraint- Returns:
- a list of
CertificateRevocationWrappers
-
isTrustAnchor
public static boolean isTrustAnchor(eu.europa.esig.dss.diagnostic.CertificateWrapper certificateWrapper, Date currentTime, eu.europa.esig.dss.policy.jaxb.LevelConstraint certificateSunsetDateConstraint) This method verifies whether the givencertificateWrappercan be considered as a trust anchor at thecurrentTime- Parameters:
certificateWrapper-CertificateWrappertrust anchor candidatecurrentTime-Dateto verify certificate's sunset date, when applicablecertificateSunsetDateConstraint-LevelConstraint- Returns:
- TRUE if the certificate is a trust anchor at the given time, FALSE otherwise
-
isRevocationDataAcceptable
public static boolean isRevocationDataAcceptable(eu.europa.esig.dss.detailedreport.jaxb.XmlBasicBuildingBlocks bbb, eu.europa.esig.dss.diagnostic.CertificateWrapper certificate, eu.europa.esig.dss.diagnostic.RevocationWrapper revocationData) This method verifies if a revocation data is acceptable for the givencertificateaccording to the validation performed withinbbb- Parameters:
bbb-XmlBasicBuildingBlocksof the validating tokencertificate-CertificateWrapperconcerned certificaterevocationData-RevocationWrapperto check- Returns:
- TRUE if the revocation data is acceptable, FALSE otherwise
-
isLongTermAvailabilityAndIntegrityMaterialPresent
public static boolean isLongTermAvailabilityAndIntegrityMaterialPresent(eu.europa.esig.dss.diagnostic.SignatureWrapper signature) This method verifies if the signature contains long-term availability and integrity material within its structure- Parameters:
signature-SignatureWrapperto verify- Returns:
- TRUE if the long-term availability and integrity material is present, FALSE otherwise
-
getRevocationAcceptanceCheckerResult
-
getFormattedDate
-
buildStringMessage
public static String buildStringMessage(eu.europa.esig.dss.i18n.I18nProvider i18nProvider, eu.europa.esig.dss.i18n.MessageTag messageTag, Object... args) Builds a String message from the providedmessageTag- Parameters:
i18nProvider-I18nProviderto build a messagemessageTag-MessageTagdefining the message to be buildargs- the arguments to fill the message- Returns:
- final message
String
-
getCryptoPosition
public static eu.europa.esig.dss.i18n.MessageTag getCryptoPosition(eu.europa.esig.dss.enumerations.Context context) Returns the message tag for the given context (signature creation,...)- Parameters:
context- the context- Returns:
- the related message tag
-
getCertificateChainCryptoPosition
public static eu.europa.esig.dss.i18n.MessageTag getCertificateChainCryptoPosition(eu.europa.esig.dss.enumerations.Context context) Returns the message tag for the certificate chain of the given context- Parameters:
context- the context- Returns:
- the related message tag
-
getDigestMatcherCryptoPosition
public static eu.europa.esig.dss.i18n.MessageTag getDigestMatcherCryptoPosition(eu.europa.esig.dss.diagnostic.jaxb.XmlDigestMatcher digestMatcher) Returns crypto position MessageTag for the given XmlDigestMatcher- Parameters:
digestMatcher-XmlDigestMatcherto get crypto position for- Returns:
MessageTagposition
-
getDigestMatcherCryptoPosition
public static eu.europa.esig.dss.i18n.MessageTag getDigestMatcherCryptoPosition(Collection<eu.europa.esig.dss.diagnostic.jaxb.XmlDigestMatcher> digestMatchers) Returns crypto position MessageTag for the given collection of XmlDigestMatchers- Parameters:
digestMatchers- a collection ofXmlDigestMatchers to get crypto position for- Returns:
MessageTagposition
-
getTimestampTypeMessageTag
public static eu.europa.esig.dss.i18n.MessageTag getTimestampTypeMessageTag(eu.europa.esig.dss.enumerations.TimestampType timestampType) Returns MessageTag associated with the given timestamp type- Parameters:
timestampType-TimestampTypeto get related MessageTag for- Returns:
MessageTag
-
getContextPosition
public static eu.europa.esig.dss.i18n.MessageTag getContextPosition(eu.europa.esig.dss.enumerations.Context context) Returns the message tag for the given context- Parameters:
context-Context- Returns:
MessageTag
-
getSubContextPosition
public static eu.europa.esig.dss.i18n.MessageTag getSubContextPosition(eu.europa.esig.dss.policy.SubContext subContext) Returns the message tag for the given subContext- Parameters:
subContext-SubContext- Returns:
MessageTag
-
getValidationTimeMessageTag
public static eu.europa.esig.dss.i18n.MessageTag getValidationTimeMessageTag(eu.europa.esig.dss.enumerations.ValidationTime validationTime) Returns aMessageTagcorresponding to the givenValidationTimetype- Parameters:
validationTime-ValidationTime- Returns:
MessageTag
-
toUrnOid
-
getDomainName
-
processValueCheck
Checks the value against the list of expected values -
processValuesCheck
Checks the values against the expected values -
getConstraintOrMaxLevel
public static eu.europa.esig.dss.policy.jaxb.LevelConstraint getConstraintOrMaxLevel(eu.europa.esig.dss.policy.jaxb.LevelConstraint constraint, eu.europa.esig.dss.policy.jaxb.Level maxLevel) This method is used to return the current level with a max limit of themaxLevel- Parameters:
constraint-LevelConstraintto checkmaxLevel-Level- Returns:
LevelConstraint
-