~ubuntu-branches/ubuntu/precise/libmail-dkim-perl/precise

« back to all changes in this revision

Viewing changes to lib/Mail/DKIM/Signature.pm

  • Committer: Bazaar Package Importer
  • Author(s): Magnus Holmgren
  • Date: 2007-05-12 10:17:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070512101726-fv40ncfybukc1kh1
Tags: 0.25-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
623
623
 
624
624
*signature = \*data;
625
625
 
 
626
=head2 prettify() - alters the signature to look "nicer" as an email header
 
627
 
 
628
  $signature->prettify;
 
629
 
 
630
This method may alter the signature in a way that breaks signatures, so
 
631
it should be done ONLY when the signature is being generated, BEFORE being
 
632
fed to the canonicalization algorithm.
 
633
 
 
634
=cut
 
635
 
 
636
sub prettify
 
637
{
 
638
        my $self = shift;
 
639
        $self->wrap(
 
640
                Start => length($self->{prefix} || "DKIM-Signature:"),
 
641
                Tags => {
 
642
                        b => "b64",
 
643
                        bh => "b64",
 
644
                        h => "list",
 
645
                        },
 
646
                );
 
647
}
 
648
 
 
649
=head2 prettify_safe() - same as prettify() but only touches the b= part
 
650
 
 
651
  $signature->prettify_safe;
 
652
 
 
653
This method will not break the signature, but it only affects the b= part
 
654
of the signature.
 
655
 
 
656
=cut
 
657
 
 
658
sub prettify_safe
 
659
{
 
660
        my $self = shift;
 
661
        $self->wrap(
 
662
                Start => length($self->{prefix} || "DKIM-Signature:"),
 
663
                Tags => {
 
664
                        b => "b64",
 
665
                        },
 
666
                PreserveNames => 1,
 
667
                Default => "preserve", #preserves unknown tags
 
668
                );
 
669
}
 
670
 
626
671
=head2 timestamp() - get or set the signature timestamp (t=) field
627
672
 
628
673
Signature timestamp (default is undef, meaning unknown creation time).