home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / perl5 / GnuPG / Fingerprint.pm next >
Encoding:
Perl POD Document  |  2010-05-10  |  1.8 KB  |  95 lines

  1. #  Fingerprint.pm
  2. #    - providing an object-oriented approach to GnuPG key fingerprints
  3. #
  4. #  Copyright (C) 2000 Frank J. Tobin <ftobin@cpan.org>
  5. #
  6. #  This module is free software; you can redistribute it and/or modify it
  7. #  under the same terms as Perl itself.
  8. #
  9. #  This program is distributed in the hope that it will be useful,
  10. #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. #
  13. #  $Id: Fingerprint.pm,v 1.8 2001/08/21 13:31:50 ftobin Exp $
  14. #
  15.  
  16. package GnuPG::Fingerprint;
  17. use Any::Moose;
  18. with qw(GnuPG::HashInit);
  19.  
  20. has as_hex_string => (
  21.     isa => 'Any',
  22.     is  => 'rw',        
  23. );
  24.  
  25. sub compare {
  26.   my ($self, $other) = @_;
  27.   return 0 unless $other->isa('GnuPG::Fingerprint');
  28.   return $self->as_hex_string() eq $other->as_hex_string();
  29. }
  30.  
  31. # DEPRECATED
  32. sub hex_data
  33. {
  34.     my ( $self, $v ) = @_;
  35.     $self->as_hex_string( $v ) if defined $v;
  36.     return $self->as_hex_string();
  37. }
  38.  
  39. __PACKAGE__->meta->make_immutable;
  40.  
  41. 1;
  42.  
  43. __END__
  44.  
  45. =head1 NAME
  46.  
  47. GnuPG::Fingerprint - GnuPG Fingerprint Objects
  48.  
  49. =head1 SYNOPSIS
  50.  
  51.   # assumes a GnuPG::Key in $key
  52.   my $fingerprint = $key->fingerprint->as_hex_string();
  53.  
  54. =head1 DESCRIPTION
  55.  
  56. GnuPG::Fingerprint objects are generally part of GnuPG::Key
  57. objects, and are not created on their own.
  58.  
  59. =head1 OBJECT METHODS
  60.  
  61. =head2 Initialization Methods
  62.  
  63. =over 4
  64.  
  65. =item new( I<%initialization_args> )
  66.  
  67. This methods creates a new object.  The optional arguments are
  68. initialization of data members.
  69.  
  70. =item hash_init( I<%args> ).
  71.  
  72. =item compare( I<$other> )
  73.  
  74. Returns non-zero only when this fingerprint is identical to the other
  75. GnuPG::Fingerprint.
  76.  
  77. =back
  78.  
  79. =head1 OBJECT DATA MEMBERS
  80.  
  81. =over 4
  82.  
  83. =item as_hex_string
  84.  
  85. This is the hex value of the fingerprint that the object embodies,
  86. in string format.
  87.  
  88. =back
  89.  
  90. =head1 SEE ALSO
  91.  
  92. L<GnuPG::Key>,
  93.  
  94. =cut
  95.