Mac-Apps-MacPGP
view release on metacpan or search on metacpan
lib/Mac/Apps/MacPGP.pm view on Meta::CPAN
}
if (exists $ar{'outp'}) {
$ar{'outp'} =~ s/^\[alis\(\Ç(.*?)\È\)\]/$1/;
# $ar{'outp'} = (pack("H*",$ar{'outp'}));
}
$self->{results} = \%ar;
AEDisposeDesc $rp;
return $ar{result};
}
#-----------------------------------------------------------------
sub _MpgpAeProcess {
my($self) = shift;
my($rp) = AESend($be, kAEWaitReply) || croak $^E;
AEDisposeDesc $be;
return &_MpgpAePrint($self,$rp);
}
#-----------------------------------------------------------------#
1;
__END__
=head1 NAME
Mac::Apps::MacPGP - Interface to MacPGP 2.6.3
=head1 SYNOPSIS
use Mac::Apps::MacPGP;
$object = new Mac::Apps::MacPGP;
#see description for the rest
=head1 DESCRIPTION
MacPerl interface to MacPGP 2.6.3. Older versions WILL NOT WORK. The MIT version, MacPGP 2.6.2, does not support nearly the number of AppleEvents as does 2.6.3. For those outside the U.S., you will not be able to download the program; but there ar...
MacPerl 5.1.1 (released January 1997) or higher is also required because of bugs in the AppleEvents library in previous versions.
Also required is the Mac::Apps::Launch module, however, which requires MacPerl 5.1.4r4 or higher. :)
For optional parameters, MacPGP will either use the default or prompt the user. Parameters are required unless noted as optional. Exception: For the C<$OUTP> parameter, the MacPGP default is binary but I set it to ASCII in the module, because I rar...
Boolean parameters take a value of 1 (true) or 0 (false). Filenames should be given the full pathname. To leave an optional parameter empty, give it a value of C<undef>. Optional parameters will either be given the default by MacPGP or MacPGP will...
For further explanation of methods and parameters, see your MacPGP 2.6.3 user guide.
If something seems seems to not work properly, try doing it directly from MacPGP before assuming it is the fault of MacPGP.pm. :-)
=head1 USAGE
=head2 encrypt
Encrypt. Returns encrypted text for C<$TYPE="ncrd">.
$object->encrypt(TYPE, DOBJ, [RECV|CPAS], PASS, USID, SIGN, READ, OUTP, LATI, WRAP, ALNS, TABX, MDAL, WSRC, COPT);
=item TYPE
One of "encr" (encrypt files), "ncrd" (encrypt data), or "cncr" (conventional encryption).
=item DOBJ
For C<$TYPE="encr"> or C<"cncr">, C<$DOBJ> is either a filename or a reference to an array of filenames. For C<$TYPE="ncrd">, C<$DOBJ> is the data to be encrypted. If C<$DOBJ> is empty, MacPGP will attempt to encrypt the clipboard instead.
=item RECV
Either the name of a recipient or a reference to an array of recipients. (encr and ncrd only)
=item CPAS
Password used for conventional encryption. Optional. (cncr only)
=item PASS
The password. Optional.
=item USID
Name of secret key. Optional.
=item SIGN
Sign? One of "sepa" (signature in separate file), "incl", (signature included), "omit" (omitted, don't sign). Optional.
=item READ
Input format. One of "macb" (MacBinarize first), "text", (convert text to CRLF), "norm" (do nothing). Optional.
=item OUTP
Output format. One of "bina" (8-bit binary), "asci", (ASCII-armored). Optional.
=item LATI
Convert text to ISO-Latin1? Boolean. Optional.
=item WRAP
Wrap text to this many lines, between 30 and 100. 0=no wrap. Optional.
=item ALNS
For armored files, split output into files of this line length. 0=no split. Optional.
=item TABX
For wrapped files, expand tabs to this many spaces, from 0 to 9. Optional.
=item MDAL
Use "MD5 " or "SHA1" to compute message digest for file. Optional.
=item WSRC
Wipe out source file? Boolean. Optional. (encr and cncr only)
=item COPT
Self-decrypting? One of "sdf" (self-decrypting) or "sdfb", (self-decrypting and binhexed). Default is neither. Optional. (cncr only)
=head2 decrypt
Decrypt. Returns decrypted text for C<$TYPE="dcrd"> and C<$DOBJ ne undef>. Returns signatures for C<$TYPE="decr">.
$object->decrypt(TYPE, DOBJ, PASS, SCRE, NSIG, APL2, RECV);
=item TYPE
One of "decr" (decrypt files), "dcrd" (decrypt data).
=item DOBJ
For C<$TYPE="decr">, C<$DOBJ> is either a filename or a reference to an array of filenames. For C<$TYPE="dcrd">, C<$DOBJ> is the data to be decrypted. If C<$DOBJ> is empty, MacPGP will attempt to decrypt the clipboard instead. To get signatures fr...
=item PASS
The password. Optional.
=item SCRE
Decrypt to screen instead of file? Boolean. Optional.
=item NSIG
Do not put up bad signature alerts? Boolean. Optional.
=item APL2
If direct object is a separate sig file, the file the sig applies to. Optional.
=item RECV
File to decrypt to. Optional. (decr only)
=head2 sign
Sign. Returns encrypted signed text for C<$TYPE="sigd">, returns signature results for C<$TYPE="sign">.
$object->sign(TYPE, DOBJ, PASS, USID, SIGN, READ, OUTP, LATI, WRAP, ALNS, TABX, MDAL, STFX);
=item TYPE
One of "sign" (sign files), "sigd" (sign data).
=item DOBJ
For C<$TYPE="sign">, C<$DOBJ> is either a filename or a reference to an array of filenames. For C<$TYPE="sigd">, C<$DOBJ> is the data to be signed. If C<$DOBJ> is empty, MacPGP will attempt to sign the clipboard instead.
=item PASS
The password. Optional.
=item USID
Name of secret key. Optional.
=item SIGN
Sign? One of "sepa" (signature in separate file), "incl", (signature included), "omit" (omitted, don't sign). Optional.
=item READ
See READ in L<"encrypt">. Optional.
=item OUTP
See OUTP in L<"encrypt">. Optional.
=item LATI
See LATI in L<"encrypt">. Optional.
=item WRAP
See WRAP in L<"encrypt">. Optional.
=item ALNS
See ALNS in L<"encrypt">. Optional.
=item TABX
See TABX in L<"encrypt">. Optional.
=item MDAL
See MDAL in L<"encrypt">. Optional.
=item STFX
Set text flag? (Esoteric option for some PGP/MIME implementations.) Boolean. Optional.
=head2 asciify
Asciify a file.
$object->asciify(DOBJ, READ, LATI, WRAP, ALNS, TABX);
=item DOBJ
Filename or reference to an array of filenames to be asciified.
=item READ
See READ in L<"encrypt">. Optional.
=item LATI
( run in 4.594 seconds using v1.01-cache-2.11-cpan-84e82930d8c )