use of xades4j.properties.QualifyingProperty in project xades4j by luisgoncalves.
the class XadesVerifierImpl method getValidationDate.
/**
**********************************************************************************
*/
private Date getValidationDate(Collection<PropertyDataObject> qualifPropsData, XMLSignature signature, SignatureSpecificVerificationOptions verificationOptions) throws XAdES4jException {
List sigTsData = CollectionUtils.filterByType(qualifPropsData, SignatureTimeStampData.class);
// If no signature time-stamp is present, use the current date.
if (sigTsData.isEmpty()) {
return verificationOptions.getDefaultVerificationDate();
}
// TODO support multiple SignatureTimeStamps (section 7.3 last paragraph of Standard v.1.4.2)
// This is a temporary solution.
// - Properties should probably be verified in two stages (before and after cert path creation).
// - Had to remove the custom structure verifier that checked if the SigningCertificate data was present.
QualifyingPropertyVerificationContext ctx = new QualifyingPropertyVerificationContext(signature, new QualifyingPropertyVerificationContext.CertificationChainData(new ArrayList<X509Certificate>(0), new ArrayList<X509CRL>(0), null), /**/
new QualifyingPropertyVerificationContext.SignedObjectsData(new ArrayList<RawDataObjectDesc>(0), signature));
Collection<PropertyInfo> props = this.qualifyingPropertiesVerifier.verifyProperties(sigTsData, ctx);
QualifyingProperty sigTs = props.iterator().next().getProperty();
return ((SignatureTimeStampProperty) sigTs).getTime();
}
use of xades4j.properties.QualifyingProperty in project xades4j by luisgoncalves.
the class QualifyingPropertiesVerifierImpl method verifyProperties.
@Override
public Collection<PropertyInfo> verifyProperties(Collection<PropertyDataObject> unmarshalledProperties, QualifyingPropertyVerificationContext ctx) throws PropertyDataStructureException, InvalidPropertyException, QualifyingPropertyVerifierNotAvailableException {
dataObjectsStructureVerifier.verifiyPropertiesDataStructure(unmarshalledProperties);
Collection<PropertyInfo> props = new ArrayList<PropertyInfo>(unmarshalledProperties.size());
for (PropertyDataObject propData : unmarshalledProperties) {
QualifyingPropertyVerifier<PropertyDataObject> propVerifier = this.propertyVerifiersMapper.getVerifier(propData);
QualifyingProperty p = propVerifier.verify(propData, ctx);
if (null == p)
throw new PropertyVerifierErrorException(propData.getClass().getName());
props.add(new PropertyInfo(propData, p));
}
return Collections.unmodifiableCollection(props);
}
Aggregations