Class: Ronin::DB::CertName
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Ronin::DB::CertName
- Includes:
- Model, Model::HasUniqueName, Model::Importable
- Defined in:
- lib/ronin/db/cert_name.rb
Overview
Represents a certificate's common name (CN
) or subjectAltName
s.
Instance Attribute Summary collapse
-
#certs ⇒ Array<CertSubject>
The certificates that use this name as their common name (
CN
). -
#created_at ⇒ Time
When the certificate name was created.
-
#id ⇒ Integer
The primary key of the certificate name.
-
#subject_alt_names ⇒ Array<CertSubjectAltName>
The certificates that use this name as one of their
subjectAltName
values.
Attributes included from Model::HasUniqueName
Class Method Summary collapse
-
.import(name) ⇒ CertName
Imports the certificate name.
-
.lookup(name) ⇒ CertName?
Looks up the certificate name.
Instance Method Summary collapse
-
#to_s ⇒ String
Converts the certificate name to a String.
Methods included from Model::Importable
Methods included from Model::HasUniqueName
Methods included from Model
Instance Attribute Details
#certs ⇒ Array<CertSubject>
The certificates that use this name as their common name (CN
).
54 55 56 |
# File 'lib/ronin/db/cert_name.rb', line 54 has_many :subjects, class_name: 'CertSubject', foreign_key: :common_name_id, dependent: :destroy |
#created_at ⇒ Time
When the certificate name was created.
48 |
# File 'lib/ronin/db/cert_name.rb', line 48 attribute :created_at, :datetime |
#id ⇒ Integer
The primary key of the certificate name.
42 |
# File 'lib/ronin/db/cert_name.rb', line 42 attribute :id, :integer |
#subject_alt_names ⇒ Array<CertSubjectAltName>
The certificates that use this name as one of their subjectAltName
values.
63 64 65 |
# File 'lib/ronin/db/cert_name.rb', line 63 has_many :subject_alt_names, class_name: 'CertSubjectAltName', foreign_key: :name_id, dependent: :destroy |
Class Method Details
.import(name) ⇒ CertName
Imports the certificate name.
89 90 91 |
# File 'lib/ronin/db/cert_name.rb', line 89 def self.import(name) create(name: name) end |
.lookup(name) ⇒ CertName?
Looks up the certificate name.
76 77 78 |
# File 'lib/ronin/db/cert_name.rb', line 76 def self.lookup(name) find_by(name: name) end |
Instance Method Details
#to_s ⇒ String
Converts the certificate name to a String.
98 99 100 |
# File 'lib/ronin/db/cert_name.rb', line 98 def to_s name end |