GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Crypt::OpenPGP::Digest(3) User Contributed Perl Documentation Crypt::OpenPGP::Digest(3)

Crypt::OpenPGP::Digest - PGP message digest factory

    use Crypt::OpenPGP::Digest;

    my $alg = 'SHA1';
    my $dgst = Crypt::OpenPGP::Digest->new( $alg );
    my $data = 'foo bar';
    my $hashed_data = $dgst->hash($data);

Crypt::OpenPGP::Digest is a factory class for PGP message digest objects. All digest objects are subclasses of this class and share a common interface; when creating a new digest object, the object is blessed into the subclass to take on algorithm-specific functionality.

A Crypt::OpenPGP::Digest object wraps around a function reference providing the actual digest implementation (eg. Digest::MD::md5 for an MD5 digest). This allows all digest objects to share a common interface and a simple instantiation method.

Creates a new message digest object of type $digest; $digest can be either the name of a digest algorithm (in Crypt::OpenPGP parlance) or the numeric ID of the algorithm (as defined in the OpenPGP RFC). Using an algorithm name is recommended, for the simple reason that it is easier to understand quickly (not everyone knows the algorithm IDs).

Valid digest names are: "MD5", "SHA1", and "RIPEMD160".

Returns the new digest object on success. On failure returns "undef"; the caller should check for failure and call the class method errstr if a failure occurs. A typical reason this might happen is an unsupported digest name or ID.

Creates a message digest hash of the data $data, a string of octets, and returns the digest.

Returns the name of the digest algorithm (as listed above in new).

Returns the numeric ID of the digest algorithm.

Please see the Crypt::OpenPGP manpage for author, copyright, and license information.
2015-08-16 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.