line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::DKIM::ARC::MessageSignature; |
2
|
3
|
|
|
3
|
|
23
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
91
|
|
3
|
3
|
|
|
3
|
|
17
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
141
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.20230630'; # VERSION |
5
|
|
|
|
|
|
|
# ABSTRACT: Subclass of Mail::DKIM::Signature which represents a ARC-Message-Signature header |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# Copyright 2017 FastMail Pty Ltd. All Rights Reserved. |
8
|
|
|
|
|
|
|
# Bron Gondwana |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or |
11
|
|
|
|
|
|
|
# modify it under the same terms as Perl itself. |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
21
|
use base 'Mail::DKIM::Signature'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
1550
|
|
14
|
3
|
|
|
3
|
|
22
|
use Carp; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
964
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
386
|
|
|
386
|
1
|
692
|
my $class = shift; |
19
|
386
|
|
|
|
|
812
|
my %prms = @_; |
20
|
386
|
|
|
|
|
697
|
my $self = {}; |
21
|
386
|
|
|
|
|
808
|
bless $self, $class; |
22
|
|
|
|
|
|
|
|
23
|
386
|
100
|
|
|
|
907
|
$self->instance( $prms{'Instance'} ) if exists $prms{'Instance'}; |
24
|
386
|
|
100
|
|
|
1756
|
$self->algorithm( $prms{'Algorithm'} || 'rsa-sha256' ); |
25
|
386
|
|
|
|
|
1439
|
$self->signature( $prms{'Signature'} ); |
26
|
386
|
100
|
|
|
|
1078
|
$self->canonicalization( $prms{'Method'} ) if exists $prms{'Method'}; |
27
|
386
|
|
|
|
|
1326
|
$self->domain( $prms{'Domain'} ); |
28
|
386
|
|
|
|
|
1414
|
$self->headerlist( $prms{'Headers'} ); |
29
|
386
|
50
|
|
|
|
991
|
$self->protocol( $prms{'Query'} ) if exists $prms{'Query'}; |
30
|
386
|
|
|
|
|
1304
|
$self->selector( $prms{'Selector'} ); |
31
|
386
|
100
|
|
|
|
969
|
$self->timestamp( $prms{'Timestamp'} ) if defined $prms{'Timestamp'}; |
32
|
386
|
50
|
|
|
|
806
|
$self->expiration( $prms{'Expiration'} ) if defined $prms{'Expiration'}; |
33
|
386
|
100
|
|
|
|
752
|
$self->key( $prms{'Key'} ) if defined $prms{'Key'}; |
34
|
|
|
|
|
|
|
|
35
|
386
|
|
|
|
|
984
|
return $self; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub DEFAULT_PREFIX { |
39
|
443
|
|
|
443
|
0
|
1132
|
return 'ARC-Message-Signature:'; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub instance { |
44
|
756
|
|
|
756
|
1
|
1197
|
my $self = shift; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# ARC identities must be a number |
47
|
756
|
100
|
|
|
|
1561
|
if (@_) { |
48
|
38
|
|
|
|
|
64
|
my $val = int(shift); |
49
|
38
|
50
|
33
|
|
|
163
|
die "INVALID instance $val" unless ( $val > 0 and $val < 1025 ); |
50
|
38
|
|
|
|
|
142
|
$self->set_tag( 'i', $val ); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
756
|
|
|
|
|
1625
|
my $i = $self->get_tag('i'); |
54
|
756
|
|
|
|
|
2651
|
return $i; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__END__ |