line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::DKIM::ARC::MessageSignature; |
2
|
3
|
|
|
3
|
|
20
|
use strict; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
87
|
|
3
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
140
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.20230212'; # 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
|
|
19
|
use base 'Mail::DKIM::Signature'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
1638
|
|
14
|
3
|
|
|
3
|
|
25
|
use Carp; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
4686
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
386
|
|
|
386
|
1
|
620
|
my $class = shift; |
19
|
386
|
|
|
|
|
867
|
my %prms = @_; |
20
|
386
|
|
|
|
|
680
|
my $self = {}; |
21
|
386
|
|
|
|
|
720
|
bless $self, $class; |
22
|
|
|
|
|
|
|
|
23
|
386
|
100
|
|
|
|
878
|
$self->instance( $prms{'Instance'} ) if exists $prms{'Instance'}; |
24
|
386
|
|
100
|
|
|
1827
|
$self->algorithm( $prms{'Algorithm'} || 'rsa-sha256' ); |
25
|
386
|
|
|
|
|
1434
|
$self->signature( $prms{'Signature'} ); |
26
|
386
|
100
|
|
|
|
1130
|
$self->canonicalization( $prms{'Method'} ) if exists $prms{'Method'}; |
27
|
386
|
|
|
|
|
1330
|
$self->domain( $prms{'Domain'} ); |
28
|
386
|
|
|
|
|
1601
|
$self->headerlist( $prms{'Headers'} ); |
29
|
386
|
50
|
|
|
|
992
|
$self->protocol( $prms{'Query'} ) if exists $prms{'Query'}; |
30
|
386
|
|
|
|
|
1351
|
$self->selector( $prms{'Selector'} ); |
31
|
386
|
100
|
|
|
|
1002
|
$self->timestamp( $prms{'Timestamp'} ) if defined $prms{'Timestamp'}; |
32
|
386
|
50
|
|
|
|
813
|
$self->expiration( $prms{'Expiration'} ) if defined $prms{'Expiration'}; |
33
|
386
|
100
|
|
|
|
746
|
$self->key( $prms{'Key'} ) if defined $prms{'Key'}; |
34
|
|
|
|
|
|
|
|
35
|
386
|
|
|
|
|
974
|
return $self; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub DEFAULT_PREFIX { |
39
|
443
|
|
|
443
|
0
|
1151
|
return 'ARC-Message-Signature:'; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub instance { |
44
|
756
|
|
|
756
|
1
|
1166
|
my $self = shift; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# ARC identities must be a number |
47
|
756
|
100
|
|
|
|
1486
|
if (@_) { |
48
|
38
|
|
|
|
|
101
|
my $val = int(shift); |
49
|
38
|
50
|
33
|
|
|
156
|
die "INVALID instance $val" unless ( $val > 0 and $val < 1025 ); |
50
|
38
|
|
|
|
|
139
|
$self->set_tag( 'i', $val ); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
756
|
|
|
|
|
1713
|
my $i = $self->get_tag('i'); |
54
|
756
|
|
|
|
|
2667
|
return $i; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
__END__ |