XSD schema string elements Encrypt/Decrypt

1k Views Asked by At

How could I make the XSD schema string element(password) as type encrypted, This in turn would be used in XSD to java code generator encrypt and decrypt during Writing/Reading process of XML not just validation.

Does any XSD to java class generator provide this feature ??

Cheers, Reddy.

1

There are 1 best solutions below

0
bdoughan On

You can use an XmlAdapter to control how the data is converted between XML and Java. This XmlAdapter is used to hook in your own encryption logic.

Below is a link to an answer I gave that demonstrates how to create an XmlAdapter when generating the model from XML Schema.