my $sig = parse Mail::DKIM::DkSignature( "DomainKey-Signature: a=rsa-sha1; b=yluiJ7+0=; c=nofws" );
Constructs a signature by parsing the provided DomainKey-Signature header content. You do not have to include the header name (i.e. ``DomainKey-Signature:'') but it is recommended, so the header name can be preserved and returned the same way in as_string().
Note: The input to this constructor is in the same format as the output of the as_string method.
print $signature->as_string . "\n";
DomainKey-Signature: a=rsa-sha1; b=yluiJ7+0=; c=nofws
As shown in the example, the as_string method can be used to generate the DomainKey-Signature that gets prepended to a signed message.
$signature->canonicalization("nofws"); $signature->canonicalization("simple"); $method = $signature->canonicalization;
Message canonicalization (default is ``simple''). This informs the verifier of the type of canonicalization used to prepare the message for signing.
my $d = $signature->domain; # gets the domain value $signature->domain("example.org"); # sets the domain value
The domain of the signing entity, as specified in the signature. This is the domain that will be queried for the public key.
$signature->headerlist("a:b:c"); my $headerlist = $signature->headerlist; my @headers = $signature->headerlist;
Signed header fields. A colon-separated list of header field names that identify the header fields presented to the signing algorithm.
In scalar context, the list of header field names will be returned as a single string, with the names joined together with colons. In list context, the header field names will be returned as a list.
my $i = $signature->identity;
In DomainKey signatures, the signing identity is the first address found in the Sender header or the From header. This field is populated by the Verifier when processing a DomainKey signature.
my $source = $signature->identity_source;
If the message is being verified, this method will tell you which of the message headers was used to determine the signature identity. Possible values are ``header.sender'' and ``header.from''.
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.