EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Signature verification

Posted: 08/03/2006 15:27:01
by  Uma Poduval

I have a c# client communicating with a java application. The client creates a digital signature using a pfx certificate and sends it to java application, the java application needs to verify the signature to authenticate client. Somehow my java application always returns false while verifying signature from .NET client. Whereas when I use the TElX509Certificate's verify method with the same certificate residing on server it works.

Here is my client code snippet:
SBX509.TElX509Certificate cert = new SBX509.TElX509Certificate();
byte[] signature = null;
int outSize = 0;
Console.WriteLine(" result "+cert.Sign(signData,ref signature,ref outSize,false,false));
signature = new byte[outSize];
Console.WriteLine(" result "+cert.Sign(signData,ref signature,ref outSize,false,false));
FileStream wr1 = new FileStream("C:\\x509certificate.cer",FileMode.Open, FileAccess.Read);
TElX509Certificate cert1 = new BX509.TElX509Certificate();
byte [] Buf1 = new byte[wr1.Length];
int data1 = wr1.Read(Buf1, 0, Buf1.Length);

/*line below returns true for me. I am using the same file from same location as my java server resides on same box but java returns false*/
Console.WriteLine(" verify "+cert1.Verify(signData,signature));

Also when I use the java to create signature using the same pfx keystore private key it gives me a different value as digital signature. And the server is able to verify that.

Any help/ pointers would be really appreciated.

Posted: 08/03/2006 22:27:30
by Ken Ivanov (Team)

There exist a lot of different signature types (PKCS#1, PKCS#7). These types are not compatible. What exactly type of a signature do you need to be done? Sign/Verify methods of TElX509Certificate deal with PKCS#7 signatures. Other signature types can be created using TElPublicKeyCrypto classes.



Topic viewed 3714 times

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


Back to top

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

Got it!