java - Using JAXB with signatures, encryption and encoding -


recently we've been tasked coming xml communication specification our products. few of coworkers have high opinions of jaxb marshalling , unmarshalling xml docs. i've spent time playing around , understand coming from. makes life simple simple xml docs.

now take notch. 1 of things see in our communication model "built in" signature validation people use after me. 1 of problems i'm running validate signature need treat corresponding xml bytes. let's take example...

<toplevel>     <sensitivedata encoding="utf8">         <creditcard>             <number>1234-1234-1234-1234</number>             <expdate>oct 2020</expdate>         </creditcard>     </sensitivedata>     <signatureofsensitivedata algorithm="sha1withrsa">vghpc0lzqvnpz25hdhvyzq==</signatureofsensitivedata> </toplevel> 

edit: not passing credit card data. example here.

what great if byte[] (determined encoding) representation of inside of "sensitivedata" tag. wouldn't mind having call "unmarshall" again on byte[].

this opens other doors us. introduce "compression" , "encryption" attributes elements. if treat them byte[] inflate , decrypt them , pass them on unmarshalled again.

side note: think works if base64 encode xml , include in element. forces base64 simple documents , introduce unnecessary bloat our messages.

any ideas solutions this? hope i'm missing basic in jaxb , breeze after that.

thanks!


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -