Using JAXB I'm generating XML and adding license signature to the generated xml which is in the below mentioned format: xmlFile.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Users>
<User>.....</User>
<Signature></Signature><!-- This is generated using RSA and SHA -->
</Users>
Java class:
public class Users {
private List<User> userList;
private String signature;
//Setters & Getters goes here
}
This will now be parsed using jaxb but signature content(including tags) is extracted, set to Users object using XSL and will be saved separately to DB in my design. Later to validate this license I again form an XML but since I use the existing information and create an XML it creates like mentioned below:
resultXMl.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Users>
<User>.....</User>
<signature><Signature></Signature><!-- This is generated using RSA and SHA --></signature>
</Users>
According to JAXB implementation it is correct but signature has two tags now. Could any one suggest me how to achieve this. Or is there any other way that enveloping xml works?