OpenSSL verify certificate from own CA

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:

require 'openssl'

ca ='ca-cert.pem'))

lic ='cert.pem'))

puts lic.verify( ca )

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

Any help is appreciated. Thanks again!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs