Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
OpenSSL verify certificate from own CA
Bruno Antunes
3/31/2009 1:51:00 PM
Hello all and thanks for your time reading this.
I need to verify certificates issued by my own CA, for which I have a
certificate. How can I do the equivalent to openssl's
openssl verify -CAfile <cafile.pem> <certificate-to-verify.pem>
in Ruby code? The RDoc for OpenSSL is not very helpful in this regard.
I've tried:
[code]
require 'openssl'
ca = OpenSSL::X509::Certificate.new(File.read('ca-cert.pem'))
lic = OpenSSL::X509::Certificate.new(File.read('cert.pem'))
puts lic.verify( ca )
[/code]
but I get:
test.rb:7:in `verify': wrong argument (OpenSSL::X509::Certificate)!
(Expected kind of OpenSSL::PKey::PKey) (TypeError)
from test.rb:7
I can't even find "verify" in the OpenSSL Rdoc at
http://www.ruby-doc.org/stdlib/libdoc/openssl/rdoc/...
.
Any help is appreciated. Thanks again!
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
OpenSSL verify certificate from own CA
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password