File: test_bare_rsa_sha1.pl

package info (click to toggle)
libmail-dkim-perl 0.54-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 1,412 kB
  • sloc: perl: 5,855; makefile: 10
file content (22 lines) | stat: -rwxr-xr-x 348 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/perl -I../../..

use strict;
use warnings;

use Mail::DKIM::Algorithm::rsa_sha1;

unless (-f "private.key")
{
	die "File not found: private.key\n";
}

my $rsa_sha1 = new Mail::DKIM::Algorithm::rsa_sha1(
				KeyFile => "private.key");
while (<STDIN>)
{
	chomp;
	$rsa_sha1->PRINT("$_\015\012");
}
$rsa_sha1->CLOSE;

print $rsa_sha1->sign;