+ (epg-start-delete-keys context keys allow-secret)
+ (epg-wait-for-completion context)
+ (if (epg-context-result-for context 'error)
+ (error "Delete keys failed: %S"
+ (epg-context-result-for context 'error))))
+ (epg-reset context)))
+
+;;;###autoload
+(defun epg-start-sign-keys (context keys &optional local)
+ "Initiate an sign keys operation.
+
+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 temporaly output file.
+If you are unsure, use synchronous version of this function
+`epg-sign-keys' instead."
+ (epg-context-set-result context nil)
+ (epg-start context (cons (if local
+ "--lsign-key"
+ "--sign-key")
+ (mapcar
+ (lambda (key)
+ (epg-sub-key-id
+ (car (epg-key-sub-key-list key))))
+ keys))))
+
+;;;###autoload
+(defun epg-sign-keys (context keys &optional local)
+ "Sign KEYS from the key ring."
+ (unwind-protect
+ (progn
+ (epg-start-sign-keys context keys local)