2000-11-05 Simon Josefsson <sj@extundo.com>
[gnus] / lisp / mml-smime.el
1 ;;; mml-smime.el --- S/MIME support for MML
2 ;; Copyright (c) 2000 Free Software Foundation, Inc.
3
4 ;; Author: Simon Josefsson <simon@josefsson.org>
5 ;; Keywords: Gnus, MIME, SMIME, MML
6
7 ;; This file is a part of GNU Emacs.
8
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published
11 ;; by the Free Software Foundation; either version 2, or (at your
12 ;; option) any later version.
13
14 ;; GNU Emacs is distributed in the hope that it will be useful, but
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 ;; General Public License for more details.
18
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 ;; Boston, MA 02111-1307, USA.
23
24 ;;; Commentary:
25
26 ;;; Code:
27
28 (require 'smime)
29
30 (defun mml-smime-verify (handle ctl)
31   (smime-verify-buffer)
32   handle)
33
34 ;;;###autoload
35 (defun mml-smime-sign (cont)
36   ;; FIXME: You have to input the sender.
37   (when (null smime-keys)
38     (error "Please use M-x customize RET smime RET to configure SMIME"))
39   (smime-sign-buffer)
40   (goto-char (point-min))
41   (when (looking-at "^MIME-Version: 1.0")
42     (forward-line 1)
43     (delete-region (point-min) (point)))
44   (goto-char (point-max)))
45   
46 ;;;###autoload
47 (defun mml-smime-encrypt (cont)
48   ;; FIXME: You have to input the receiptant.
49   ;; FIXME: Should encrypt to myself so I can read it??
50   (smime-encrypt-buffer)
51   (goto-char (point-min))
52   (when (looking-at "^MIME-Version: 1.0")
53     (forward-line 1)
54     (delete-region (point-min) (point)))
55   (goto-char (point-max)))
56
57 ;;;###autoload
58 (defun mml-smime-setup ()
59   )
60
61 (provide 'mml-smime)
62
63 ;;; mml-smime.el ends here