I want to port a simple C# code to Java. It would read a pair of certificates in .pem format to sign/encrypt and validate/decrypt xml string using xml ecryption and xml signature standard provided by W3C. Would be easy for some one who has experience in Java and Cryptography. External library is allowed to use.
The attached file is the code in C#.