File Coverage

blib/lib/GnuPG/SubKey.pm
Criterion Covered Total %
statement 10 21 47.6
branch 0 4 0.0
path n/a
condition n/a
subroutine 4 5 80.0
pod 1 1 100.0
total 15 31 48.3


line stmt bran path cond sub pod time code
1               # SubKey.pm
2               # - providing an object-oriented approach to GnuPG sub keys
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: SubKey.pm,v 1.9 2001/09/14 12:34:36 ftobin Exp $
14               #
15                
16               package GnuPG::SubKey;
17 6       6   1566 use Carp;
  6           32  
  6           884  
18 6       6   48 use Moo;
  6           12  
  6           49  
19 6       6   2409 use MooX::late;
  6           40  
  6           119  
20 6       6   2113 BEGIN { extends qw( GnuPG::Key ) }
21                
22               has [qw( validity owner_trust local_id )] => (
23               isa => 'Any',
24               is => 'rw',
25               );
26                
27               # DEPRECATED!
28               # return the last signature, if present. Or push in a new signature,
29               # if one is supplied.
30               sub signature {
31 0       0 1   my $self = shift;
32 0             my $argcount = @_;
33                
34 0 0           if ($argcount) {
35 0             @{$self->signatures} = ();
  0              
36 0             $self->push_signatures(@_);
37               } else {
38 0             my $sigcount = @{$self->signatures};
  0              
39 0 0           if ($sigcount) {
40 0             return $self->signatures->[$sigcount-1];
41               } else {
42 0             return undef;
43               }
44               }
45               }
46                
47               1;
48                
49               __END__
50                
51               =head1 NAME
52                
53               GnuPG::SubKey - GnuPG Sub Key objects
54                
55               =head1 SYNOPSIS
56                
57               # assumes a GnuPG::PublicKey object in $key
58               my @subkeys = $key->subkeys();
59                
60               # now GnuPG::SubKey objects are in @subkeys
61                
62               =head1 DESCRIPTION
63                
64               GnuPG::SubKey objects are generally instantiated
65               through various methods of GnuPG::Interface.
66               They embody various aspects of a GnuPG sub key.
67                
68               This package inherits data members and object methods
69               from GnuPG::Key, which are not described here, but rather
70               in L<GnuPG::Key>.
71                
72               =head1 OBJECT DATA MEMBERS
73                
74               =over 4
75                
76               =item validity
77                
78               A scalar holding the value GnuPG reports for the trust of authenticity
79               (a.k.a.) validity of a key.
80               See GnuPG's DETAILS file for details.
81                
82               =item local_id
83                
84               GnuPG's local id for the key.
85                
86               =item owner_trust
87                
88               The scalar value GnuPG reports as the ownertrust for this key.
89               See GnuPG's DETAILS file for details.
90                
91               =item signature
92                
93               * DEPRECATED*
94                
95               A GnuPG::Signature object holding the representation of the signature
96               on this key. Please use signatures (see L<GnuPG::Key>) instead of
97               signature. Using signature, you will get an arbitrary signature from
98               the set of available signatures.
99                
100               =back
101                
102               =head1 SEE ALSO
103                
104               L<GnuPG::Key>,
105               L<GnuPG::Signature>,
106                
107               =cut