Function: epg-start-generate-key

epg-start-generate-key is a byte-compiled function defined in epg.el.gz.

Signature

(epg-start-generate-key CONTEXT PARAMETERS)

Documentation

Initiate a key generation.

PARAMETERS is a string which specifies parameters of the generated key. See Info node (gnupg) Unattended GPG key generation in the GnuPG manual for the format.

If you use this function, you will need to wait for the completion of epg-gpg-program by using epg-wait-for-completion and call epg-reset to clear a temporary output file. If you are unsure, use synchronous version of this function epg-generate-key-from-file or epg-generate-key-from-string instead.

Source Code

;; Defined in /usr/src/emacs/lisp/epg.el.gz
(defun epg-start-generate-key (context parameters)
  "Initiate a key generation.
PARAMETERS is a string which specifies parameters of the generated key.
See Info node `(gnupg) Unattended GPG key generation' in the
GnuPG manual for the format.

If you use this function, you will need to wait for the completion of
`epg-gpg-program' by using `epg-wait-for-completion' and call
`epg-reset' to clear a temporary output file.
If you are unsure, use synchronous version of this function
`epg-generate-key-from-file' or `epg-generate-key-from-string' instead."
  (setf (epg-context-operation context) 'generate-key)
  (setf (epg-context-result context) nil)
  (if (epg-data-file parameters)
      (epg--start context (list "--batch" "--gen-key" "--"
			       (epg-data-file parameters)))
    (epg--start context '("--batch" "--gen-key"))
    (if (eq (process-status (epg-context-process context)) 'run)
	(process-send-string (epg-context-process context)
			     (epg-data-string parameters)))
    (if (eq (process-status (epg-context-process context)) 'run)
	(process-send-eof (epg-context-process context)))))