-;;; @ internal method for application/pgp
-;;;
-;;; It is based on draft-kazu-pgp-mime-00.txt (PGP-kazu).
-
-(defun mime-view-application/pgp (entity situation)
- (let* ((p-win (or (get-buffer-window (current-buffer))
- (get-largest-window)))
- (new-name
- (format "%s-%s" (buffer-name) (mime-entity-number entity)))
- (mother (current-buffer))
- (preview-buffer (concat "*Preview-" (buffer-name) "*"))
- representation-type message-buf context plain)
- (set-buffer (setq message-buf (get-buffer-create new-name)))
- (erase-buffer)
- (mime-insert-entity entity)
- (cond ((progn
- (goto-char (point-min))
- (re-search-forward "^-+BEGIN PGP SIGNED MESSAGE-+$" nil t))
- (setq context (epg-make-context))
- (epg-verify-string
- context
- (buffer-substring (match-beginning 0)(point-max)))
- (goto-char (point-min))
- (delete-region
- (point-min)
- (and
- (re-search-forward "^-+BEGIN PGP SIGNED MESSAGE-+\n\n")
- (match-end 0)))
- (delete-region
- (and (re-search-forward "^-+BEGIN PGP SIGNATURE-+")
- (match-beginning 0))
- (point-max))
- (goto-char (point-min))
- (while (re-search-forward "^- -" nil t)
- (replace-match "-"))
- (setq representation-type (if (mime-entity-cooked-p entity)
- 'cooked)))
- ((progn
- (goto-char (point-min))
- (re-search-forward "^-+BEGIN PGP MESSAGE-+$" nil t))
- (setq context (epg-make-context))
- (setq plain
- (decode-coding-string
- (epg-decrypt-string
- context
- (buffer-substring (point-min)(point-max)))
- 'raw-text))
- (delete-region (point-min)(point-max))
- (insert plain)
- (setq representation-type 'binary)
- ))
- (setq major-mode 'mime-show-message-mode)
- (save-window-excursion
- (mime-view-buffer nil preview-buffer mother
- nil representation-type)
- (make-local-variable 'mime-view-temp-message-buffer)
- (setq mime-view-temp-message-buffer message-buf))
- (set-window-buffer p-win preview-buffer)
- (if (and context
- (epg-context-result-for context 'verify))
- (epa-display-verify-result (epg-context-result-for context 'verify)))))
-