Crypt::GPG is a Perl module that provides access to the functionality of the GnuPG (www.gnupg.org) encryption tool through an object oriented interface.
It provides methods for encryption, decryption, signing, signature verification, key generation, key certification, export and import. Key-server access is on the todo list.
This release of the module may create compatibility issues with previous versions. If you find any such problems, or any bugs or documentation errors, please do report them to crypt-gpg at neomailbox.com.
SYNOPSIS
use Crypt::GPG;
my $gpg = new Crypt::GPG;
$gpg->gpgbin('/usr/bin/gpg'); # The GnuPG executable.
$gpg->secretkey('0x2B59D29E'); # Set ID of default secret key.
$gpg->passphrase('just testing'); # Set passphrase.
# Sign a message:
my $sign = $gpg->sign('testing again');
# Encrypt a message:
my @encrypted = $gpg->encrypt ('top secret', 'test@bar.com');
# Get message info:
my @recipients = $gpg->msginfo($encrypted);
# Decrypt a message.
my ($plaintext, $signature) = $gpg->verify($encrypted);
# Key generation:
$status = $gpg->keygen
('Test', 'test@foo.com', 'ELG-E', 2048, 0, 'test passphrase');
print while (); close $status;
# Key database manipulation:
$gpg->addkey($key, @ids);
@keys = $gpg->keydb(@ids);
# Key manipulation:
$key = $keys[0];
$gpg->delkey($key);
$gpg->disablekey($key);
$gpg->enablekey($key);
$gpg->keypass($key, $oldpassphrase, $newpassphrase);
$keystring = $gpg->export($key);
Product's homepage
Requirements:
· Perl