Class: OpenSSL::X509::Certificate

Inherits:
Object
  • Object
show all
Defined in:
lib/arachni/rpc/em/ssl.rb

Overview

Adds support for a few helper methods to X509 certs.

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object



18
19
20
# File 'lib/arachni/rpc/em/ssl.rb', line 18

def ==( other )
    other.respond_to?( :to_pem ) && to_pem == other.to_pem
end

#top_level?Boolean Also known as: root?, self_signed?

A serial must be unique for each certificate. Self-signed certificates, and thus root CA certificates, have the same ‘issuer’ as ‘subject’.

Returns:

  • (Boolean)


24
25
26
# File 'lib/arachni/rpc/em/ssl.rb', line 24

def top_level?
    serial == serial && issuer.to_s == subject.to_s
end