Hi Ravi,
Take a deeper look at the
XMLSignatureFactory#newSignatureMethod method. You will see you can define your own algorithmic model by passing the w3.org URI for the algorithm as a
String.
The URI for RSA with SHA512 is "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512".
PS. I've updated your post with CodeTags. Unformatted or unindented code is often extremely hard to read and many people that might be able to help you will just move along to posts that are easier to understand. Please click this link ⇒
UseCodeTags ⇐ for more information.