| 1 | package Mail::DKIM::ARC::Seal; | ||||||||||||
| 2 | 6 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 6 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 6 | our $VERSION = '1.20261116'; # VERSION | |||||||||||
| 5 | # ABSTRACT: represents a ARC-Seal header | ||||||||||||
| 6 | |||||||||||||
| 7 | # Copyright 2017 FastMail Pty Ltd. All Rights Reserved. | ||||||||||||
| 8 | # Bron Gondwana <brong@fastmailteam.com> | ||||||||||||
| 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 | 6 | ▶ | use base 'Mail::DKIM::ARC::MessageSignature'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 14 | |||||||||||||
| 15 | |||||||||||||
| 16 | 584 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=9 SCAR=22.0
Pod
documented
| |||||||||||||
| 17 | 584 | my $class = shift; | |||||||||||
| 18 | 584 | my %prms = @_; | |||||||||||
| 19 | 584 | my $self = {}; | |||||||||||
| 20 | 584 | bless $self, $class; | |||||||||||
| 21 | |||||||||||||
| 22 | 584 | ▶ | $self->instance( $prms{'Instance'} ) if exists $prms{'Instance'}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 23 | 584 | ▶ | $self->algorithm( $prms{'Algorithm'} || 'rsa-sha256' ); | ||||||||||
|
Condition100%2/2
$prms{'Algorithm'} || 'rsa-sha256'
MC/DC100%1/1
$prms{'Algorithm'} || 'rsa-sha256'
$prms{'Algorithm'}
Truth table100%2/2
A
A= $prms{'Algorithm'}
| |||||||||||||
| 24 | 584 | $self->signature( $prms{'Signature'} ); | |||||||||||
| 25 | 584 | ▶ | $self->canonicalization( $prms{'Method'} ) if exists $prms{'Method'}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 26 | 584 | ▶ | $self->chain( $prms{'Chain'} || 'none' ); | ||||||||||
|
Condition100%2/2
$prms{'Chain'} || 'none'
MC/DC100%1/1
$prms{'Chain'} || 'none'
$prms{'Chain'}
Truth table100%2/2
A
A= $prms{'Chain'}
| |||||||||||||
| 27 | 584 | $self->domain( $prms{'Domain'} ); | |||||||||||
| 28 | 584 | $self->selector( $prms{'Selector'} ); | |||||||||||
| 29 | $self->timestamp( | ||||||||||||
| 30 | 584 | ▶ | defined $prms{'Timestamp'} ? $prms{'Timestamp'} : time() ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 31 | 584 | ▶ | $self->expiration( $prms{'Expiration'} ) if defined $prms{'Expiration'}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 32 | 584 | ▶ | $self->tags( $prms{'Tags'} ) if defined $prms{'Tags'}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 33 | 584 | ▶ | $self->key( $prms{'Key'} ) if defined $prms{'Key'}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 34 | |||||||||||||
| 35 | 584 | return $self; | |||||||||||
| 36 | } | ||||||||||||
| 37 | |||||||||||||
| 38 | 135 | ▶ | sub body_hash { | ||||||||||
|
Subroutine
body_hash: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 39 | |||||||||||||
| 40 | # Not defined for ARC-Seal | ||||||||||||
| 41 | 135 | return; | |||||||||||
| 42 | } | ||||||||||||
| 43 | |||||||||||||
| 44 | 647 | ▶ | sub DEFAULT_PREFIX { | ||||||||||
|
Subroutine
DEFAULT_PREFIX: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 45 | 647 | return 'ARC-Seal:'; | |||||||||||
| 46 | } | ||||||||||||
| 47 | |||||||||||||
| 48 | |||||||||||||
| 49 | 585 | ▶ | sub chain { | ||||||||||
|
Subroutine
chain: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||
| 50 | 585 | my $self = shift; | |||||||||||
| 51 | 585 | ▶ | if (@_) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 52 | 584 | my $cv = shift; | |||||||||||
| 53 | die "INVALID chain value $cv" | ||||||||||||
| 54 | 584 | ▶ | unless grep { $cv eq $_ } qw(none fail pass); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 55 | 584 | $self->set_tag( 'cv', $cv ); | |||||||||||
| 56 | } | ||||||||||||
| 57 | 585 | return $self->get_tag('cv'); | |||||||||||
| 58 | } | ||||||||||||
| 59 | |||||||||||||
| 60 | |||||||||||||
| 61 | 541 | ▶ | sub canonicalization { | ||||||||||
|
Subroutine
canonicalization: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 62 | 541 | return ( 'seal', 'seal' ); | |||||||||||
| 63 | } | ||||||||||||
| 64 | |||||||||||||
| 65 | |||||||||||||
| 66 | 6 | 1; | |||||||||||
| 67 | |||||||||||||
| 68 | __END__ | ||||||||||||