Method: Puppet::SSL::Key::File#save
- Defined in:
- lib/puppet/indirector/key/file.rb
#save(request) ⇒ Object
Save the public key, in addition to the private key.
38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/puppet/indirector/key/file.rb', line 38 def save(request) super begin # RFC 1421 states PEM is 7-bit ASCII https://tools.ietf.org/html/rfc1421 Puppet.settings.setting(:publickeydir).open_file(public_key_path(request.key), 'w:ASCII') do |f| f.print request.instance.content.public_key.to_pem end rescue => detail raise Puppet::Error, _("Could not write %{request}: %{detail}") % { request: request.key, detail: detail }, detail.backtrace end end |