A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Node.js in Action
this week in the
encryption using certificate
Joined: Aug 01, 2008
Jul 29, 2009 00:06:25
I am new for security. I want to encrypt and decrypt sensitive information before storing in database using server certificate.
Right now i am encrypting and decrypting information using RSA algorithm and generating public and private key from
But i dont know how to use certificate in code to encrypt and decrypt data. I have generated certificate using keytool.
if anybody can help me with code, then it will be great help for me.....
Thanks in andvance................
Joined: Mar 22, 2005
Jul 31, 2009 09:52:30
You don't need a certificate for en/decryption, you need just the key. The Java API for this is called JCE, and you can find more information about it, including links to code samples, at
Ping & DNS, my free Android app for network diagnostics
Joined: Feb 06, 2009
Aug 01, 2009 08:19:13
you can make use of this command below . this requires itext.jar
CertificateFactory cf = CertificateFactory.getInstance("X509"); Collection col = cf.generateCertificates(new FileInputStream("export.cer"));
I agree. Here's the link:
subject: encryption using certificate
Java encryption and decryption
java source code for DES algorithm
3DES encryption and decryption
java code for DES algorithm
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014