From: Damjan Rems Date: 2006-10-11T21:59:20+09:00 Subject: Re: Ruby and XML Security Timothy Goddard wrote: > The Ruby/OpenSSL library is pretty poorly documented but you can pretty > much read it off the OpenSSL library's API. To sign a document you have > to pass in the hash algorithm to use and the text to be signed into the > private key object's sign method: > > example: > > # pkey is our private key > pkey = OpenSSL::PKey::RSA.generate(1024) > pub = pkey.public_key > > # text is our text to be signed > text = "Hello, World!" > > signature = pkey.sign(OpenSSL::Digest::SHA1.new, text) > > if pub.verify(OpenSSL::Digest::SHA1.new, signature, text) > puts "It works!" > else > puts "S#%t! It failed!" > end Thank you very VERY much. I will be back when I'll get my first test message through. I know it has nothing to do with XML, but it has everything to do with "XML security". I was looking for topic on net which would lead me to ruby. But I could not find any. So here it is now. by TheR -- Posted via http://www.ruby-forum.com/.