.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Mail::DKIM::PrivateKey 3pm" .TH Mail::DKIM::PrivateKey 3pm 2024-01-28 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Mail::DKIM::PrivateKey \- a private key loaded in memory for DKIM signing .SH VERSION .IX Header "VERSION" version 1.20240124 .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& my $key1 = Mail::DKIM::PrivateKey\->load( \& File => \*(Aq/path/to/private.key\*(Aq); \& \& my $key2 = Mail::DKIM::PrivateKey\->load( \& Data => $base64); \& \& # use the loaded key in a DKIM signing object \& my $dkim = Mail::DKIM::Signer\->new( \& Key => $key2, \& ); .Ve .SH CONSTRUCTOR .IX Header "CONSTRUCTOR" .SS "\fBload()\fP \- loads a private key into memory" .IX Subsection "load() - loads a private key into memory" .Vb 2 \& my $key1 = Mail::DKIM::PrivateKey\->load( \& File => \*(Aq/path/to/private.key\*(Aq); .Ve .PP Loads the Base64\-encoded key from the specified file. .PP .Vb 1 \& my $key2 = Mail::DKIM::PrivateKey\->load(Data => $base64); .Ve .PP Loads the Base64\-encoded key from a string already in memory. .PP .Vb 1 \& my $key3 = Mail::DKIM::PrivateKey\->load(Cork => $openssl_object); .Ve .PP Creates a Mail::DKIM::PrivateKey wrapper object for the given OpenSSL key object. The key object should be of type Crypt::OpenSSL::RSA. .SH METHODS .IX Header "METHODS" .SS "\fBcork()\fP \- access the underlying OpenSSL key object" .IX Subsection "cork() - access the underlying OpenSSL key object" .Vb 1 \& $openssl_object = $key\->cork; .Ve .PP The returned object is of type Crypt::OpenSSL::RSA. .SS \fBsign_digest()\fP .IX Subsection "sign_digest()" Cryptographically sign the given message digest. .PP .Vb 1 \& $key\->sign_digest(\*(AqSHA\-1\*(Aq, sha1(\*(Aqmy message text\*(Aq)); .Ve .PP The first parameter is the name of the digest: one of "SHA\-1", "SHA\-256". .PP The second parameter is the message digest as a binary string. .PP The result should be the signed digest as a binary string. .PP 1; .SH AUTHORS .IX Header "AUTHORS" .IP \(bu 4 Jason Long .IP \(bu 4 Marc Bradshaw .IP \(bu 4 Bron Gondwana (ARC) .SH THANKS .IX Header "THANKS" Work on ensuring that this module passes the ARC test suite was generously sponsored by Valimail (https://www.valimail.com/) .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" .IP \(bu 4 Copyright (C) 2013 by Messiah College .IP \(bu 4 Copyright (C) 2010 by Jason Long .IP \(bu 4 Copyright (C) 2017 by Standcore LLC .IP \(bu 4 Copyright (C) 2020 by FastMail Pty Ltd .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.