X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=epg-file.el;h=cd6f6a02bdaaebb15250c6e09b75fcdebab650fb;hb=95ff40c9179c88308fe96e1adb0ef220b67f265c;hp=dc48030cb6ed6317c3ce9735346da4ccfd8cd58a;hpb=03cd722dc739b7f7c60973b55d9531771d9609f0;p=elisp%2Fepg.git diff --git a/epg-file.el b/epg-file.el index dc48030..cd6f6a0 100644 --- a/epg-file.el +++ b/epg-file.el @@ -1,5 +1,42 @@ +;;; epg-file.el --- transparent file encryption utility +;; Copyright (C) 1999, 2000, 2002, 2003, 2004, +;; 2005, 2006 Free Software Foundation, Inc. +;; Copyright (C) 2006 Daiki Ueno + +;; Author: Daiki Ueno +;; Naoto Morishima +;; Keywords: PGP, GnuPG + +;; This file is part of EasyPG. + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Commentary: + +;; epg-file.el is based on hedgehog.el by Naoto Morishima. +;; http://www.morishima.net/~naoto/software/hedgehog/index.php.ja + +;;; Code: + (require 'epg) +(defgroup epg-file () + "Transparent file encryption utility of EasyPG." + :group 'epg) + (defcustom epg-file-name-regexp "\\.gpg\\'" "Regexp that matches filenames that are assumed to be encrypted with GnuPG." @@ -67,8 +104,15 @@ with GnuPG." (let ((coding-system-for-write 'binary) (coding-system-for-read 'binary) (context (epg-make-context)) + recipients + string cipher) - (when (setq cipher (epg-encrypt-string context (buffer-string) nil)) + (while (not (equal (setq string + (read-string "To (end with an empty line): ")) + "")) + (setq recipients (cons string recipients))) + (when (setq cipher (epg-encrypt-string context (buffer-string) + recipients)) (if (and (memq system-type '(ms-dos windows-nt)) (boundp 'buffer-file-type)) (setq buffer-file-type t))