I'm trying to apply a DSA signature to the XML output of a JAXB object by following this example: http://goo.gl/vVNxy. I'm able to convert the JAXB object to a Document; however, when I go to create the XMLSignature I'm unsure what BaseURI I should use as my XML is not coming from a file like in the example.
The real problem though is that when I attempt to add a Transform, I
keep getting a NullPointerException on this line:
transforms.addTransform(Transforms.TRANSFORM_C14N_WITH_COMMENTS);
Exception in thread "main" java.lang.NullPointerException
at org.apache.xml.security.transforms.Transform.getTransformSpi(Unknown
Source)
at org.apache.xml.security.transforms.Transform.<init>(Unknown Source)
at org.apache.xml.security.transforms.Transform.getInstance(Unknown
Source)
at org.apache.xml.security.transforms.Transform.getInstance(Unknown
Source)
at org.apache.xml.security.transforms.Transforms.addTransform(Unknown
Source)
at test.Test.main(Test.java:64)
I have attached my source example file and the associated XSD file I
used to generate the Token & Principal JAXB objects.
Any help or insight would be greatly appreciated.
Thanks in advance...
Bill-
Test.java
Description: Binary data
token.xsd
Description: Binary data
