summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Crypt/OpenPGP/Key/Secret.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Crypt/OpenPGP/Key/Secret.pm')
-rwxr-xr-xMaster/tlpkg/tlperl/lib/Crypt/OpenPGP/Key/Secret.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/Master/tlpkg/tlperl/lib/Crypt/OpenPGP/Key/Secret.pm b/Master/tlpkg/tlperl/lib/Crypt/OpenPGP/Key/Secret.pm
new file mode 100755
index 00000000000..3a93e9afe60
--- /dev/null
+++ b/Master/tlpkg/tlperl/lib/Crypt/OpenPGP/Key/Secret.pm
@@ -0,0 +1,21 @@
+package Crypt::OpenPGP::Key::Secret;
+use strict;
+
+use Crypt::OpenPGP::Key;
+use Crypt::OpenPGP::ErrorHandler;
+use base qw( Crypt::OpenPGP::Key Crypt::OpenPGP::ErrorHandler );
+
+sub is_secret { 1 }
+sub all_props { ($_[0]->public_props, $_[0]->secret_props) }
+
+sub public_key {
+ my $key = shift;
+ my @pub = $key->public_props;
+ my $pub = Crypt::OpenPGP::Key::Public->new($key->alg);
+ for my $e (@pub) {
+ $pub->$e($key->$e());
+ }
+ $pub;
+}
+
+1;