Class: Ronin::DB::CertSubject
- Inherits:
-
CertOrganization
- Object
- ActiveRecord::Base
- CertOrganization
- Ronin::DB::CertSubject
- Defined in:
- lib/ronin/db/cert_subject.rb
Overview
Represents an subject of a SSL/TLS certificate.
Constant Summary
Constants inherited from CertOrganization
Ronin::DB::CertOrganization::X509_ATTRIBUTES
Instance Attribute Summary collapse
-
#certs ⇒ Array<Cert>
The certificates that share this subject information.
-
#common_name ⇒ CertName
The subject's common name (
CN
).
Attributes inherited from CertOrganization
#country, #created_at, #id, #locality, #organization, #organizational_unit, #state
Class Method Summary collapse
-
.import(name) ⇒ CertSubject
private
Imports the certificate subject's X509 distinguished name.
Methods inherited from CertOrganization
Methods included from Model
Instance Attribute Details
#certs ⇒ Array<Cert>
The certificates that share this subject information.
53 54 |
# File 'lib/ronin/db/cert_subject.rb', line 53 has_many :certs, foreign_key: :subject_id, dependent: :destroy |
#common_name ⇒ CertName
The subject's common name (CN
).
36 37 |
# File 'lib/ronin/db/cert_subject.rb', line 36 belongs_to :common_name, class_name: 'CertName', required: true |
Class Method Details
.import(name) ⇒ CertSubject
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.
Imports the certificate subject's X509 distinguished name.
67 68 69 70 71 72 73 74 |
# File 'lib/ronin/db/cert_subject.rb', line 67 def self.import(name) attributes = parse(name) common_name = attributes.fetch(:common_name) attributes[:common_name] = CertName.find_or_import(common_name) return find_or_create_by(attributes) end |