App-sshca

 view release on metacpan or  search on metacpan

bin/sshca  view on Meta::CPAN

    my $serial = (ref $serial_or_cert)
        ? $serial_or_cert->{serial} : $serial_or_cert;
    $digest->reset;
    $digest->add( "$serial" );
    my $hash = $digest->hexdigest;
    $hash =~ m/^(..)(..)/;

    my $dir = File::Spec->catdir( opt( 'certsdir' ), $1, $2 );
    if ($create) {
        make_path $dir;
        ###TODO: verify success!
    }
    return File::Spec->catfile( $dir, "$hash.json");
}

sub cert_load_from_path($path) {
    open(my $fh, '<:encoding(UTF-8)', $path)
        or die "Unable to open certificate file '$path': $!";
    return $json->decode( do { local $/ = undef; <$fh> } );
}



( run in 0.593 second using v1.01-cache-2.11-cpan-39bf76dae61 )