I want to create a certificate from a string. Why does this not work:
OpenSSL::X509::Certificate.new(OpenSSL::X509::Certificate.new.to_pem)
It retur
So I got the answer myself. The certificate needs at least these information:
cert = OpenSSL::X509::Certificate.new
cert.version = 2
cert.serial = 0
cert.not_before = Time.now
cert.not_after = Time.now + 3600
cert.public_key = key.public_key
cert.sign key, OpenSSL::Digest::SHA1.new
Then this is possible:
OpenSSL::X509::Certificate.new(cert.to_pem)
=> returns