I'm developing (java) a xml verification application which needs to connect to a windows keystore. At the moment I'm stuck at the following message: CannotBuildCertificationPathExecption: Trust anchors Keystore is not initialized.
Now I was able to get my key from the store using this example:http://stackoverflow.com/questions/5476974/java-access-to-intermediate-cas-from-windows-keystores Which works great. And gave me hope in using XAdES4J.
The code I'm using is the following:
trustAnchors = KeyStore.getInstance("Windows-MY");
certValidator = new PKIXCertificateValidationProvider(trustAnchors, false);
p = new XadesVerificationProfile(certValidator);
v = p.newVerifier();
Element sigElem = (Element) signature.item(0); //Which contains the complete signature segment from the xml
XAdESVerificationResult r;
SignatureSpecificVerificationOptions options = new SignatureSpecificVerificationOptions().useBaseUri("http://www.ietf.org/rfc/");
r = v.verify(sigElem, options);
The certificate is a x509. The encryption method XAdES-t.
Does anybody know how to get a trusted connection with a windows keystore? Is there any information about SignatureSpecificVerificationOptions. I find it really hard to understand the manual in context with the actual settings I need to use..