summaryrefslogtreecommitdiffstats
path: root/lib/puppet/ssl/certificate.rb
blob: 82f251d9c29f38828938d0a14aa7c38c6453fb04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require 'puppet/ssl/base'

# 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).
class Puppet::SSL::Certificate < Puppet::SSL::Base
    # This is defined from the base class
    wraps OpenSSL::X509::Certificate

    extend Puppet::Indirector
    indirects :certificate, :terminus_class => :file

    # Because of how the format handler class is included, this
    # can't be in the base class.
    def self.supported_formats
        [:str]
    end

    def expiration
        return nil unless content
        return content.not_after
    end
end