1Mail::DKIM::PrivateKey(U3s)er Contributed Perl DocumentatMiaoinl::DKIM::PrivateKey(3)
2
3
4

NAME

6       Mail::DKIM::PrivateKey - a private key loaded in memory for DKIM
7       signing
8

SYNOPSIS

10        my $key1 = Mail::DKIM::PrivateKey->load(
11                      File => "/path/to/private.key");
12
13        my $key2 = Mail::DKIM::PrivateKey->load(
14                      Data => $base64);
15
16        # use the loaded key in a DKIM signing object
17        my $dkim = Mail::DKIM::Signer->new(
18                      Key => $key2,
19                    );
20

CONSTRUCTOR

22   load() - loads a private key into memory
23        my $key1 = Mail::DKIM::PrivateKey->load(
24                      File => "/path/to/private.key");
25
26       Loads the Base64-encoded key from the specified file.
27
28         my $key2 = Mail::DKIM::PrivateKey->load(Data => $base64);
29
30       Loads the Base64-encoded key from a string already in memory.
31
32         my $key3 = Mail::DKIM::PrivateKey->load(Cork => $openssl_object);
33
34       Creates a Mail::DKIM::PrivateKey wrapper object for the given OpenSSL
35       key object. The key object should be of type Crypt::OpenSSL::RSA.
36

METHODS

38   cork() - access the underlying OpenSSL key object
39         $openssl_object = $key->cork;
40
41       The returned object is of type Crypt::OpenSSL::RSA.
42
43   sign_digest()
44       Cryptographically sign the given message digest.
45
46         $key->sign_digest("SHA-1", sha1("my message text"));
47
48       The first parameter is the name of the digest: one of "SHA-1",
49       "SHA-256".
50
51       The second parameter is the message digest as a binary string.
52
53       The result should be the signed digest as a binary string.
54

AUTHOR

56       Jason Long, <jlong@messiah.edu>
57
59       Copyright (C) 2006-2008 by Messiah College
60
61       This library is free software; you can redistribute it and/or modify it
62       under the same terms as Perl itself, either Perl version 5.8.6 or, at
63       your option, any later version of Perl 5 you may have available.
64
65
66
67perl v5.12.2                      2010-11-14         Mail::DKIM::PrivateKey(3)
Impressum