This is a fairly simplistic example, but shows how to use opgpcard via
its JSON API to set up a card with a specific configuration, for a
specific user. It's meant to show how to get started, and hopefully
can be a base for a custom tool for an organization with specific
needs.
It won't modify a card that already has an OpenPGP key on it, unless
--force is used.
Sponsored-by: author
This field will only contain data in rare cases (I don't know of a card where it will) when a card has key information for unusual key types (also see OpenPGP card spec 3.4.1 pg.43)
- move text about non-interactive use to its own section
- add a brief introduction to JSON output
- edits to adjust output to changed output format
- minor edits for clarity
- use standard example card ident
- slightly generalize manufacturer section
- move copyright information to header (like in other markdown documents)
- minor edits
- If a PIN file could not be read, there is no error and the program
proceeds as if no PIN file argument was given.
- Add error handling for read errors of the PIN file.
Fixes#43
- Sometimes, it is more convenient to give the target filename as an
argument, instead of using pipes.
- Add an optional argument -o/--output to opgpcard sign and opgpcard
decrypt.
- The certificate generated by admin generate is written to a file,
prefixed with a line containing the card identifier. That means the
file is not immediately usable as a pgp certificate.
- Remove the identifier line.
- A flagfile requires manual management with touch and rm, replace it
with an environment variable that can be set more conveniently.
- Removing tools/tests/opgpcard.rs is not necessary, the file it links
to is always generated in build.rs, either with subplot tests or
without. But it is always there, so cargo test does not fail for
that reason.
- opgpcard admin generate by default prints the corresponding
certificate to stdout, where it's easy for a careless user to lose
it.
- Make the --output argument mandatory, so the certificate is always
stored in a file.