How to go about signing text in a verifiable way from within ruby in a simple yet strong & portable
- by roja
Guys,
I have been looking for a portable method to digitally sign arbitrary text which can be placed in a document and distributed while maintaining its verifiable origin. Here is an example:
a = 'some text'
a.sign(<private key>) # => <some signature in ASCII format>
The contents of a can now be distributed freely. If a receiver wants to check the validity of said text they can do the following:
b = 'some text'
b.valid(<public key>, <signature supplied with text>) # => true/false
Is there any library out there that already offers this kind of functionality? Ruby standard library contains SHA hashing code so at lest there is a portable way to perform the hashing but from that point I am struggling to find anything which fits purpose.
Kind Regards,
Roja