use of xades4j.providers.SignaturePolicyDocumentProvider in project xades4j by luisgoncalves.
the class DefaultVerificationBindingsModule method configure.
@Override
protected void configure() {
bind(MessageDigestEngineProvider.class).to(DefaultMessageDigestProvider.class);
bind(TimeStampVerificationProvider.class).to(DefaultTimeStampVerificationProvider.class);
bind(SignaturePolicyDocumentProvider.class).toInstance(new SignaturePolicyDocumentProvider() {
@Override
public InputStream getSignaturePolicyDocumentStream(ObjectIdentifier sigPolicyId) {
return null;
}
});
// QualifyingPropertiesVerifier is not configurable but the individual
// verifiers may have dependencies.
bind(QualifyingPropertiesVerifier.class).to(QualifyingPropertiesVerifierImpl.class);
bind(QualifyingPropertyVerifiersMapper.class).to(QualifyingPropertyVerifiersMapperImpl.class);
// customGlobalStructureVerifiers.add(new CustomPropertiesDataObjsStructureVerifier()
// {
// @Override
// public void verifiy(DataGetter<PropertyDataObject> dataObjsGetter) throws PropertyDataStructureException
// {
// if (dataObjsGetter.getOfType(SigningCertificateData.class).isEmpty())
// throw new PropertyDataStructureException("property is required and isn't present", SigningCertificateProperty.PROP_NAME);
// }
// });
// QualifyingPropertyVerifiersMapperImpl relies on the injector to get
// the individual verifiers, so they need to be bound.
// - SignedSignatureProperties
bindBuiltInVerifier(SigningTimeData.class, SigningTimeVerifier.class);
bindBuiltInVerifier(SignerRoleData.class, SignerRoleVerifier.class);
bindBuiltInVerifier(SignatureProdPlaceData.class, SigProdPlaceVerifier.class);
bindBuiltInVerifier(SigningCertificateData.class, SigningCertificateVerifier.class);
bindBuiltInVerifier(SignaturePolicyData.class, SignaturePolicyVerifier.class);
// - SignedDataObjectProperties
bindBuiltInVerifier(CommitmentTypeData.class, CommitmentTypeVerifier.class);
bindBuiltInVerifier(DataObjectFormatData.class, DataObjFormatVerifier.class);
bindBuiltInVerifier(AllDataObjsTimeStampData.class, AllDataObjsTimeStampVerifier.class);
bindBuiltInVerifier(IndividualDataObjsTimeStampData.class, IndivDataObjsTimeStampVerifier.class);
// - UnsignedSignatureProperties
bindBuiltInVerifier(SignatureTimeStampData.class, SignatureTimeStampVerifier.class);
bindBuiltInVerifier(CompleteCertificateRefsData.class, CompleteCertRefsVerifier.class);
bindBuiltInVerifier(CompleteRevocationRefsData.class, CompleteRevocRefsVerifier.class);
MapBinder<QName, QualifyingPropertyVerifier> unkownElemsBinder = MapBinder.newMapBinder(binder(), QName.class, QualifyingPropertyVerifier.class);
unkownElemsBinder.addBinding(new QName(QualifyingProperty.XADES_XMLNS, CounterSignatureProperty.PROP_NAME)).to(CounterSignatureVerifier.class);
// Verification based on XML elements names.
bind(new TypeLiteral<QualifyingPropertyVerifier<GenericDOMData>>() {
}).to(GenericDOMDataVerifier.class);
// Ensure empty sets when no bindings are defined
Multibinder.newSetBinder(binder(), RawSignatureVerifier.class);
Multibinder.newSetBinder(binder(), CustomSignatureVerifier.class);
Multibinder.newSetBinder(binder(), CustomPropertiesDataObjsStructureVerifier.class);
}
Aggregations