1Mail::DKIM::CanonicalizUasteironC:o:nBtarsieb(u3t)ed PerMlaiDlo:c:uDmKeInMt:a:tCiaonnonicalization::Base(3)
2
3
4
6 Mail::DKIM::Canonicalization::Base - base class for canonicalization
7 methods
8
10 version 1.20200724
11
13 # canonicalization results get output to STDOUT
14 my $method = new Mail::DKIM::Canonicalization::relaxed(
15 output_fh => *STDOUT,
16 Signature => $dkim_signature);
17
18 # add headers
19 $method->add_header("Subject: this is the subject\015\012");
20 $method->finish_header(Headers => \@all_headers);
21
22 # add body
23 $method->add_body("This is the body.\015\012");
24 $method->add_body("Another two lines\015\012of the body.\015\012");
25 $method->finish_body;
26
27 # this adds the signature to the end
28 $method->finish_message;
29
31 Use the new() method of the desired canonicalization implementation
32 class to construct a canonicalization object. E.g.
33
34 my $method = new Mail::DKIM::Canonicalization::relaxed(
35 output_fh => *STDOUT,
36 Signature => $dkim_signature);
37
38 The constructors accept these arguments:
39
40 Signature
41 (Required) Provide the DKIM signature being constructed (if the
42 message is being signed), or the DKIM signature being verified (if
43 the message is being verified). The canonicalization method either
44 writes parameters to the signature, or reads parameters from the
45 signature (e.g. the h= tag).
46
47 output
48 If specified, the canonicalized message will be passed to this
49 object with the PRINT method.
50
51 output_digest
52 If specified, the canonicalized message will be added to this
53 digest. (Uses the add() method.)
54
55 output_fh
56 If specified, the canonicalized message will be written to this
57 file handle.
58
59 If none of the output parameters are specified, then the canonicalized
60 message is appended to an internal buffer. The contents of this buffer
61 can be accessed using the result() method.
62
64 add_body() - feeds part of the body into the canonicalization
65 $method->add_body("This is the body.\015\012");
66 $method->add_body("Another two lines\015\012of the body.\015\012");
67
68 The body should be fed one or more "lines" at a time. I.e. do not feed
69 part of a line.
70
71 finish_header() - called when the header has been completely parsed
72 $method->finish_header(Headers => \@all_headers);
73
74 Formerly the canonicalization object would only get the header data
75 through successive invocations of add_header(). However, that required
76 the canonicalization object to store a copy of the entire header so
77 that it could choose the order in which headers were fed to the digest
78 object. This is inefficient use of memory, since a message with many
79 signatures may use many canonicalization objects and each
80 canonicalization object has its own copy of the header.
81
82 The headers array is an array of one element per header field, with the
83 headers not processed/canonicalized in any way.
84
85 result()
86 my $result = $method->result;
87
88 If you did not specify an object or handle to send the output to, the
89 result of the canonicalization is stored in the canonicalization method
90 itself, and can be accessed using this method.
91
93 Mail::DKIM
94
96 · Jason Long <jason@long.name>
97
98 · Marc Bradshaw <marc@marcbradshaw.net>
99
100 · Bron Gondwana <brong@fastmailteam.com> (ARC)
101
103 Work on ensuring that this module passes the ARC test suite was
104 generously sponsored by Valimail (https://www.valimail.com/)
105
107 · Copyright (C) 2013 by Messiah College
108
109 · Copyright (C) 2010 by Jason Long
110
111 · Copyright (C) 2017 by Standcore LLC
112
113 · Copyright (C) 2020 by FastMail Pty Ltd
114
115 This library is free software; you can redistribute it and/or modify it
116 under the same terms as Perl itself, either Perl version 5.8.6 or, at
117 your option, any later version of Perl 5 you may have available.
118
119
120
121perl v5.32.0 2020-07-M2a8il::DKIM::Canonicalization::Base(3)