summaryrefslogtreecommitdiff
path: root/lib/GnuPG/SubKey.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/GnuPG/SubKey.pm')
-rw-r--r--lib/GnuPG/SubKey.pm31
1 files changed, 28 insertions, 3 deletions
diff --git a/lib/GnuPG/SubKey.pm b/lib/GnuPG/SubKey.pm
index 4866b1d..1e5f606 100644
--- a/lib/GnuPG/SubKey.pm
+++ b/lib/GnuPG/SubKey.pm
@@ -15,13 +15,34 @@
package GnuPG::SubKey;
use Any::Moose;
+use Carp;
BEGIN { extends qw( GnuPG::Key ) }
-has [qw( validity owner_trust local_id signature )] => (
+has [qw( validity owner_trust local_id )] => (
isa => 'Any',
is => 'rw',
);
+# DEPRECATED!
+# return the last signature, if present. Or push in a new signature,
+# if one is supplied.
+sub signature {
+ my $self = shift;
+ my $argcount = @_;
+
+ if ($argcount) {
+ @{$self->signatures} = ();
+ $self->push_signatures(@_);
+ } else {
+ my $sigcount = @{$self->signatures};
+ if ($sigcount) {
+ return $self->signatures->[$sigcount-1];
+ } else {
+ return undef;
+ }
+ }
+}
+
__PACKAGE__->meta->make_immutable;
1;
@@ -70,8 +91,12 @@ See GnuPG's DETAILS file for details.
=item signature
-A GnuPG::Signature object holding the representation of the
-signature on this key.
+* DEPRECATED*
+
+A GnuPG::Signature object holding the representation of the signature
+on this key. Please use signatures (see L<GnuPG::Key>) instead of
+signature. Using signature, you will get an arbitrary signature from
+the set of available signatures.
=back