line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::DKIM::ARC::MessageSignature; |
2
|
3
|
|
|
3
|
|
25
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
94
|
|
3
|
3
|
|
|
3
|
|
23
|
use warnings; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
146
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.20230911'; # 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
|
|
20
|
use base 'Mail::DKIM::Signature'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
1616
|
|
14
|
3
|
|
|
3
|
|
22
|
use Carp; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
980
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
386
|
|
|
386
|
1
|
664
|
my $class = shift; |
19
|
386
|
|
|
|
|
754
|
my %prms = @_; |
20
|
386
|
|
|
|
|
690
|
my $self = {}; |
21
|
386
|
|
|
|
|
733
|
bless $self, $class; |
22
|
|
|
|
|
|
|
|
23
|
386
|
100
|
|
|
|
915
|
$self->instance( $prms{'Instance'} ) if exists $prms{'Instance'}; |
24
|
386
|
|
100
|
|
|
1795
|
$self->algorithm( $prms{'Algorithm'} || 'rsa-sha256' ); |
25
|
386
|
|
|
|
|
1499
|
$self->signature( $prms{'Signature'} ); |
26
|
386
|
100
|
|
|
|
1021
|
$self->canonicalization( $prms{'Method'} ) if exists $prms{'Method'}; |
27
|
386
|
|
|
|
|
1365
|
$self->domain( $prms{'Domain'} ); |
28
|
386
|
|
|
|
|
1501
|
$self->headerlist( $prms{'Headers'} ); |
29
|
386
|
50
|
|
|
|
881
|
$self->protocol( $prms{'Query'} ) if exists $prms{'Query'}; |
30
|
386
|
|
|
|
|
1438
|
$self->selector( $prms{'Selector'} ); |
31
|
386
|
100
|
|
|
|
1025
|
$self->timestamp( $prms{'Timestamp'} ) if defined $prms{'Timestamp'}; |
32
|
386
|
50
|
|
|
|
756
|
$self->expiration( $prms{'Expiration'} ) if defined $prms{'Expiration'}; |
33
|
386
|
50
|
|
|
|
1079
|
$self->tags( $prms{'Tags'} ) if defined $prms{'Tags'}; |
34
|
386
|
100
|
|
|
|
791
|
$self->key( $prms{'Key'} ) if defined $prms{'Key'}; |
35
|
|
|
|
|
|
|
|
36
|
386
|
|
|
|
|
1038
|
return $self; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub DEFAULT_PREFIX { |
40
|
443
|
|
|
443
|
0
|
1142
|
return 'ARC-Message-Signature:'; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub instance { |
45
|
756
|
|
|
756
|
1
|
1199
|
my $self = shift; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# ARC identities must be a number |
48
|
756
|
100
|
|
|
|
1551
|
if (@_) { |
49
|
38
|
|
|
|
|
75
|
my $val = int(shift); |
50
|
38
|
50
|
33
|
|
|
147
|
die "INVALID instance $val" unless ( $val > 0 and $val < 1025 ); |
51
|
38
|
|
|
|
|
158
|
$self->set_tag( 'i', $val ); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
756
|
|
|
|
|
1792
|
my $i = $self->get_tag('i'); |
55
|
756
|
|
|
|
|
2625
|
return $i; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |