Class ValidationProcessUtils
java.lang.Object
eu.europa.esig.dss.validation.process.ValidationProcessUtils
Contains utils for a validation process
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
buildStringMessage
(I18nProvider i18nProvider, MessageTag messageTag, Object... args) Builds a String message from the providedmessageTag
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.static MessageTag
getCertificateChainCryptoPosition
(Context context) Returns the message tag for the certificate chain of the given contextstatic MessageTag
getContextPosition
(Context context) Returns the message tag for the given contextstatic MessageTag
getCryptoPosition
(Context context) Returns the message tag for the given context (signature creation,...)static MessageTag
getDigestMatcherCryptoPosition
(XmlDigestMatcher digestMatcher) Returns crypto position MessageTag for the given XmlDigestMatcherstatic String
getFormattedDate
(Date date) Returns a formatted String representation of a given Datestatic 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 validationstatic XmlRAC
getRevocationAcceptanceCheckerResult
(XmlBasicBuildingBlocks bbb, String certificateId, String revocationDataId) Return a correspondingXmlRAC
result for the givencertificate
andrevocationData
static MessageTag
getSubContextPosition
(SubContext subContext) Returns the message tag for the given subContextstatic MessageTag
getTimestampTypeMessageTag
(TimestampType timestampType) Returns MessageTag associated with the given timestamp typestatic MessageTag
getValidationTimeMessageTag
(ValidationTime validationTime) Returns aMessageTag
corresponding to the givenValidationTime
typestatic boolean
isAllowedBasicRevocationDataValidation
(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 boolean
isAllowedBasicSignatureValidation
(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 boolean
isAllowedBasicTimestampValidation
(XmlConclusion conclusion) Checks if the given conclusion is allowed as a basic timestamp validation in order to continue the validation process with Archival Datastatic boolean
isAllowedValidationWithLongTermData
(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 boolean
isRevocationCheckRequired
(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 boolean
isRevocationDataAcceptable
(XmlBasicBuildingBlocks bbb, CertificateWrapper certificate, RevocationWrapper revocationData) This method verifies if a revocation data is acceptable for the givencertificate
according to the validation performed withinbbb
static String
Transforms 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
-CertificateWrapper
to 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
-XmlConclusion
to 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
-XmlConclusion
to 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
-XmlConclusion
to 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
-XmlConclusion
to 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
-TokenProxy
used in the validation processcertificate
-CertificateWrapper
to get a latest applicable revocation data forrevocationData
- a collection ofCertificateRevocationWrapper
to return revocation fromcontrolTime
-Date
validation timebbbs
- a map of executed Basic Building Blockspoe
-POEExtraction
a 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
-TokenProxy
used in the validation processcertificate
-CertificateWrapper
to get acceptable revocation data forbbbs
- a map ofXmlBasicBuildingBlocks
poe
-POEExtraction
- Returns:
- a list of
CertificateRevocationWrapper
s
-
isRevocationDataAcceptable
public static boolean isRevocationDataAcceptable(XmlBasicBuildingBlocks bbb, CertificateWrapper certificate, RevocationWrapper revocationData) This method verifies if a revocation data is acceptable for the givencertificate
according to the validation performed withinbbb
- Parameters:
bbb
-XmlBasicBuildingBlocks
of the validating tokencertificate
-CertificateWrapper
concerned certificaterevocationData
-RevocationWrapper
to check- Returns:
- TRUE if the revocation data is acceptable, FALSE otherwise
-
getRevocationAcceptanceCheckerResult
public static XmlRAC getRevocationAcceptanceCheckerResult(XmlBasicBuildingBlocks bbb, String certificateId, String revocationDataId) Return a correspondingXmlRAC
result for the givencertificate
andrevocationData
- Parameters:
bbb
-XmlBasicBuildingBlocks
of the validating tokencertificateId
-String
concerned certificate idrevocationDataId
-String
revocation 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
-I18nProvider
to build a messagemessageTag
-MessageTag
defining 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
-XmlDigestMatcher
to get crypto position for- Returns:
MessageTag
position
-
getTimestampTypeMessageTag
Returns MessageTag associated with the given timestamp type- Parameters:
timestampType
-TimestampType
to 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 aMessageTag
corresponding to the givenValidationTime
type- 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"
-