Monday, March 15, 2010

Transaction Signing in Oracle Forms using Digital Certificates

I have implemented transaction signing in Oracle application using digital certificates. Created a java bean to access windows default keystore (SunMSCAPI) to get all certificates and populate them in oracle forms application, Signing oracle forms data of all columns and storing the signature with publickey in the database.



Verification of tempered data through stored signature with associated publickey. 
Sample java bean code for digital signing:
            PublicKey pub;                
                KeyStore keystore = KeyStore.getInstance("Windows-MY","SunMSCAPI");
                keystore.load(null, null);
                Certificate c = keystore.getCertificate(selectedcert);
                pub = c.getPublicKey();
                PrivateKey privKey = (PrivateKey) keystore.getKey(selectedcert, null);
                Provider p = keystore.getProvider();
                Signature sig = Signature.getInstance("SHA1withRSA", p);
                sig.initSign(privKey);
                bdts = datatosign.getBytes();
                sig.update(bdts);
                signature = sig.sign();
                signaturetext = getHexString(signature);


Requirements : Sun JVM version 1.6 or heigher

Email me to get full source code with demo application.



13 comments:

public key infrastructure said...

Wonderful information. I have created the java beans and now trying to storing the signature with public key in database but it is not saving in db. Tried 2-3 times getting the same thing again and again.

Qamar Abbas said...

Well, can you share the java bean code ?? and tell me exact error you getting while saving the signature and public key.

Anonymous said...

hi dude,
Can you share the demo app.I need to implement the same functionality for one of my client to move them onto paperless transaction.

Mail me source on daniel.h.sung@gmail.com

Thanks,
Daniel from HK

Anonymous said...

hello Qamer...,

can u share the demo app...,here i tried but 'm not getting certificate name on list item when i click the get certs btn..., pls help me

Qamar Abbas said...

share your email address, I will send you the demo app.

Naveen said...

Hi Qamar

Can you share me the demo app.I need to implement the same functionality for one of my client.

Mail me source naveenknc@gmail.com

Regards
naveen

Naveen said...

Hi Qamar

Can you share me the demo app.I need to implement the same functionality for one of my client.

Mail me source naveenknc@gmail.com

Regards
naveen

Anonymous said...

Salam AK
thanks for the info.
can you please mail me the demo application. i need to implement the same for one of our client.
my email is smohiaq@keylink.com
early response is highly appreciated.
Regards
Mohiuddin.

Anonymous said...

Hi
I am trying to do same kind of thing, I tried this app http://sourceforge.net/projects/oraclesigning/ to run which look like done by you , but 'm not getting any list when i click the get certs button..., Can you please help me with the demo app not only the jar

Anonymous said...

hi,

I was trying to do the same thing with oracle forms, I tried http://sourceforge.net/projects/oraclesigning/ this app which looks like done by you, but 'm not getting certificate list when i click the get certs button..., Can you please help me with the demo app or the whole demo app to try

Qamar Abbas said...

Hi Anonymous,

Contact me on kamarsyed@gmail.com

Anonymous said...

I mailed you yesterday, but didn't get any response yet

Gabriel said...

Please, send me to my email...