Class ValidationProcessUtils
java.lang.Object
eu.europa.esig.dss.validation.process.ValidationProcessUtils
Contains utils for a validation process
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildStringMessage(I18nProvider i18nProvider, MessageTag messageTag, Object... args) Builds a String message from the providedmessageTagstatic List<CertificateRevocationWrapper> getAcceptableRevocationDataForPSVIfExistOrReturnAll(TokenProxy token, CertificateWrapper certificate, Date currentTime, Map<String, XmlBasicBuildingBlocks> bbbs, POEExtraction poe, LevelRule 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 MessageTaggetCertificateChainCryptoPosition(Context context) Returns the message tag for the certificate chain of the given contextstatic LevelRulegetConstraintOrMaxLevel(LevelRule constraint, Level maxLevel) This method is used to return the current level with a max limit of themaxLevelstatic MessageTaggetContextPosition(Context context) Returns the message tag for the given contextstatic MessageTaggetCryptoPosition(Context context) Returns the message tag for the given context (signature creation,...)static MessageTaggetDigestMatcherCryptoPosition(XmlDigestMatcher digestMatcher) Returns crypto position MessageTag for the given XmlDigestMatcherstatic MessageTaggetDigestMatcherCryptoPosition(Collection<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 CertificateRevocationWrappergetLatestAcceptableRevocationData(TokenProxy token, CertificateWrapper certificate, Collection<CertificateRevocationWrapper> revocationData, Date controlTime, Map<String, XmlBasicBuildingBlocks> bbbs, POEExtraction poe) Returns a revocation data used for basic signature validationstatic LevelRulegetLevelRule(Level level) Generates an anonymous implementation of theLevelRulewith the givenLevelstatic XmlRACgetRevocationAcceptanceCheckerResult(XmlBasicBuildingBlocks bbb, String certificateId, String revocationDataId) Return a correspondingXmlRACresult for the givencertificateandrevocationDatastatic MessageTaggetSubContextPosition(SubContext subContext) Returns the message tag for the given subContextstatic MessageTaggetTimestampTypeMessageTag(TimestampType timestampType) Returns MessageTag associated with the given timestamp typestatic MessageTaggetValidationTimeMessageTag(ValidationTime validationTime) Returns aMessageTagcorresponding to the givenValidationTimetypestatic booleanisAllowedBasicRevocationDataValidation(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(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(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(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 booleanThis method verifies if the signature contains long-term availability and integrity material within its structurestatic booleanisRevocationDataAcceptable(XmlBasicBuildingBlocks bbb, CertificateWrapper certificate, RevocationWrapper revocationData) This method verifies if a revocation data is acceptable for the givencertificateaccording to the validation performed withinbbbstatic booleanisTrustAnchor(CertificateWrapper certificateWrapper, Date currentTime, LevelRule 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
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
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
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
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 CertificateRevocationWrapper getLatestAcceptableRevocationData(TokenProxy token, CertificateWrapper certificate, Collection<CertificateRevocationWrapper> revocationData, Date controlTime, Map<String, 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<CertificateRevocationWrapper> getAcceptableRevocationDataForPSVIfExistOrReturnAll(TokenProxy token, CertificateWrapper certificate, Date currentTime, Map<String, XmlBasicBuildingBlocks> bbbs, POEExtraction poe, LevelRule 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-LevelRule- Returns:
- a list of
CertificateRevocationWrappers
-
isTrustAnchor
public static boolean isTrustAnchor(CertificateWrapper certificateWrapper, Date currentTime, LevelRule 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-LevelRule- Returns:
- TRUE if the certificate is a trust anchor at the given time, FALSE otherwise
-
isRevocationDataAcceptable
public static boolean isRevocationDataAcceptable(XmlBasicBuildingBlocks bbb, CertificateWrapper certificate, 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
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
public static XmlRAC getRevocationAcceptanceCheckerResult(XmlBasicBuildingBlocks bbb, String certificateId, String revocationDataId) Return a correspondingXmlRACresult for the givencertificateandrevocationData- Parameters:
bbb-XmlBasicBuildingBlocksof the validating tokencertificateId-Stringconcerned certificate idrevocationDataId-Stringrevocation data id to check- Returns:
XmlRAC
-
getFormattedDate
Returns a formatted String representation of a given Date -
buildStringMessage
public static String buildStringMessage(I18nProvider i18nProvider, 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
Returns the message tag for the given context (signature creation,...)- Parameters:
context- the context- Returns:
- the related message tag
-
getCertificateChainCryptoPosition
Returns the message tag for the certificate chain of the given context- Parameters:
context- the context- Returns:
- the related message tag
-
getDigestMatcherCryptoPosition
Returns crypto position MessageTag for the given XmlDigestMatcher- Parameters:
digestMatcher-XmlDigestMatcherto get crypto position for- Returns:
MessageTagposition
-
getDigestMatcherCryptoPosition
public static MessageTag getDigestMatcherCryptoPosition(Collection<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
Returns MessageTag associated with the given timestamp type- Parameters:
timestampType-TimestampTypeto get related MessageTag for- Returns:
MessageTag
-
getContextPosition
Returns the message tag for the given context- Parameters:
context-Context- Returns:
MessageTag
-
getSubContextPosition
Returns the message tag for the given subContext- Parameters:
subContext-SubContext- Returns:
MessageTag
-
getValidationTimeMessageTag
Returns aMessageTagcorresponding to the givenValidationTimetype- Parameters:
validationTime-ValidationTime- Returns:
MessageTag
-
toUrnOid
Transforms the given OID to a URN format as per RFC 3061 e.g. "1.2.3" to "urn:oid:1.2.3" -
getDomainName
This method returns a domain name for any given valid URI -
processValueCheck
Checks the value against the list of expected values -
processValuesCheck
Checks the values against the expected values -
getConstraintOrMaxLevel
This method is used to return the current level with a max limit of themaxLevel -
getLevelRule
Generates an anonymous implementation of theLevelRulewith the givenLevel
-