Class ValidationProcessUtils
java.lang.Object
eu.europa.esig.dss.validation.process.ValidationProcessUtils
-
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 MessageTag
getDigestMatcherCryptoPosition
(Collection<XmlDigestMatcher> digestMatchers) Returns crypto position MessageTag for the given collection of XmlDigestMatchersstatic String
getDomainName
(String uri) This method returns a domain name for any given valid URIstatic 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
This method verifies if the signature contains long-term availability and integrity material within its structurestatic 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 boolean
processValueCheck
(String value, List<String> expectedValues) Checks the value against the list of expected valuesstatic boolean
processValuesCheck
(List<String> values, List<String> expectedValues) Checks the values against the expected valuesstatic String
Transforms 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
-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
-
isLongTermAvailabilityAndIntegrityMaterialPresent
This method verifies if the signature contains long-term availability and integrity material within its structure- Parameters:
signature
-SignatureWrapper
to 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 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
-
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
-
getDigestMatcherCryptoPosition
public static MessageTag getDigestMatcherCryptoPosition(Collection<XmlDigestMatcher> digestMatchers) Returns crypto position MessageTag for the given collection of XmlDigestMatchers- Parameters:
digestMatchers
- a collection ofXmlDigestMatcher
s 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
-
getDomainName
-
processValueCheck
Checks the value against the list of expected values -
processValuesCheck
Checks the values against the expected values
-