File: test_nowsp_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 (28 lines) | stat: -rwxr-xr-x 508 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
23
24
25
26
27
28
#!/usr/bin/perl -I../../..

use strict;
use warnings;

use Mail::DKIM::Algorithm::rsa_sha1;
use Mail::DKIM::Canonicalization::nowsp;

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

tie *rsa_sha1, "Mail::DKIM::Algorithm::rsa_sha1",
				"KeyFile" => "private.key";
my $nowsp = new Mail::DKIM::Canonicalization::nowsp(
				output_fh => *rsa_sha1);

while (<STDIN>)
{
	chomp;
	$nowsp->PRINT("$_\015\012");
}
$nowsp->CLOSE;

my $rsa_sha1 = tied *rsa_sha1;
print $rsa_sha1->sign;
print "\n";