I'm not sure I completely understood your question. If you're asking how to verify a counter signature property, it is already done as part of the verification of the "main" signature. Please note:
- The same
XadesVerifier
is used for both the main signature and the counter signature. - If the validation succeeds, a property of type
CounterSignatureProperty
is added to the result. You can access the property through the verification result of the main signature
XAdESVerificationResult res = ...; CounterSignatureProperty p = res.getPropertiesFilter().getOfType(CounterSignatureProperty.class);
EDIT:
The message says everything: the counter signature is probably invalid. By definition, a counter signature must include a reference to the countersigned SignatureValue
element.
Can you lookup the CounterSignature element on the original XML document and post it here?