1Mail::DKIM::Algorithm::UBsaesre(C3o)ntributed Perl DocumMeanitla:t:iDoKnIM::Algorithm::Base(3)
2
3
4

NAME

6       Mail::DKIM::Algorithm::Base - base class for DKIM "algorithms"
7

VERSION

9       version 1.20200907
10

SYNOPSIS

12         my $algorithm = new Mail::DKIM::Algorithm::rsa_sha1(
13                             Signature => $dkim_signature
14                         );
15
16         # add headers
17         $algorithm->add_header("Subject: this is the subject\015\012");
18         $algorithm->finish_header;
19
20         # add body
21         $algorithm->add_body("This is the body.\015\012");
22         $algorithm->add_body("Another line of the body.\015\012");
23         $algorithm->finish_body;
24
25         # now sign or verify...
26         # TODO...
27

CONSTRUCTOR

29       You should not create an object of this class directly. Instead, use
30       one of the DKIM algorithm implementation classes, such as rsa_sha1:
31
32         my $algorithm = new Mail::DKIM::Algorithm::rsa_sha1(
33                             Signature => $dkim_signature
34                         );
35

METHODS

37   add_body() - feeds part of the body into the algorithm/canonicalization
38         $algorithm->add_body("This is the body.\015\012");
39         $algorithm->add_body("Another line of the body.\015\012");
40
41       The body should be fed one "line" at a time.
42
43   add_header() - feeds a header field into the algorithm/canonicalization
44         $algorithm->add_header("Subject: this is the subject\015\012");
45
46       The header must start with the header field name and continue through
47       any folded lines (including the embedded <CRLF> sequences). It
48       terminates with the <CRLF> at the end of the header field.
49
50   finish_body() - signals the end of the message body
51         $algorithm->finish_body
52
53       Call this method when all lines from the body have been submitted.
54       After calling this method, use sign() or verify() to get the results
55       from the algorithm.
56
57   finish_header() - signals the end of the header field block
58         $algorithm->finish_header;
59
60       Call this method when all the headers have been submitted.
61
62   sign() - generates a signature using a private key
63         $base64 = $algorithm->sign($private_key);
64
65   signature() - get/set the signature worked on by this algorithm
66         my $old_signature = $algorithm->signature;
67         $algorithm->signature($new_signature);
68
69   verify() - verifies a signature
70         $result = $algorithm->verify();
71
72       Must be called after finish_body().
73
74       The result is a true/false value: true indicates the signature data is
75       valid, false indicates it is invalid.
76
77       For an invalid signature, details may be obtained from
78       $algorithm->{verification_details} or $@.
79

SEE ALSO

81       Mail::DKIM
82

AUTHORS

84       •   Jason Long <jason@long.name>
85
86       •   Marc Bradshaw <marc@marcbradshaw.net>
87
88       •   Bron Gondwana <brong@fastmailteam.com> (ARC)
89

THANKS

91       Work on ensuring that this module passes the ARC test suite was
92       generously sponsored by Valimail (https://www.valimail.com/)
93
95       •   Copyright (C) 2013 by Messiah College
96
97       •   Copyright (C) 2010 by Jason Long
98
99       •   Copyright (C) 2017 by Standcore LLC
100
101       •   Copyright (C) 2020 by FastMail Pty Ltd
102
103       This library is free software; you can redistribute it and/or modify it
104       under the same terms as Perl itself, either Perl version 5.8.6 or, at
105       your option, any later version of Perl 5 you may have available.
106
107
108
109perl v5.32.1                      2021-01-27    Mail::DKIM::Algorithm::Base(3)
Impressum