Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XSD schema string elements Encrypt/Decrypt

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.

like image 330
Reddy Avatar asked Feb 07 '26 02:02

Reddy


1 Answers

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.

  • Using JAXB generated class for an element that requires an integer with a pattern
like image 106
bdoughan Avatar answered Feb 09 '26 15:02

bdoughan