initremote, enableremote: Support gpg subkeys suffixed with an exclamation mark, which forces gpg to use a specific subkey.
This commit was sponsored by Peter Hogg on Patreon.
This commit is contained in:
parent
dd65ea52c3
commit
35465b6062
3 changed files with 29 additions and 1 deletions
|
@ -157,7 +157,11 @@ pipeLazy (GpgCmd cmd) params feeder reader = do
|
|||
- a key id, or a name; See the section 'HOW TO SPECIFY A USER ID' of
|
||||
- GnuPG's manpage.) -}
|
||||
findPubKeys :: GpgCmd -> String -> IO KeyIds
|
||||
findPubKeys cmd for = KeyIds . parse . lines <$> readStrict cmd params
|
||||
findPubKeys cmd for
|
||||
-- "subkey!" tells gpg to force use of a specific subkey,
|
||||
-- so pass it through as-is rather than looking up the master key.
|
||||
| "!" `isSuffixOf` for = return $ KeyIds [for]
|
||||
| otherwise = KeyIds . parse . lines <$> readStrict cmd params
|
||||
where
|
||||
params = [Param "--with-colons", Param "--list-public-keys", Param for]
|
||||
parse = mapMaybe (keyIdField . splitc ':')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue