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 26 27 28 29 30 31
|
# List all local authorities.
def list
require_relative '../lib/localhost'
terminal = self.terminal
Localhost::Authority.list do |authority|
terminal.print(
:hostname, authority.hostname, " ",
:name, authority.name, "\n", :reset,
"\tCertificate Path: ", authority.certificate_path, "\n",
"\t Key Path: ", authority.key_path, "\n",
"\t Expires: ", authority.certificate.not_after, "\n",
:reset, "\n"
)
end
end
private
def terminal(out = $stdout)
require 'console/terminal'
terminal = Console::Terminal.for(out)
terminal[:hostname] = terminal.style(nil, nil, :bold)
terminal[:name] = terminal.style(:blue)
return terminal
end
|