Class: SSLyze::X509::Extensions::BasicConstraints

Inherits:
SSLyze::X509::Extension show all
Defined in:
lib/sslyze/x509/extensions/basic_constraints.rb

Overview

Represents the basicConstraints X509v3 extension.

Since:

  • 1.0.0

Instance Method Summary collapse

Instance Method Details

#ca?Boolean?

The value of the CA constraint.

Returns:

  • (Boolean, nil)

Since:

  • 1.0.0



18
19
20
21
22
# File 'lib/sslyze/x509/extensions/basic_constraints.rb', line 18

def ca?
  if    value.include?('CA:TRUE') then true
  elsif value.include?('CA:FALSE') then false
  end
end

#path_lengthInteger? Also known as: path_len, pathlen

The value of the pathlen constraint.

Returns:

  • (Integer, nil)

Since:

  • 1.0.0



29
30
31
32
33
# File 'lib/sslyze/x509/extensions/basic_constraints.rb', line 29

def path_length
  @path_length ||= if (match = value.match(/pathlen:(\d+)/))
                     match[1].to_i
                   end
end