EldoS | Feel safer!

Software components for data protection, secure storage and transfer

[Java] How to get an X509Cerficate form a TElX509Certificate ?

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
Posted: 07/01/2013 04:10:07
by Mickaël Bénès (Standard support level)
Joined: 02/26/2013
Posts: 72

Hi there !

I found how to create a TElX509Certificate object from an X509Certificate object using :

But how can I do the opposite, create an X509Certificate from a TElX509Certificate ?
I've got several methods in my application that verify an X509Certificate and for now I don't want to change all of my application's X509Certificate objects into TElX509Certificate objects, that'll come later.

Thanks !

Posted: 07/01/2013 04:17:25
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

The code will look this way:

ByteArrayOutputStream os = new ByteArrayOutputStream();
TElX509Certificate x509 = new TElX509Certificate();

CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
InputStream in = new ByteArrayInputStream(os.toByteArray());
X509Certificate cert = (X509Certificate)certFactory.generateCertificate(in);

The latest 11th version of SecureBlackbox includes TElX509Certificate.ToX509Certificate/FromX509Certificate methods to simplify the conversion.
Posted: 07/01/2013 04:35:54
by Mickaël Bénès (Standard support level)
Joined: 02/26/2013
Posts: 72

Thank you for the quick answer !

The 11th version of SecureBlackBox is only available has a beta for what I've seen, so I'll wait for the official release. Good to know though, thanks !



Topic viewed 403 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!