use of xades4j.properties.UnsignedDataObjectProperty in project xades4j by luisgoncalves.
the class QualifyingPropertiesProcessor method getQualifyingProperties.
QualifyingProperties getQualifyingProperties(SignedDataObjects dataObjs, Collection<SignedSignatureProperty> formatSpecificSignedSigProps, Collection<UnsignedSignatureProperty> formatSpecificUnsignedSigProps) {
/* **** Signature properties **** */
// Collect the signature properties from the provider.
SignaturePropertiesCollectorImpl signaturePropsCollector = new SignaturePropertiesCollectorImpl();
sigPropsProvider.provideProperties(signaturePropsCollector);
Collection<SignedSignatureProperty> collectedSignedSigProps = signaturePropsCollector.getSignedSigProps();
Collection<SignedSignatureProperty> signedSigProps = new ArrayList<SignedSignatureProperty>(collectedSignedSigProps.size() + formatSpecificSignedSigProps.size());
signedSigProps.addAll(collectedSignedSigProps);
signedSigProps.addAll(formatSpecificSignedSigProps);
Collection<UnsignedSignatureProperty> collectedUnsignedSigProps = signaturePropsCollector.getUnsignedSigProps();
Collection<UnsignedSignatureProperty> unsignedSigProps = new ArrayList<UnsignedSignatureProperty>(collectedUnsignedSigProps.size() + formatSpecificUnsignedSigProps.size());
unsignedSigProps.addAll(collectedUnsignedSigProps);
unsignedSigProps.addAll(formatSpecificUnsignedSigProps);
/* **** Data objects properties **** */
Collection<DataObjectDesc> dataObjsInfo = dataObjs.getDataObjectsDescs();
// The containers for all the specified signed data object properties. Since
// some properties can be applied to multiple data objects, we need to rule
// out repeated references (a Set is used).
Set<SignedDataObjectProperty> signedDataObjProps = new HashSet<SignedDataObjectProperty>(dataObjsInfo.size());
Set<UnsignedDataObjectProperty> unsignedDataObjProps = new HashSet<UnsignedDataObjectProperty>(0);
// Add the global data object properties.
signedDataObjProps.addAll(dataObjs.getSignedDataObjsProperties());
unsignedDataObjProps.addAll(dataObjs.getUnsignedDataObjsProperties());
// Add the properties specified for each data object.
for (DataObjectDesc dataObjInfo : dataObjsInfo) {
// If no properties were specified allow the provider to add them.
if (!dataObjInfo.hasProperties())
this.dataObjPropsProvider.provideProperties(dataObjInfo);
signedDataObjProps.addAll(dataObjInfo.getSignedDataObjProps());
unsignedDataObjProps.addAll(dataObjInfo.getUnsignedDataObjProps());
}
return new QualifyingProperties(new SignedProperties(signedSigProps, signedDataObjProps), new UnsignedProperties(unsignedSigProps, unsignedDataObjProps));
}
use of xades4j.properties.UnsignedDataObjectProperty in project xades4j by luisgoncalves.
the class XAdESVerificationResult method createQualifProps.
private QualifyingProperties createQualifProps() {
Collection<QualifyingProperty> props = this.propertiesGetter.getAll();
Collection<SignedSignatureProperty> ssp = CollectionUtils.filterByType(props, SignedSignatureProperty.class);
Collection<SignedDataObjectProperty> sdop = CollectionUtils.filterByType(props, SignedDataObjectProperty.class);
Collection<UnsignedSignatureProperty> usp = CollectionUtils.filterByType(props, UnsignedSignatureProperty.class);
Collection<UnsignedDataObjectProperty> udop = CollectionUtils.filterByType(props, UnsignedDataObjectProperty.class);
return new QualifyingProperties(new SignedProperties(ssp, sdop), new UnsignedProperties(usp, udop));
}
Aggregations