Class: Ronin::DB::CertSubjectAltName

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Model
Defined in:
lib/ronin/db/cert_subject_alt_name.rb

Overview

Represents a subjectAltName value from a SSL/TLS certificate.

Since:

  • 0.2.0

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Model

included

Instance Attribute Details

#certCert

The parent certificate.

Returns:



53
# File 'lib/ronin/db/cert_subject_alt_name.rb', line 53

belongs_to :cert, required: true

#idInteger

The primary key of the certificate subjectAltName value.

Returns:

  • (Integer)


40
# File 'lib/ronin/db/cert_subject_alt_name.rb', line 40

attribute :id, :integer

#nameCertName

A DNS:, IP:, or Email: name.

Returns:



46
47
# File 'lib/ronin/db/cert_subject_alt_name.rb', line 46

belongs_to :name, class_name: 'CertName',
required:   true

Class Method Details

.parse(string) ⇒ Array<String>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parses a subjectAltName string.

Parameters:

  • string (String)

    The subjectAltName string.

Returns:

  • (Array<String>)

    The parsed subjectAltNames.

Since:

  • 0.2.0



66
67
68
69
70
71
72
# File 'lib/ronin/db/cert_subject_alt_name.rb', line 66

def self.parse(string)
  string.split(', ').map do |item|
    _prefix, name = item.split(':',2)

    name
  end
end

Instance Method Details

#to_sString

Converts the certificate subjectAltName to a String.

Returns:

  • (String)

Since:

  • 0.2.0



79
80
81
# File 'lib/ronin/db/cert_subject_alt_name.rb', line 79

def to_s
  name.to_s
end