Use public Key to decrypt a signature

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
vanmeir
Posts: 13
Joined: Thu 19 May 2011 09:34
Location: The Netherlands
Contact:

Use public Key to decrypt a signature

Post by vanmeir » Thu 27 Aug 2015 01:39

Hello,
...sorry to bother you again but I'm really stuck now.

I have a certificate with a Public Key in it which comes from a SmartCard.
I can import it into a TScCertificate component and it works well on several operations that I have to perform. I can also 'see' the RSA parameters that are enclosed.

Now the regulations say that I need to use the Public Key to decrypt a Signature which I also get from the chip. Later on I have to compare the decrypted result with another value to be sure the chip and its certificate is authentic.

How can I do that?

When I use the TScKey.Decrypt method on the encrypted signature data I get the message that it can not be decrypted without a Public Key. The same message appears when I try Decryp with the TScCertificate component.

Can someone please help me?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: Use public Key to decrypt a signature

Post by Dimon » Fri 28 Aug 2015 15:06

Use the TScCertificate.VerifySign function to verify whether the signature is correct (it is named decrypting the signature) for specified data.
You can learn more about this here: https://en.wikipedia.org/wiki/Public-key_cryptography

vanmeir
Posts: 13
Joined: Thu 19 May 2011 09:34
Location: The Netherlands
Contact:

Re: Use public Key to decrypt a signature

Post by vanmeir » Fri 28 Aug 2015 15:44

Hi Dimon,

I know you're perfectly right but...

I'm building an app in which I'm supposed to follow up the instructions of Dutch organisation for Vehicle Registration and they say that I have to decrypt the signature which will give me some kind of parameter.
Later on in the process I need this parameter so it's all not just for verification of the signature but also for retrieving some useful data out of the signature.

I just upgraded from SB prof to SB prof with source. Now I'm investigating if it's possible to make a helper class with which I can bypass the check of the used Key being private. Hope this brings me there.
If you have a better suggestion...

Regards,
Frans

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: Use public Key to decrypt a signature

Post by Dimon » Fri 28 Aug 2015 16:22

In asymmetric encryption, (RSA or DSA types) two keys are used. The private key is used for data decryption and signing, the public key is used for data encrypting.
The message cannot be decrypted by anyone who does not possess the matching private key. This is used in an attempt to ensure confidentiality.

Post Reply