2

My requirement is signing the message with private key on one side and verifying it on other side using public key. SHA256, rsa:2048 are the algorithms i need to use. May i know whether X.509 is needed for my requirement if yes what is its role during signature generation and verification ?

Babu
  • 21
  • 1
  • this might help - http://security.stackexchange.com/questions/73156/whats-the-difference-between-x-509-and-pkcs7-certificate – JOW Nov 04 '15 at 10:38

1 Answers1

1

X509 is a set of standards for a whole bunch of Public Key Infrastructure stuff. Usually, when people refer to X509, they mean certificates since X509 is the widely accepted format for certificates.

So, I will interpret your question as:

what is the role of certificates during signature generation and verification?

Short Answer:

There's no technology reason why you need a certificate. You sign something with your private key, someone else verifies it with your public key, done. The problem that certificates solve is getting your public key to the recipient without an attacker being able to put in their own public key instead.

Longer Answer:

Let's say you have a private key and the corresponding public key. You sign a message with the private key. You want somebody else to be able to verify your signature. Well they need your public key in order to do that. The question is: how do you get your public key to them without it getting intercepted and replaced by an attacker's public key? This is known as the key distribution problem. If you have a way to do that, like a GPG Public Key Server, or an internal corporate network share then you don't need certificates at all.

But if you need to send your public key over an insecure method, like email, then having a Certificate Authority make a certificate for your public key ensures that no attacker can do a man-in-the-middle and replace your public key with their own.

Mike Ounsworth
  • 57,707
  • 21
  • 150
  • 207
  • I have a similar problem. I have a system which receives some payload from a third party application via an API endpoint. The payoad is getting signed using a X509 Certificate(Private Key). How do I verify the request is being signed using their public Key at my application side. Is there any way to do this via Apache. Please refer my detailed question- http://security.stackexchange.com/questions/139207/testing-digital-signature-on-an-incoming-request-via-apache – Richa Sinha Oct 09 '16 at 05:05