Skip to content

List recipients for an encrypted file #158

@vsajip

Description

@vsajip

Original report by Jan Christian Grünhage (Bitbucket: jcgruenhage, GitHub: jcgruenhage).


Motivation

We’re using this library at Famedly for pass compatible secret encryption in ansible. For making it ergonomic, so that changes in the recipient list are automatically applied to all passwords, we need to get the list of current recipients for the file and compare it to the desired list. python-gnupg does currently not provide a way to get the recipient list for a file right now.

Implementation hints

I’ve looked into how this could be done, and it seems that --list-only is the option that prints the recipient keys to stderr without actually running the decryption. Together with -v, you get a nice, easily parse-able list in the beginning of the output.

pass also has an implementation for this, in just one relatively hard to read 216 character line: https://git.zx2c4.com/password-store/tree/src/password-store.sh#n132, which is probably going to look a lot nicer in python ^^

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions