0

I have keypair(private key and public key). Using the private key I added the signature to the document. Now how can I validate the signature in the document using the public key. I have to do same thing like How to use PKI (public/private key) encryption in Ruby?. But my requirement is to document. I read this Insert digital signature into existing pdf file. But it uses certificate. And I don't know how to validate the added certificate. I am new to cryptography. How to add digital signature into pdf and verify.

Community
  • 1
  • 1
user7146134
  • 23
  • 1
  • 4
  • As a side note: *"I have keypair(private key and public key). I will send private key to user to sign document."* - usually the user should create the keypair himself and share the public key with you (e.g. in a certificate). As you do it, the user can always claim that not he but you signed the document because you after all have the private key, too. – mkl Apr 07 '17 at 08:25
  • I'm absolutely on board with @mkl here. You **never** send private keys to anyone. Ever. They should generate their own and keep it secure. Exchanging public keys is harmless so long as you don't arbitrarily trust them, that's when things get tricky. If your private key ever leaves your computer you should burn it and get a new one, as it should be considered compromised. – tadman Apr 07 '17 at 09:34
  • I have edited the question. That is not real time scenario. Just to learning purpose. – user7146134 Apr 07 '17 at 10:27

0 Answers0