(encode-coding-string (buffer-substring start end)
coding-system))
(unless (assoc file epa-file-passphrase-alist)
- (epa-select-keys
- context
- "Select recipents for encryption.
+ (epa-select-keys
+ context
+ "Select recipents for encryption.
If no one is selected, symmetric encryption will be performed. "))))
(error
(if (setq entry (assoc file epa-file-passphrase-alist))
"The EasyPG Assistant"
:group 'epg)
+(defcustom epa-armor nil
+ "If non-nil, epa commands create ASCII armored output."
+ :type 'boolean
+ :group 'epa)
+
+(defcustom epa-textmode nil
+ "If non-nil, epa commands treat input files as text."
+ :type 'boolean
+ :group 'epa)
+
(defgroup epa-faces nil
"Faces for epa-mode."
:group 'epa)
If no one is selected, default secret key is used. "
nil t)
(y-or-n-p "Make a detached signature? ")))
- (let ((signature (concat file (if detached ".sig" ".gpg")))
+ (let ((signature (concat file (if epa-armor
+ ".asc"
+ (if detached
+ ".sig"
+ ".gpg"))))
(context (epg-make-context)))
+ (epg-context-set-armor context epa-armor)
+ (epg-context-set-textmode context epa-textmode)
(message "Signing %s..." (file-name-nondirectory file))
(epg-context-set-signers context signers)
(epg-sign-file context file signature (not (null detached)))
(list (expand-file-name (read-file-name "File: "))
(epa-select-keys (epg-make-context) "Select recipents for encryption.
If no one is selected, symmetric encryption will be performed. ")))
- (let ((cipher (concat file ".gpg"))
+ (let ((cipher (concat file (if epa-armor ".asc" ".gpg")))
(context (epg-make-context)))
+ (epg-context-set-armor context epa-armor)
+ (epg-context-set-textmode context epa-textmode)
(message "Encrypting %s..." (file-name-nondirectory file))
(epg-encrypt-file context file recipients cipher)
(message "Encrypting %s...done" (file-name-nondirectory file))))
(setq default-name
(expand-file-name
(concat (epg-sub-key-id (car (epg-key-sub-key-list (car keys))))
- ".gpg")
+ (if epa-armor ".asc" ".gpg"))
default-directory))
(list keys
(expand-file-name
(file-name-directory default-name)
default-name)))))
(let ((context (epg-make-context)))
+ (epg-context-set-armor context epa-armor)
(message "Exporting to %s..." (file-name-nondirectory file))
(epg-export-keys-to-file context keys file)
(message "Exporting to %s...done" (file-name-nondirectory file))))