<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package PGP::Constants;

use strict;
use vars qw(%pkalg %hashalg @ISA @EXPORT_OK);

use Exporter;

@ISA = qw(Exporter);
@EXPORT_OK = qw(PKALG_RSA PKALG_RSA_ENC PKALG_RSA_SIG PKALG_ELGAMAL
		PKALG_DH PKALG_DSA PKALG_DSS
		HASHALG_MD5 HASHALG_SHA1 HASHALG_RIPEMD160 HASHALG_MD2);

use constant PKALG_RSA =&gt; 1;
use constant PKALG_RSA_ENC =&gt; 2;
use constant PKALG_RSA_SIG =&gt; 3;
use constant PKALG_ELGAMAL =&gt; 16;
use constant PKALG_DH =&gt; 16;
use constant PKALG_DSA =&gt; 17;
use constant PKALG_DSS =&gt; 17;

use constant HASHALG_MD5 =&gt; 1;
use constant HASHALG_SHA1 =&gt; 2;
use constant HASHALG_RIPEMD160 =&gt; 3;
use constant HASHALG_MD2 =&gt; 5;

# XXX BEGIN { ... };

%pkalg = (&amp;PKALG_RSA =&gt; "RSA",
	  &amp;PKALG_RSA_ENC =&gt; "RSA Encrypt-Only",
	  &amp;PKALG_RSA_SIG =&gt; "RSA Sign-Only",
	  &amp;PKALG_ELGAMAL =&gt; "Diffie-Hellman", # Elgamal in rfc2440
	  &amp;PKALG_DSA =&gt; "DSS");

%hashalg = (&amp;HASHALG_MD5 =&gt; "MD5",
	    &amp;HASHALG_SHA1 =&gt; "SHA1",
	    &amp;HASHALG_RIPEMD160 =&gt; "RIPEMD160",
	    &amp;HASHALG_MD2 =&gt; "MD2");
		
sub pkalgstr {
    my ($algnum) = @_;

    $pkalg{$algnum} || "PK Alg #$algnum";
}

sub hashalgstr {
    my ($algnum) = @_;

    $hashalg{$algnum} || "Hash Alg #$algnum";
}

1;
</pre></body></html>