summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl.straw/lib/Crypt/OpenPGP/Key/Secret/DSA.pm
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2010-02-28 09:36:33 +0000
committerNorbert Preining <preining@logic.at>2010-02-28 09:36:33 +0000
commit5589232e99f0fa13868111280c5b64ce9dc25730 (patch)
tree28f2e6ff422108ac87934aff9c3fc5911963625c /Master/tlpkg/tlperl.straw/lib/Crypt/OpenPGP/Key/Secret/DSA.pm
parenta6f5de6eed80d66fbd23ceabda7edf22b8162236 (diff)
add a tlperl.straw directory for public inspection
git-svn-id: svn://tug.org/texlive/trunk@17235 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl.straw/lib/Crypt/OpenPGP/Key/Secret/DSA.pm')
-rwxr-xr-xMaster/tlpkg/tlperl.straw/lib/Crypt/OpenPGP/Key/Secret/DSA.pm39
1 files changed, 39 insertions, 0 deletions
diff --git a/Master/tlpkg/tlperl.straw/lib/Crypt/OpenPGP/Key/Secret/DSA.pm b/Master/tlpkg/tlperl.straw/lib/Crypt/OpenPGP/Key/Secret/DSA.pm
new file mode 100755
index 00000000000..cfb1bbec4c4
--- /dev/null
+++ b/Master/tlpkg/tlperl.straw/lib/Crypt/OpenPGP/Key/Secret/DSA.pm
@@ -0,0 +1,39 @@
+package Crypt::OpenPGP::Key::Secret::DSA;
+use strict;
+
+use Crypt::DSA::Key;
+use Crypt::OpenPGP::Key::Public::DSA;
+use Crypt::OpenPGP::Key::Secret;
+use Crypt::OpenPGP::ErrorHandler;
+use base qw( Crypt::OpenPGP::Key::Secret Crypt::OpenPGP::ErrorHandler );
+
+sub secret_props { qw( x ) }
+*sig_props = \&Crypt::OpenPGP::Key::Public::DSA::sig_props;
+*public_props = \&Crypt::OpenPGP::Key::Public::DSA::public_props;
+*size = \&Crypt::OpenPGP::Key::Public::DSA::size;
+*keygen = \&Crypt::OpenPGP::Key::Public::DSA::keygen;
+*can_sign = \&Crypt::OpenPGP::Key::Public::DSA::can_sign;
+
+sub init {
+ my $key = shift;
+ $key->{key_data} = shift || Crypt::DSA::Key->new;
+ $key;
+}
+
+sub y { $_[0]->{key_data}->pub_key(@_[1..$#_]) }
+sub x { $_[0]->{key_data}->priv_key(@_[1..$#_]) }
+
+sub sign {
+ my $key = shift;
+ my($dgst) = @_;
+ require Crypt::DSA;
+ my $dsa = Crypt::DSA->new;
+ my $sig = $dsa->sign(
+ Key => $key->{key_data},
+ Digest => $dgst,
+ );
+}
+
+*verify = \&Crypt::OpenPGP::Key::Public::DSA::verify;
+
+1;