EldoS | Feel safer!

Software components for data protection, secure storage and transfer

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

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
#25486
Posted: 07/01/2013 04:10:07
by Mickaël Bénès (Standard support level)
Joined: 02/26/2013
Posts: 74

Hi there !

I found how to create a TElX509Certificate object from an X509Certificate object using :
Code
TElX509Certificate.LoadFromBuffer(X509Certificate.getEncoded());

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 !

Mickaël
#25487
Posted: 07/01/2013 04:17:25
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

The code will look this way:

Code
ByteArrayOutputStream os = new ByteArrayOutputStream();
TElX509Certificate x509 = new TElX509Certificate();
...
x509.SaveToStream(os);

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.
#25489
Posted: 07/01/2013 04:35:54
by Mickaël Bénès (Standard support level)
Joined: 02/26/2013
Posts: 74

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 !

Reply

Statistics

Topic viewed 413 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!