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 # canonicalization results get output to STDOUT
11 my $method = new Mail::DKIM::Canonicalization::relaxed(
12 output_fh => *STDOUT,
13 Signature => $dkim_signature);
14
15 # add headers
16 $method->add_header("Subject: this is the subject\015\012");
17 $method->finish_header(Headers => \@all_headers);
18
19 # add body
20 $method->add_body("This is the body.\015\012");
21 $method->add_body("Another two lines\015\012of the body.\015\012");
22 $method->finish_body;
23
24 # this adds the signature to the end
25 $method->finish_message;
26
28 Use the new() method of the desired canonicalization implementation
29 class to construct a canonicalization object. E.g.
30
31 my $method = new Mail::DKIM::Canonicalization::relaxed(
32 output_fh => *STDOUT,
33 Signature => $dkim_signature);
34
35 The constructors accept these arguments:
36
37 Signature
38 (Required) Provide the DKIM signature being constructed (if the
39 message is being signed), or the DKIM signature being verified (if
40 the message is being verified). The canonicalization method either
41 writes parameters to the signature, or reads parameters from the
42 signature (e.g. the h= tag).
43
44 output
45 If specified, the canonicalized message will be passed to this
46 object with the PRINT method.
47
48 output_digest
49 If specified, the canonicalized message will be added to this
50 digest. (Uses the add() method.)
51
52 output_fh
53 If specified, the canonicalized message will be written to this
54 file handle.
55
56 If none of the output parameters are specified, then the canonicalized
57 message is appended to an internal buffer. The contents of this buffer
58 can be accessed using the result() method.
59
61 add_body() - feeds part of the body into the canonicalization
62 $method->add_body("This is the body.\015\012");
63 $method->add_body("Another two lines\015\012of the body.\015\012");
64
65 The body should be fed one or more "lines" at a time. I.e. do not feed
66 part of a line.
67
68 finish_header() - called when the header has been completely parsed
69 $method->finish_header(Headers => \@all_headers);
70
71 Formerly the canonicalization object would only get the header data
72 through successive invocations of add_header(). However, that required
73 the canonicalization object to store a copy of the entire header so
74 that it could choose the order in which headers were fed to the digest
75 object. This is inefficient use of memory, since a message with many
76 signatures may use many canonicalization objects and each
77 canonicalization object has its own copy of the header.
78
79 The headers array is an array of one element per header field, with the
80 headers not processed/canonicalized in any way.
81
82 result()
83 my $result = $method->result;
84
85 If you did not specify an object or handle to send the output to, the
86 result of the canonicalization is stored in the canonicalization method
87 itself, and can be accessed using this method.
88
90 Mail::DKIM
91
93 Jason Long, <jlong@messiah.edu>
94
96 Copyright (C) 2006-2007 by Messiah College
97
98 This library is free software; you can redistribute it and/or modify it
99 under the same terms as Perl itself, either Perl version 5.8.6 or, at
100 your option, any later version of Perl 5 you may have available.
101
102
103
104perl v5.30.1 2020-01-M3a0il::DKIM::Canonicalization::Base(3)