1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
# Key.pm
# - providing an object-oriented approach to GnuPG keys
#
# 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: Key.pm,v 1.10 2001/12/10 01:29:27 ftobin Exp $
#
package GnuPG::Key;
use Any::Moose;
with qw(GnuPG::HashInit);
has [
qw( length
algo_num
hex_id
hex_data
creation_date_string
expiration_date_string
fingerprint
)
] => (
isa => 'Any',
is => 'rw',
);
sub short_hex_id {
my ($self) = @_;
return substr $self->hex_id(), -8;
}
__PACKAGE__->meta->make_immutable;
1;
__END__
=head1 NAME
GnuPG::Key - GnuPG Key Object
=head1 SYNOPSIS
# assumes a GnuPG::Interface object in $gnupg
my @keys = $gnupg->get_public_keys( 'ftobin' );
# now GnuPG::PublicKey objects are in @keys
=head1 DESCRIPTION
GnuPG::Key objects are generally not instantiated on their
own, but rather used as a superclass of GnuPG::PublicKey,
GnuPG::SecretKey, or GnuPG::SubKey objects.
=head1 OBJECT METHODS
=head2 Initialization Methods
=over 4
=item new( I<%initialization_args> )
This methods creates a new object. The optional arguments are
initialization of data members.
=item hash_init( I<%args> ).
=item short_hex_id
This returns the commonly-used short, 8 character short hex id
of the key.
=back
=head1 OBJECT DATA MEMBERS
=over 4
=item length
Number of bits in the key.
=item algo_num
They algorithm number that the Key is used for.
=item hex_data
The data of the key.
=item hex_id
The long hex id of the key. This is not the fingerprint nor
the short hex id, which is 8 hex characters.
=item creation_date_string
=item expiration_date_string
Formatted date of the key's creation and expiration.
=item fingerprint
A GnuPG::Fingerprint object.
=back
=head1 SEE ALSO
L<GnuPG::Fingerprint>,
=cut
|