GnuPG::Fingerprint - GnuPG Fingerprint Objects


GnuPG-Interface documentation Contained in the GnuPG-Interface distribution.

Index


Code Index:

NAME

Top

GnuPG::Fingerprint - GnuPG Fingerprint Objects

SYNOPSIS

Top

  # assumes a GnuPG::Key in $key
  my $fingerprint = $key->fingerprint->as_hex_string();

DESCRIPTION

Top

GnuPG::Fingerprint objects are generally part of GnuPG::Key objects, and are not created on their own.

OBJECT METHODS

Top

Initialization Methods

new( %initialization_args )

This methods creates a new object. The optional arguments are initialization of data members.

hash_init( %args ).
compare( $other )

Returns non-zero only when this fingerprint is identical to the other GnuPG::Fingerprint.

OBJECT DATA MEMBERS

Top

as_hex_string

This is the hex value of the fingerprint that the object embodies, in string format.

SEE ALSO

Top

GnuPG::Key,


GnuPG-Interface documentation Contained in the GnuPG-Interface distribution.

#  Fingerprint.pm
#    - providing an object-oriented approach to GnuPG key fingerprints
#
#  Copyright (C) 2000 Frank J. Tobin <ftobin@cpan.org>
#
#  This module is free software; you can redistribute it and/or modify it
#  under the same terms as Perl itself.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
#  $Id: Fingerprint.pm,v 1.8 2001/08/21 13:31:50 ftobin Exp $
#

package GnuPG::Fingerprint;
use Any::Moose;
with qw(GnuPG::HashInit);

has as_hex_string => (
    isa => 'Any',
    is  => 'rw',        
);

sub compare {
  my ($self, $other) = @_;
  return 0 unless $other->isa('GnuPG::Fingerprint');
  return $self->as_hex_string() eq $other->as_hex_string();
}

# DEPRECATED
sub hex_data
{
    my ( $self, $v ) = @_;
    $self->as_hex_string( $v ) if defined $v;
    return $self->as_hex_string();
}

__PACKAGE__->meta->make_immutable;

1;

__END__