diff options
| author | Luke Kanies <luke@madstop.com> | 2008-03-07 15:31:15 -0700 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-04-15 21:34:02 -0500 |
| commit | 4ca6fd3e476dbc582ebc69f5fdf9709a8703613b (patch) | |
| tree | bf151bc9c852184b98a7a7c5f923c5063eb02421 /lib/puppet/ssl | |
| parent | ef7d914aee89b6ea023f030350d04923a7b63fd2 (diff) | |
| download | puppet-4ca6fd3e476dbc582ebc69f5fdf9709a8703613b.tar.gz puppet-4ca6fd3e476dbc582ebc69f5fdf9709a8703613b.tar.xz puppet-4ca6fd3e476dbc582ebc69f5fdf9709a8703613b.zip | |
First stage of cert refactoring: Private
keys kind of work.
Diffstat (limited to 'lib/puppet/ssl')
| -rw-r--r-- | lib/puppet/ssl/key.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/puppet/ssl/key.rb b/lib/puppet/ssl/key.rb new file mode 100644 index 000000000..69a09f1a8 --- /dev/null +++ b/lib/puppet/ssl/key.rb @@ -0,0 +1,21 @@ +require 'puppet/ssl' +require 'puppet/indirector' + +# Manage private and public keys as a pair. +class Puppet::SSL::Key # :nodoc: + extend Puppet::Indirector + + indirects :key #, :terminus_class => :file + + attr_accessor :name, :content + + # Knows how to create keys with our system defaults. + def generate + Puppet.info "Creating a new SSL key for %s" % name + @content = OpenSSL::PKey::RSA.new(Puppet[:keylength]) + end + + def initialize(name) + @name = name + end +end |
