Add "ssl" command
[dowkd.git] / gen / dev-openssl.pl
blob06712d4f12b2ef6ef8af94cfb291afe5ca056278
1 use strict;
2 use warnings;
4 while (my $line = <STDIN>) {
5 if ($line =~ /^Modulus=([0-9A-F]+)$/) {
6 my $mod = $1;
7 $mod = substr $mod, length($mod) - 32;
8 $mod =~ y/A-F/a-f/;
9 my @mod = $mod =~ /(..)/g;
10 print join('', reverse @mod) . "\n";
11 } else {
12 chomp $line;
13 warn "warning: unparsable line: $line\n";
17 __END__
18 # Old version, uses -text output
20 while (my $line = <STDIN>) {
21 last if $line =~ /^modulus:/;
24 my @bytes;
25 while (my $line = <STDIN>) {
26 last if $line !~ /^\s/;
27 chomp $line;
28 $line =~ s/^\s+//;
29 push @bytes, split m/:/, $line;
32 print join("", (reverse @bytes)[0..15]) . "\n";