| 1 | #! /usr/bin/perl | ||||||||||||||
| 2 | |||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | 1 | ▶ | use English qw( -no_match_vars ); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 6 | 1 | ▶ | use HTTP::PublicKeyPins(); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 7 | 1 | ▶ | use Getopt::Long(); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 8 | 1 | ▶ | use Pod::Usage(); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 9 | |||||||||||||||
| 10 | 1 | our $VERSION = 0.03; | |||||||||||||
| 11 | |||||||||||||||
| 12 | MAIN: { | ||||||||||||||
| 13 | 1 | my %options; | |||||||||||||
| 14 | 1 | Getopt::Long::GetOptions( \%options, 'help', 'version' ); | |||||||||||||
| 15 | 1 | ▶ | if ( $options{'help'} ) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 16 | 0 | Pod::Usage::pod2usage( -verbose => 1 ); | |||||||||||||
| 17 | } | ||||||||||||||
| 18 | elsif ( $options{version} ) { | ||||||||||||||
| 19 | 0 | ▶ | print "Version $VERSION\n" | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 20 | or Carp::croak("Failed to print to STDOUT:$EXTENDED_OS_ERROR"); | ||||||||||||||
| 21 | } | ||||||||||||||
| 22 | 1 | foreach my $path (@ARGV) { | |||||||||||||
| 23 | 1 | ▶ | print HTTP::PublicKeyPins::pin_sha256($path) . "\n" | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 24 | or Carp::croak("Failed to print to STDOUT:$EXTENDED_OS_ERROR"); | ||||||||||||||
| 25 | } | ||||||||||||||
| 26 | } | ||||||||||||||
| 27 | |||||||||||||||
| 28 | 0 | ▶ | sub usage { | ||||||||||||
|
Subroutine
usage: not called CC=2 SCAR=17.9
| |||||||||||||||
| 29 | 0 | ▶ | |||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 30 | <<"__USAGE__" or Carp::croak("Failed to print to STDOUT:$EXTENDED_OS_ERROR"); | ||||||||||||||
| 31 | Usage: $PROGRAM_NAME [--help] [--version] path_to_(certificate|certificate_request|public_key) | ||||||||||||||
| 32 | |||||||||||||||
| 33 | __USAGE__ | ||||||||||||||
| 34 | 0 | return; | |||||||||||||
| 35 | } | ||||||||||||||
| 36 | __DATA__ | ||||||||||||||