javaxmljaxbmarshallingxades4j

How to do Digital Signature in Jaxb


can someone please tell How to do Digital Signature in Jaxb. I have used jaxb marshalling and i already have my xml done. i just need the code of how to make my xml have a digital signature. I am using Java and XAdES


Solution

  • It's not clear if you're using xades4j, but since you tagged the question with xades4j, I'm providing some pointers.

    If you use xades4j you don't need to be handling XML marshaling, the library will do that for you. Here are a few examples of using xades4j to creates XAdES signatures:

    https://github.com/luisgoncalves/xades4j/blob/master/src/test/java/xades4j/production/SignerBESTest.java

    Other test files include more examples. Also, check the project's wiki for documentation: