This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes Help with conversion of String to x509Certificate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Help with conversion of String to x509Certificate" Watch "Help with conversion of String to x509Certificate" New topic
Author

Help with conversion of String to x509Certificate

Marcelo Tataje
Ranch Hand

Joined: Jan 31, 2011
Posts: 64

Hi, I'm facing the next issue. I'm working with a simple java application and a WebService. The Web Service operation returns a String which contains the certificate data you know:

----BEGIN CERTIFICATE-----zzhjaY5469O....-----END CERTIFICATE----

What I want is to convert that String data into a x509Certificate. The problem is that whenever I try to execute the convertion, an exception is thrown and shows that the Certificate is not valid.

Here's the code I'm using:



The problem is that when I retrieve the certificate it's coming in one line like: sdjaskdlkasjdiji238918172912kjYhjhkuhukhku==
When I used that form of String it fails, even I've tried adding the ----BEGIN CERTIFICATE---- and -----END CERTIFICATE-----
But nothings happened, it still has error.

Somebody please could help me? I'd be really grateful. Thanks in advance
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with conversion of String to x509Certificate
 
Similar Threads
Help with OCSP Stand Alone Implementation
as of release 5, 'enum' is a keyword...
How to attach a certificate to a socket and send a https POST request?
How to use SAML 2.0 Sender Vouches?
getting error while creating keysotre