#!/usr/bin/perl -w
use
lib
"$FindBin::Bin/../blib/lib"
;
unless
(
@ARGV
== 1 && -d
$ARGV
[0]) {
Pod::Usage::pod2usage( {
-exitval
=> 1,
-verbose
=> 1 } );
}
my
$camodel
= App::CamelPKI->model(
"CA"
);
my
$webservermodel
= App::CamelPKI->model(
"WebServer"
);
try
{
$camodel
->instance;
my
$dbdir
=
$camodel
->db_dir();
die
<<"MESSAGE";
The CA existing in $dbdir seems to be operationnal, so I won't take
the risk to delete it.
MESSAGE
}
catch
App::CamelPKI::Error::State
with
{
1;
};
$camodel
->do_ceremony(
$ARGV
[0],
$webservermodel
->apache);
warn
<<"SUCCESS";
The Key Ceremony was successful. $ARGV[0] contains the secret data (private
key and certificate of the Root CA, admin credentials).
SUCCESS
exit
0;