diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-23 19:47:36 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-23 21:09:09 -0700 |
commit | f5003995e4b2ea9a0fb80a89da37af928ddd5ef9 (patch) | |
tree | 80edd692c4be44402892eb3cd79911f9eb933bc4 /src/property/gnupg.lisp | |
parent | 856de6356a1fb024ad1704b1685f5bd53d2ff3ed (diff) | |
download | consfigurator-f5003995e4b2ea9a0fb80a89da37af928ddd5ef9.tar.gz |
add GNUPG:PUBLIC-KEY-IMPORTED
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/gnupg.lisp')
-rw-r--r-- | src/property/gnupg.lisp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/property/gnupg.lisp b/src/property/gnupg.lisp new file mode 100644 index 0000000..48eabbe --- /dev/null +++ b/src/property/gnupg.lisp @@ -0,0 +1,31 @@ +;;; Consfigurator -- Lisp declarative configuration management system + +;;; Copyright (C) 2020-2021 Sean Whitton <spwhitton@spwhitton.name> + +;;; This file 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 3, or (at your option) +;;; any later version. + +;;; This file 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 this program. If not, see <http://www.gnu.org/licenses/>. + +(in-package :consfigurator.property.gnupg) +(named-readtables:in-readtable :consfigurator) + +(defprop public-key-imported :posix (fingerprint) + "Import the PGP public key identified by FINGERPRINT to gpg's default +keyring." + (:desc #?"PGP public key ${fingerprint} imported") + (:hostattrs + (require-data "--pgp-pubkey" fingerprint)) + (:check + (zerop (mrun :for-exit "gpg" "--list-public-keys" fingerprint))) + (:apply + (mrun + :input (get-data-stream "--pgp-pubkey" fingerprint) "gpg" "--import"))) |