• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help with conversion of String to x509Certificate

 
Ranch Hand
Posts: 64
Oracle Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic