Function: pgg-gpg-lookup-key-owner

pgg-gpg-lookup-key-owner is a byte-compiled function defined in pgg-gpg.el.gz.

Signature

(pgg-gpg-lookup-key-owner STRING &optional ALL)

Documentation

Search keys associated with STRING and return owner of identified key.

The value may be just the bare key id, or it may be a combination of the user name associated with the key and the key id, with the key id enclosed in "<...>" angle brackets.

Optional ALL non-nil means search all keys, including secret keys.

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/pgg-gpg.el.gz
(defun pgg-gpg-lookup-key-owner (string &optional all)
  "Search keys associated with STRING and return owner of identified key.

The value may be just the bare key id, or it may be a combination of the
user name associated with the key and the key id, with the key id enclosed
in \"<...>\" angle brackets.

Optional ALL non-nil means search all keys, including secret keys."
  (let ((args (list "--with-colons" "--no-greeting" "--batch"
		    (if all "--list-secret-keys" "--list-keys")
		    string))
	(key-regexp (concat "^\\(sec\\|pub\\|uid\\)"
			    ":[^:]*:[^:]*:[^:]*:\\([^:]*\\):[^:]*"
			    ":[^:]*:[^:]*:[^:]*:\\([^:]+\\):")))
    (with-temp-buffer
      (apply #'call-process pgg-gpg-program nil t nil args)
      (goto-char (point-min))
      (if (re-search-forward key-regexp
			     nil t)
	  (match-string 3)))))