NAME

Mac::Apps::MacPGP - Interface to MacPGP 2.6.3

SYNOPSIS

use Mac::Apps::MacPGP;
$object = new Mac::Apps::MacPGP;
#see description for the rest

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 are International versions. Perhaps in the future I will add support for those. Many of the functions should work fine for those, actually, but I imagine some will not.

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 $OUTP parameter, the MacPGP default is binary but I set it to ASCII in the module, because I rarely use binary PGP files.

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 undef. Optional parameters will either be given the default by MacPGP or MacPGP will prompt the user for a value if necessary.

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. :-)

For $TYPE="encr" or "cncr", $DOBJ is either a filename or a reference to an array of filenames. For $TYPE="ncrd", $DOBJ is the data to be encrypted. If $DOBJ is empty, MacPGP will attempt to encrypt the clipboard instead.

RECV

Either the name of a recipient or a reference to an array of recipients. (encr and ncrd only)

For $TYPE="decr", $DOBJ is either a filename or a reference to an array of filenames. For $TYPE="dcrd", $DOBJ is the data to be decrypted. If $DOBJ is empty, MacPGP will attempt to decrypt the clipboard instead. To get signatures from "dcrd" event, see "checksignresult".

PASS

The password. Optional.

SCRE

Decrypt to screen instead of file? Boolean. Optional.

NSIG

Do not put up bad signature alerts? Boolean. Optional.

APL2

If direct object is a separate sig file, the file the sig applies to. Optional.

For $TYPE="sign", $DOBJ is either a filename or a reference to an array of filenames. For $TYPE="sigd", $DOBJ is the data to be signed. If $DOBJ is empty, MacPGP will attempt to sign the clipboard instead.

generate

Generate new public/secret key pair.

$object->generate(DOBJ, LENG, EBIT);

DOBJ

User id of new key.

LENG

Bit length of key. Higher is stronger and slower. Lower is faster and less secure. Can be either a number from 384 to 2048, or one of the following: "casu" (casual, 512), "comm" (commercial, 768), "mili" (military, 1024). Default is casual. Optional.

Show dialog box, with text $DOBJ, of keys available in keyring. Returns user id of selected key.

DOBJ

Varies; see above.

KEYR

Filename of keyring to perform operation on. Optional.

USID

Name of secret key to certify with. Optional. (crfy only)

create

Create temporary scratch file. File with same name, if existing, is erased.

$object->create(DOBJ);

DOBJ

New filename.

clip2file

Copy Clipboard to file.

$object->clip2file(DOBJ);

DOBJ

Filename of destination file.

file2clip

Copy file to Clipboard. NOTE: This only works if MacPGP is the front application (see "switchapp").

$object->file2clip(DOBJ);

DOBJ

Filename of source file.

checksignresult

Check signature result from previous decrypt data event. See "decrypt".

$object->checksignresult;

getlasterror

Returns error message from previous MacPGP Apple Event.

$object->getlasterror;

getversion

Returns MacPGP version.

$object->getversion;

window

Show/hide window.

$object->window(DOBJ);

DOBJ

Either "show" or "hide".

logfile

Echo PGP messages to a logfile. If logging was active when true sent or no filename is given, returns error. If logging was active. Returns full pathname if successful.

$object->logfile(DOBJ, RECV);

DOBJ

Logging? Boolean.

RECV

Full pathname of logfile. Existing file of same name erased. Optional.

switchapp

Set up window handling. Whenever another method is called, MacPGP.pm will use these two variables to determine what app should be in front. Note: when muliple methods are called, this doesn't seem to work great. Oh well. Maybe someone else will fix this for me or have some ideas. Until then, I suggest that if you DO want MacPGP to come to the front and you have sveral methods being called one after the other, that you just set $object-switchapp(1)> and don't have it switch back.

$object->switchapp(SWITCH, APP);

SWITCH

Switch to MacPGP when method is called? Boolean.

APP

Switch to $APP after $object is destroyed (i.e., when last reference to $object is made). If left blank and $SWITCH=1, MacPGP will go to front and stay there.

Added a whole slew of scripts and extensions for BBEdit, YA-NewsWatcher, Clipboard, Drag-n-Drop. See MacPGP-scripts.readme for details.

Changed the behavior of switchapp method. Switching to MacPGP only occurs when switchapp method is invoked, and switching back only occurs when object is destroyed. Previously, switching took place before and after each method call.

Fixed bug which required decrypt, encrypt and sign to have a DOBJ value. When one of those methods is performing a function on data (dcrd, ncrd, sigd), MacPGP will use Clipboard if no data is given.

Fixed bug in _MpgpBBool routine which would not catch unacceptable input.

v.1.0b3, January 15, 1997

Simply switching to .tar.gz for CPAN instead of .sit.hqx.

v.1.0b2 January 8, 1997

Fixes problems in earlier release, optimizes, module-izes.

Change name from MacPGP to Mac::Apps::MacPGP.

Rewrote AppleEvent calls using individual AEPutParamDesc and AEBuild calls. Should be more efficient. Fixes other bugs (like problems with lists and certain characters in TEXT values).

BUGS

I want to benchmark different ways to switch between applications and use the best one. Stay tuned. If you have ideas, let me know.

other versions

I am investigating the idea of making this useful with other versions of MacPGP (international versions, and limited capabilities of MacPGP 2.6.2) and the future version of PGP 5.0.

stealthify

I have one more method group to add, and that is for stealtifying/destealthifying files. This will come along eventually, but it is not a high priority. First I have to figure out how to use it and what it does ... :-) If you have a need/want for it, let me know.

SEE ALSO

MacPGP 2.6.3 Home Page

http://www.math.ohio-state.edu/~fiedorow/PGP/

MacPGP 2.6.3 Documentation

Included with the above package, take special note of the PGP User's Guide, MacPGP263_Manual, and MacPGP263_AppleEvents.

AUTHOR

Chris Nandor <pudge@pobox.com> http://pudge.net/

Copyright (c) 1998 Chris Nandor. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Please see the Perl Artistic License.

VERSION

Version 1.20 (03 January 1998)

36 POD Errors

The following errors were encountered while parsing the POD:

Around line 596:

'=item' outside of any '=over'

Around line 660:

You forgot a '=back' before '=head2'

Around line 666:

'=item' outside of any '=over'

Around line 694:

You forgot a '=back' before '=head2'

Around line 700:

'=item' outside of any '=over'

Around line 752:

You forgot a '=back' before '=head2'

Around line 758:

'=item' outside of any '=over'

Around line 782:

You forgot a '=back' before '=head2'

Around line 788:

'=item' outside of any '=over'

Around line 816:

You forgot a '=back' before '=head2'

Around line 822:

'=item' outside of any '=over'

Around line 834:

You forgot a '=back' before '=head2'

Around line 840:

'=item' outside of any '=over'

Around line 856:

You forgot a '=back' before '=head2'

Around line 862:

'=item' outside of any '=over'

Around line 904:

You forgot a '=back' before '=head2'

Around line 910:

'=item' outside of any '=over'

Around line 914:

You forgot a '=back' before '=head2'

Around line 920:

'=item' outside of any '=over'

Around line 924:

You forgot a '=back' before '=head2'

Around line 930:

'=item' outside of any '=over'

Around line 934:

You forgot a '=back' before '=head2'

Around line 958:

'=item' outside of any '=over'

Around line 962:

You forgot a '=back' before '=head2'

Around line 968:

'=item' outside of any '=over'

Around line 976:

You forgot a '=back' before '=head2'

Around line 982:

'=item' outside of any '=over'

Around line 990:

You forgot a '=back' before '=head2'

Around line 996:

'=item' outside of any '=over'

Around line 1000:

You forgot a '=back' before '=head2'

Around line 1014:

'=item' outside of any '=over'

Around line 1082:

You forgot a '=back' before '=head1'

Around line 1084:

'=item' outside of any '=over'

Around line 1096:

You forgot a '=back' before '=head1'

Around line 1098:

'=item' outside of any '=over'

Around line 1106:

You forgot a '=back' before '=head1'

Module Install Instructions

To install Mac::Apps::MacPGP, simply copy and paste either of the commands in to your terminal