1Mail::DKIM::Algorithm::UBsaesre(C3o)ntributed Perl DocumMeanitla:t:iDoKnIM::Algorithm::Base(3)
2
3
4
6 Mail::DKIM::Algorithm::Base - base class for DKIM "algorithms"
7
9 my $algorithm = new Mail::DKIM::Algorithm::rsa_sha1(
10 Signature => $dkim_signature
11 );
12
13 # add headers
14 $algorithm->add_header("Subject: this is the subject\015\012");
15 $algorithm->finish_header;
16
17 # add body
18 $algorithm->add_body("This is the body.\015\012");
19 $algorithm->add_body("Another line of the body.\015\012");
20 $algorithm->finish_body;
21
22 # now sign or verify...
23 # TODO...
24
26 You should not create an object of this class directly. Instead, use
27 one of the DKIM algorithm implementation classes, such as rsa_sha1:
28
29 my $algorithm = new Mail::DKIM::Algorithm::rsa_sha1(
30 Signature => $dkim_signature
31 );
32
34 add_body() - feeds part of the body into the algorithm/canonicalization
35 $algorithm->add_body("This is the body.\015\012");
36 $algorithm->add_body("Another line of the body.\015\012");
37
38 The body should be fed one "line" at a time.
39
40 add_header() - feeds a header field into the algorithm/canonicalization
41 $algorithm->add_header("Subject: this is the subject\015\012");
42
43 The header must start with the header field name and continue through
44 any folded lines (including the embedded <CRLF> sequences). It
45 terminates with the <CRLF> at the end of the header field.
46
47 finish_body() - signals the end of the message body
48 $algorithm->finish_body
49
50 Call this method when all lines from the body have been submitted.
51 After calling this method, use sign() or verify() to get the results
52 from the algorithm.
53
54 finish_header() - signals the end of the header field block
55 $algorithm->finish_header;
56
57 Call this method when all the headers have been submitted.
58
59 sign() - generates a signature using a private key
60 $base64 = $algorithm->sign($private_key);
61
62 signature() - get/set the signature worked on by this algorithm
63 my $old_signature = $algorithm->signature;
64 $algorithm->signature($new_signature);
65
66 verify() - verifies a signature
67 $result = $algorithm->verify();
68
69 Must be called after finish_body().
70
71 The result is a true/false value: true indicates the signature data is
72 valid, false indicates it is invalid.
73
74 For an invalid signature, details may be obtained from
75 $algorithm->{verification_details} or $@.
76
78 Mail::DKIM
79
81 Jason Long, <jlong@messiah.edu>
82
84 Copyright (C) 2005-2007 by Messiah College
85
86 This library is free software; you can redistribute it and/or modify it
87 under the same terms as Perl itself, either Perl version 5.8.6 or, at
88 your option, any later version of Perl 5 you may have available.
89
90
91
92perl v5.28.0 2017-12-16 Mail::DKIM::Algorithm::Base(3)