Class: Puppet::SSL::Certificate
- Extended by:
- Indirector
- Defined in:
- lib/vendor/puppet/ssl/certificate.rb
Overview
Manage certificates themselves. This class has no ‘generate’ method because the CA is responsible for turning CSRs into certificates; we can only retrieve them from the CA (or not, as is often the case).
Defined Under Namespace
Classes: Ca, DisabledCa, File, Rest
Constant Summary
Constants included from Indirector
Constants inherited from Base
Base::SEPARATOR, Base::VALID_CERTNAME
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.from_s(string) ⇒ Object
Convert a string into an instance.
-
.supported_formats ⇒ Object
Because of how the format handler class is included, this can’t be in the base class.
Instance Method Summary collapse
Methods included from Indirector
Methods inherited from Base
#ca?, #fingerprint, from_multiple_s, #generate, #initialize, #read, to_multiple_s, #to_s, #to_text, validate_certname, wrapped_class, wraps
Constructor Details
This class inherits a constructor from Puppet::SSL::Base
Class Method Details
.from_s(string) ⇒ Object
Convert a string into an instance.
16 17 18 19 20 21 22 |
# File 'lib/vendor/puppet/ssl/certificate.rb', line 16 def self.from_s(string) instance = wrapped_class.new(string) name = instance.subject.to_s.sub(/\/CN=/i, '').downcase result = new(name) result.content = instance result end |
.supported_formats ⇒ Object
Because of how the format handler class is included, this can’t be in the base class.
26 27 28 |
# File 'lib/vendor/puppet/ssl/certificate.rb', line 26 def self.supported_formats [:s] end |
Instance Method Details
#expiration ⇒ Object
36 37 38 39 |
# File 'lib/vendor/puppet/ssl/certificate.rb', line 36 def expiration return nil unless content content.not_after end |
#subject_alt_names ⇒ Object
30 31 32 33 34 |
# File 'lib/vendor/puppet/ssl/certificate.rb', line 30 def subject_alt_names alts = content.extensions.find{|ext| ext.oid == "subjectAltName"} return [] unless alts alts.value.split(/\s*,\s*/) end |