1Net::SSH::Perl::Key::DSUAs(e3r)Contributed Perl DocumentNaetti:o:nSSH::Perl::Key::DSA(3)
2
3
4
6 Net::SSH::Perl::Key::DSA - DSA key object
7
9 use Net::SSH::Perl::Key;
10 my $key = Net::SSH::Perl::Key->new('DSA');
11
13 Net::SSH::Perl::Key::DSA subclasses Net::SSH::Perl::Key to implement a
14 key object, SSH style. This object provides all of the methods needed
15 for a DSA key object; the underlying implementation is provided by
16 Crypt::PK::DSA, and this class wraps around that module to provide SSH-
17 specific functionality (eg. taking in a Net::SSH::Perl::Buffer blob and
18 transforming it into a key object).
19
21 Net::SSH::Perl::Key::DSA implements the interface described in the
22 documentation for Net::SSH::Perl::Key. Any differences or additions are
23 described here.
24
25 $key->sign($data)
26 Wraps around Crypt::PK::DSA::sign_message to sign $data using the key
27 $key, then encodes that signature into an SSH-compatible signature
28 blob. The output of Crypt::PK::DSA::sign_message is a DER ASN.1 binary
29 structure, so that must be decoded to extract the components of the
30 signature.
31
32 Returns the signature blob.
33
34 $key->verify($signature, $data)
35 Given a signature blob $signature and the original signed data $data,
36 attempts to verify the signature using the key $key. This wraps around
37 Crypt::PK::DSA::verify_message to perform the core verification. Since
38 Crypt::PK::DSA::verify_message requires a signature in DER ASN.1
39 format, the signature is reconfigured to that before being passed.
40
41 $signature should be an SSH-compatible signature blob, as returned from
42 sign; $data should be a string of data, as passed to sign.
43
44 Returns true if the verification succeeds, false otherwise.
45
47 Please see the Net::SSH::Perl manpage for author, copyright, and
48 license information.
49
50
51
52perl v5.28.0 2017-08-24 Net::SSH::Perl::Key::DSA(3)