From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id QLgMGUrM12M1/wAAbAwnHQ (envelope-from ) for ; Mon, 30 Jan 2023 14:55:22 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cCj5GErM12O9GwAA9RJhRA (envelope-from ) for ; Mon, 30 Jan 2023 14:55:22 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CB1AE28CA3 for ; Mon, 30 Jan 2023 14:55:21 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMUaq-0006AL-3a; Mon, 30 Jan 2023 08:53:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMUaS-0005tC-LN for emacs-orgmode@gnu.org; Mon, 30 Jan 2023 08:52:45 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMUaP-0004m0-FP for emacs-orgmode@gnu.org; Mon, 30 Jan 2023 08:52:44 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 9EF2E2401A7 for ; Mon, 30 Jan 2023 14:52:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1675086759; bh=3sMs8Mz/7s0xVDPtvO/u/yguGqkEBiJkZbAeqqzC7Z0=; h=From:To:Cc:Subject:Date:From; b=EUPSrnPclIN8mLx/h3aorgqy1e8Pt2OysL4bL8/L0Jj+r/tkOgyDXmQ3IzekdB7g+ Pr2LSlaxM5nencWaEZivMH0GmItSJ/Iqj/IhJGxMMbPMVzUjNVnzaziGl+FYv00Ncs J94knLh4c/bQZN7oaqNj7XXjoxMoSgIcZbfiA7DjMflx/HK5wRa8/MmYDFbgY+qTAG /GnRCHGmFcdHviwOZXpO7wfy5r3Pt9KSRBZO3/FmljxDayOIRE1MUUFLm4ItknjJVn 1X4BrvYHVs8w/RS5AOYVThdCM67SrZvbd49xYPVzq6VIbZ5/V1r7+1K42WPf6Ywrk4 FQtFCmu/V96Eg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4P58kr5CSGz6tn5; Mon, 30 Jan 2023 14:52:36 +0100 (CET) From: Ihor Radchenko To: Karl Voit Cc: emacs-orgmode@gnu.org Subject: Re: org-crypt fails if default key is expired while non-default key is to be used In-Reply-To: <2023-01-29T18-33-58@devnull.Karl-Voit.at> References: <2023-01-22T18-32-17@devnull.Karl-Voit.at> <875ycx7dzx.fsf@localhost> <2023-01-23T15-55-10@devnull.Karl-Voit.at> <875ycw70ri.fsf@localhost> <2023-01-29T18-33-58@devnull.Karl-Voit.at> Date: Mon, 30 Jan 2023 13:53:11 +0000 Message-ID: <87pmaw3z94.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1675086922; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Bll6vm9VgPlP+RY4KrCP4a0Bylvr0khCjhNk5h5GFXQ=; b=hbh3BytzTP1vldb2EJAq3Y2TLgOEOWRNqs7UBIlHRcccYAD+S1marwAJRu02UXRVi4VBfy SOJz6+wn8TTdKYfvQhbMZRXuVQUFzFWECWfHwN3Ok289l6ScHYCQTyMgeAg7VIMAGZCPLq SynNIW4HtG1BscEQsUWxQOW48MsX2Ld7TUQYv2KSCsCEtsxdI2ri1ZnNqoJLhcQ8m2u4gn i3hDCINLGMMbOM6dlw58aaVCAzcyymr6HS35XF15MkRR5S904g9y+6D9y8IBfl7XF4h+tJ Brmb+TC/Cl96uAn/m7LJpZyxggEQFnHJpuMw5XoXbvOPPXpKywToV04XFAHXkA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=EUPSrnPc; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1675086922; a=rsa-sha256; cv=none; b=KunYmW/5TYgp8+24edgiAaVs483jXbTkt96cGNLY1gUx4RHq6YDQkMnf1fzBVOpP4N7UlI dI1W5YCGnwvv17Ly0uIHkbjp4XcJIxOJCswF/5tIbDKANdDe5alD/+wC/g6PRwFpzZz9jl e/Pbmond7eIEF2J6VIi1uuCiudT80pqbVpfinHi7ba+3q4fSWd+4uqQrdeKQaC1Nnu9O2S bliIQ9WNcVkFPFktVNEz/KHliDIzXIe3XE6FsOYACqozfwkw4VBkwzjvjFvESld6ggKXnw tptZvwbrgmQmF5UMpX3fvEd+0XvIY/BHiWaxVrEnQQhpPGgrdtJ7Hb9tbZDu7A== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=EUPSrnPc; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net X-Migadu-Scanner: scn0.migadu.com X-Spam-Score: -6.34 X-Migadu-Queue-Id: CB1AE28CA3 X-Migadu-Spam-Score: -6.34 X-TUID: XRllhHeCdAld Karl Voit writes: >> What is the return value of >> >> (epg-list-keys (epg-make-context nil t t) org-crypt-key) >> >> ? >> >> Does it show the right key? > > It shows: > > (#s(epg-key ultimate > (#s(epg-sub-key ultimate ... nil 1 4096 "ABC12345" 1515327255 nil "AAAAAAAA...ABC12345") > #s(epg-sub-key ultimate ... nil 1 4096 "FFFFFFF" 1515327255 nil "FFFF.FFFFFFFF")) > (#s(epg-user-id ultimate "Karl Voit (Internal key for orgmode) " nil)))) > > ... with ABC12345 being the correct key for org-crypt and FFFFFFF being my > default OpenPGP key. Ok. What about (let ((context (epg-make-context nil t t))) (epg-decrypt-string context (epg-encrypt-string context "test" (epg-list-keys context org-crypt-key)))) -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at