santuario-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pellerin, Clement" <>
Subject X509Digest
Date Tue, 16 Feb 2016 22:15:34 GMT
I'm trying to create a signature programmatically in Santuario 2.0.6
I need to add the new element X509Digest defined by XML DSig 1.1
Unfortunately, there is no junit for this usage.

When I run this code:
  List<Object> x509Content = new ArrayList<Object>();
  XMLX509Digest certDigest = new XMLX509Digest(domDocument, signerCert, certDigestUri);
  X509Data x509Data = keyInfoFactory.newX509Data(x509Content);

I'm getting the error:
  ClassCastException: content[0] is not a valid X509Data type

Indeed, the constructor of DOMX509Data does not accept an XMLX509Digest
as part of the content list. In particular, XMLX509Digest is not an

I noticed XMLX509Digest is tagged by the XMLX509DataContent interface,
but that interface is not used by DOMX509Data, surprisingly.

As a side note, I looked for a factory method in DOMKeyInfoFactory
but I could not find one to create an X509Digest.
There are factory methods in
which is unrelated to javax.xml.crypto.dsig.keyinfo.X509Data
so I'm confused.

View raw message