. . .
use IPC::Run qw( start pump finish timeout new_appender new_chunker);
. . .
sub cmd
{
my $self = shift;
my $cmd = shift;
my $cmdline = shift;
my $args = shift;
my $conf;
my $cfgcmd;
if ( (grep $_ eq $cmd,qw(req ca)) && !$args->{noconfig})
{
$conf = $self->{csp}->writeConfig($cmd,$args);
$self->{csp}->die("Unable to write configuration file") unless -f $conf;
$cfgcmd = " -config $conf ";
}
elsif ($cmd eq 'x509' && !$args->{noconfig})
{
$conf = $self->{csp}->writeConfig($cmd,$args);
$self->{csp}->die("Unable to write configuration file") unless -f $conf;
$cfgcmd = " -extfile $conf -extensions extensions ";
}
$cmd = '' if $cmd eq 'dummy';
${$self->{_in}} = "$cmd $cfgcmd $cmdline";
if ($ENV{CSPDEBUG}) {
$self->warn("Here I am");
$self->warn("# openssl $cmd $cfgcmd $cmdline\n");
}
$self->{_handle}->pump while length ${$self->{_in}};
$self->{_handle}->finish;
. . .
####
csp CA_HLL_ROOT_2016 init --verbose --type=root --keysize=4096 --days=7317 --url=ca.harte-lyne.ca --email=certificates@harte-lyne.ca --digest=sha512 "CN=CA_HLL_ROOT_2016,OU=Networked Data Services,O=Harte & Lyne Limited,L=Hamilton,ST=Ontario,C=CA,DC=harte-lyne,DC=ca"
####
[CSP][ ] Here I am
[CSP][ ] # openssl genrsa -des3 -passout pass:'test me' -out /home/byrnejb/Projects/Software/rcsp/ca_test_a/csp/CA_HLL_ROOT_2016/private/ca.key 4096
[CSP][ ] Here I am
[CSP][ ] # openssl req -config /home/byrnejb/Projects/Software/rcsp/ca_test_a/csp/CA_HLL_ROOT_2016/tmp/csp-32489.conf -x509 -sha512 -days 7317 -key /home/byrnejb/Projects/Software/rcsp/ca_test_a/csp/CA_HLL_ROOT_2016/private/ca.key -passin pass:'test me' -new -out /home/byrnejb/Projects/Software/rcsp/ca_test_a/csp/CA_HLL_ROOT_2016/ca.crt