diff options
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/ssl/certificate_authority.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/puppet/ssl/certificate_authority.rb b/lib/puppet/ssl/certificate_authority.rb index 62e799ef6..2399c7204 100644 --- a/lib/puppet/ssl/certificate_authority.rb +++ b/lib/puppet/ssl/certificate_authority.rb @@ -96,6 +96,11 @@ class Puppet::SSL::CertificateAuthority return pass end + # List all signed certificates. + def list + Puppet::SSL::Certificate.search("*").collect { |c| c.name } + end + # Read the next serial from the serial file, and increment the # file so this one is considered used. def next_serial @@ -119,6 +124,15 @@ class Puppet::SSL::CertificateAuthority FileTest.exist? Puppet[:capass] end + # Print a given host's certificate as text. + def print(name) + if cert = Puppet::SSL::Certificate.find(name) + return cert.to_text + else + return nil + end + end + # Revoke a given certificate. def revoke(name) raise ArgumentError, "Cannot revoke certificates when the CRL is disabled" unless crl |
