1 ;;; password.el --- Read passwords from user, possibly using a password cache.
3 ;; Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
5 ;; Author: Simon Josefsson <simon@josefsson.org>
7 ;; Keywords: password cache passphrase key
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 ;; Boston, MA 02110-1301, USA.
28 ;; Greatly influenced by pgg.el written by Daiki Ueno, with timer
29 ;; fixes for XEmacs by Katsumi Yamaoka. In fact, this is mostly just
32 ;; (password-read "Password? " "test")
33 ;; ;; Minibuffer prompt for password.
36 ;; (password-cache-add "test" "foo")
39 ;; Note the previous two can be replaced with:
40 ;; (password-read-and-add "Password? " "test")
41 ;; ;; Minibuffer prompt for password.
43 ;; ;; "foo" is now cached with key "test"
46 ;; (password-read "Password? " "test")
47 ;; ;; No minibuffer prompt
50 ;; (password-read "Password? " "test")
51 ;; ;; No minibuffer prompt
54 ;; ;; Wait `password-cache-expiry' seconds.
56 ;; (password-read "Password? " "test")
57 ;; ;; Minibuffer prompt for password is back.