Crypt-PGPSimple
view release on metacpan or search on metacpan
PGPSimple.pm view on Meta::CPAN
# PUBLIC METHODS
#_____________________________________________________________________________
sub Encrypt {
my ($this) = shift;
my ($return_value) = 0;
# generate the command line
my ($pgp_command) = $this->{'strPgpExePath'}
. " -feat +batchmode +force "
. $this->{'strPublicKey'};
$this->{'strEncryptedText'} = $this->DoPgpCommand($pgp_command,$this->{'strPlainText'});
# if there were results then everything went as planned
if ($this->{'strEncryptedText'} ne "") {
$return_value = 1;
}
return $return_value;
PGPSimple.pm view on Meta::CPAN
#_____________________________________________________________________________
sub Decrypt {
my ($this) = shift;
# assume fail
my ($return_value) = 0;
# generate the command line
my ($pgp_command) = $this->{'strPgpExePath'}
. " -f +batchmode +force";
$this->{'strPlainText'} = $this->DoPgpCommand($pgp_command,$this->{'strEncryptedText'});
# if there were results then everything went as planned
if ($this->{'strPlainText'} ne "") {
$return_value = 1;
}
return $return_value;
}
#_____________________________________________________________________________
sub EncryptSign {
my ($this) = shift;
my ($return_value) = 0;
# generate the command line
my ($pgp_command) = $this->{'strPgpExePath'}
. " -feast +batchmode +force "
. $this->{'strPublicKey'}
. " -u " . $this->{'strPrivateKey'};
$this->{'strEncryptedText'} = $this->DoPgpCommand($pgp_command,$this->{'strPlainText'});
# if there were results then everything went as planned
if ($this->{'strEncryptedText'} ne "") {
$return_value = 1;
}
PGPSimple.pm view on Meta::CPAN
}
#_____________________________________________________________________________
sub Sign {
my ($this) = shift;
my ($return_value) = 0;
# generate the command line
my ($pgp_command) = $this->{'strPgpExePath'}
. " -fts +batchmode +force -u "
. $this->{'strPrivateKey'};
$this->{'strSignedText'} = $this->DoPgpCommand($pgp_command,$this->{'strPlainText'});
# if there were results then everything went as planned
if ($this->{'strSignedText'} ne "") {
$return_value = 1;
}
return $return_value;
( run in 0.251 second using v1.01-cache-2.11-cpan-496ff517765 )