File: test_nowsp_rsa_sha1.pl

package info (click to toggle)
libmail-dkim-perl 0.19-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 308 kB
  • ctags: 180
  • sloc: perl: 2,370; makefile: 45
file content (28 lines) | stat: -rwxr-xr-x 508 bytes parent folder | download | duplicates (9)
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";