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, Map<String, XmlBasicBuildingBlocks> bbbs, POEExtraction poe) 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 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 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 XmlRACgetRevocationAcceptanceCheckerResult(XmlBasicBuildingBlocks bbb, String certificateId, String revocationDataId) Return a correspondingXmlRACresult for the givencertificateandrevocationDatastatic MessageTaggetTimestampTypeMessageTag(TimestampType timestampType) Returns MessageTag associated with the given timestamp typestatic 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 booleanisRevocationCheckRequired(CertificateWrapper certificate) Verifies if the revocation check is required for the OCSP Responder's certificate RFC 2560 : 4.2.2.2.1 Revocation Checking of an Authorized Responder A CA may specify that an OCSP client can trust a responder for the lifetime of the responder's certificate.static booleanisRevocationDataAcceptable(XmlBasicBuildingBlocks bbb, CertificateWrapper certificate, RevocationWrapper revocationData) This method verifies if a revocation data is acceptable for the givencertificateaccording to the validation performed withinbbbstatic StringTransforms the given OID to a URN format as per RFC 3061 e.g.
-
Method Details
-
isRevocationCheckRequired
Verifies if the revocation check is required for the OCSP Responder's certificate RFC 2560 : 4.2.2.2.1 Revocation Checking of an Authorized Responder A CA may specify that an OCSP client can trust a responder for the lifetime of the responder's certificate. The CA does so by including the extension id-pkix-ocsp-nocheck.- Parameters:
certificate-CertificateWrapperto check- Returns:
- TRUE if the revocation check is required for the OCSP Responder certificate, FALSE otherwise
-
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, Map<String, XmlBasicBuildingBlocks> bbbs, POEExtraction poe) 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 forbbbs- a map ofXmlBasicBuildingBlockspoe-POEExtraction- Returns:
- a list of
CertificateRevocationWrappers
-
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
-
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
-
getTimestampTypeMessageTag
Returns MessageTag associated with the given timestamp type- Parameters:
timestampType-TimestampTypeto get related MessageTag for- 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"
-