-;;;###autoload
-(defun epg-configuration ()
- "Return a list of internal configuration parameters of `epg-gpg-program'."
- (let (config type)
- (with-temp-buffer
- (apply #'call-process epg-gpg-program nil (list t nil) nil
- '("--with-colons" "--list-config"))
- (goto-char (point-min))
- (while (re-search-forward "^cfg:\\([^:]+\\):\\(.*\\)" nil t)
- (setq type (intern (match-string 1))
- config (cons (cons type
- (if (memq type
- '(pubkey cipher digest compress))
- (mapcar #'string-to-number
- (delete "" (split-string
- (match-string 2)
- ";")))
- (match-string 2)))
- config))))
- config))
-
-;;;###autoload
-(defun epg-check-configuration (config)
- "Verify that CONFIGURATION is sufficient."
- (let ((entry (assq 'version config))
- major minor teeny)
- (unless (and entry
- (stringp (cdr entry))
- (string-match "\\`\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)"
- (cdr entry)))
- (error "Undetermined version: %S" entry))
- (setq major (string-to-number (match-string 1 (cdr entry)))
- minor (string-to-number (match-string 2 (cdr entry)))
- teeny (string-to-number (match-string 3 (cdr entry))))
- (unless (or (> major 1)
- (and (= major 1)
- (or (> minor 4)
- (and (= minor 4)
- (>= teeny 3)))))
- (error "Unsupported version: %s" (cdr entry)))))
-