
(defvar pgp-passphrase nil "\
Variable used internally by the Emacs PGP interface to hold
the user's pass phrase.")

(defun pgp-set-passphrase nil "\
Prompts for PGP pass phrase. If ange-ftp is loaded, password is invisible." (interactive) (byte-code "ÁˆÂÃ!ƒ ÄÅ!‚ ÆÇ!‰‡" [pgp-passphrase nil boundp ange-ftp-version ange-ftp-read-passwd "PGP pass phrase (invisible): " read-string "PGP pass phrase (not invisible): "] 5))

(defun pgp-clear-passphrase nil "\
Clears the PGP pass phrase." (interactive) (byte-code "ÁˆÁ‰‡" [pgp-passphrase nil] 2))

(defun pgp-ensure-passphrase nil "\
Not an interactive command. If the passphrase is not set, prompts for it." (byte-code "?… ÁÂ!‡" [pgp-passphrase call-interactively pgp-set-passphrase] 2))

(defun pgp-encrypt-region (start end pgp-user-id &optional flag) "\
Encrypt the region using PGP. Prompts for a PGP user ID.
With prefix arg, puts result in serparate window.
Noninteractive args are START, END, PGP-USER-ID, and optional FLAG." (interactive "r
sUser ID to encrypt to: 
P") (byte-code "ÄˆÅ	Æ
P?$‡" [start end pgp-user-id flag nil shell-command-on-region "pgp -fea "] 5))

(defun pgp-decrypt-region (start end &optional flag) "\
Decrypt the region using PGP. Prompts for the user's pass phrase,
if not already known.  With prefix arg, puts result in separate window.
Noninteractive args are START and END and optional FLAG." (interactive "r
P") (byte-code "ÄˆÅ ˆÆ	Ç
ÈQ?$‡" [start end pgp-passphrase flag nil pgp-ensure-passphrase shell-command-on-region "pgp -f -z \"" "\""] 7))

(defun pgp-sign-and-encrypt-region (start end pgp-user-id &optional flag) "\
Sign and encrypt the region using PGP. Prompts for a user to
encrypt to and a pass phrase, if not already known.
With prefix arg puts result in separate window. 
Noninteractive args are START, END, and PGP-USER-ID, and optional FLAG." (interactive "r
sUser ID to encrypt to: 
P") (byte-code "ÅˆÆ ˆÇ	ÈÉ
ÊË%?$‡" [start end pgp-user-id pgp-passphrase flag nil pgp-ensure-passphrase shell-command-on-region concat "pgp -safe " " -z \"" "\""] 10))

(defun pgp-sign-region (start end &optional flag) "\
Sign the region using PGP. Prompts for a pass phrase, if not already
Known. With prefix arg puts result in separate window.
Noninteractive args are START and END and optional FLAG." (interactive "r
P") (byte-code "ÄˆÅ ˆÆ	ÇÈ
ÉR?$‡" [start end pgp-passphrase flag nil pgp-ensure-passphrase shell-command-on-region "pgp -saft +clearsig=on" " -z \"" "\""] 8))

(defun pgp-verify-region (start end) "\
Verify the signature on the text in the given region using PGP." (interactive "r") (byte-code "ÂˆÃ	Ä#‡" [start end nil shell-command-on-region "pgp -f"] 4))

(fset (quote pgp-kill-status) "-----")

(defun pgp-describe nil "\
Describe the PGP package.

Quick usage summary:

Default
Key
Binding  Command name                 Description
=======  ===========================  =========================================
C-c p p  pgp-set-passphrase           Prompts for entry of passphrase. With
                                       ange-ftp loaded, this is invisible.
C-c p c  pgp-clear-passphrase         Clears the passphrase from emacs memory.
                                       (Not very thoroughly; see below.)
C-c p e  pgp-encrypt-region           Prompts for recipient. Output in place
                                       unless prefixed.
C-c p d  pgp-decrypt-region           Prompts for passphrase if unknown.
                                       Output in place unless prefixed.
C-c p s  pgp-sign-region              Uses CLEARSIG. Prompts for passphrase
                                       if unknown. Output in place unless C-u.
C-c p S  pgp-sign-and-encrypt-region  Prompts for recipient and passphrase if
                                       unknown. Output in place unless C-u.
C-c p v  pgp-verify-region            Checks signature for validity. Output in
                                       separate window.
C-c p k  pgp-kill-status              Done immediately after C-c p s,
                                       kills the PGP status information.
C-c p h  pgp-describe                 Show this documentation.

WARNING: Security Holes:
People can see your PGP passphrase if:
* You don't have ange-ftp and they see you typing in your passphrase.
* They (intentionally or accidentally) do a \"ps\" (with appropriate options)
    on your machine while you're decrypting/signing.
* They type C-h v pgp-passphrase after you've entered it.

Plus the system suffers from all the normal Unix and X-windows
security holes.

More documentation to come." (interactive) (byte-code "ÀˆÁÂ!‡" [nil describe-function pgp-describe] 2))

(global-set-key "pp" (quote pgp-set-passphrase))

(global-set-key "pc" (quote pgp-clear-passphrase))

(global-set-key "pe" (quote pgp-encrypt-region))

(global-set-key "pd" (quote pgp-decrypt-region))

(global-set-key "ps" (quote pgp-sign-region))

(global-set-key "pS" (quote pgp-sign-and-encrypt-region))

(global-set-key "pv" (quote pgp-verify-region))

(global-set-key "pk" (quote pgp-kill-status))

(global-set-key "ph" (quote pgp-describe))

(global-set-key "p?" (quote pgp-describe))
