aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.PL2
-rw-r--r--lib/Net/MulkyID/Builder.pm4
-rwxr-xr-xlib/Net/MulkyID/Setup.pm4
3 files changed, 8 insertions, 2 deletions
diff --git a/build.PL b/build.PL
index f891784..342fae0 100644
--- a/build.PL
+++ b/build.PL
@@ -16,6 +16,7 @@ my $build = Net::MulkyID::Builder->new
"CGI::Session" => 0,
"common::sense" => 0,
"Crypt::OpenSSL::RSA" => 0,
+ "Crypt::OpenSSL::Bignum" => 0,
"File::Slurp" => 0,
"JSON" => 0,
"MIME::Base64" => 0,
@@ -28,6 +29,7 @@ my $build = Net::MulkyID::Builder->new
"LWP::Simple" => 0,
"Modern::Perl" => 0,
"Crypt::OpenSSL::RSA" => 0,
+ "Crypt::OpenSSL::Bignum" => 0,
"File::Slurp" => 0,
"JSON" => 0,
"common::sense" => 0
diff --git a/lib/Net/MulkyID/Builder.pm b/lib/Net/MulkyID/Builder.pm
index a1c000d..bd5058f 100644
--- a/lib/Net/MulkyID/Builder.pm
+++ b/lib/Net/MulkyID/Builder.pm
@@ -18,7 +18,9 @@ sub new {
sub ACTION_build {
my ($self, @args) = @_;
eval "use Net::MulkyID::Setup; setup();";
- #return SUPER::ACTION_build($self, @args);
+ if ($@) {
+ die $@;
+ }
}
1;
diff --git a/lib/Net/MulkyID/Setup.pm b/lib/Net/MulkyID/Setup.pm
index 8c58013..b79f96b 100755
--- a/lib/Net/MulkyID/Setup.pm
+++ b/lib/Net/MulkyID/Setup.pm
@@ -12,6 +12,7 @@ use File::Path qw(make_path);
use File::Copy;
use LWP::Simple qw(getstore);
use Data::Dumper;
+#use autodie;
use base 'Exporter';
our @EXPORT = qw(setup);
@@ -80,7 +81,8 @@ sub setup() {
} else {
say "Generating private key...";
$key = Crypt::OpenSSL::RSA->generate_key(2048);
- make_path($configpath);
+ make_path($configpath)
+ or die "Could not create directory: $configpath";
write_file($pemfile, $key->get_private_key_string())
or die "Could not write private key to $pemfile: $!";
say "Private key saved to: $pemfile";