rpgp
rpgp copied to clipboard
Add helper function and docs for loading pubkeys
Related to #44. Not closing yet as this PR only covers public keys.
This is pretty hard to figure out from the existing docs.
The helper is intended to "just work" in as many cases as possible. For that reason it uses the "many" variant (some key files in fact contain more than one key) and auto-detects the encoding (in some contexts the two formats are used interchangeably).
The downsides of the helper are that it loses some information (which key failed to parse specifically, what the ascii armor headers were in the case of the ascii encoding), and also that it does not work with a reader but with a byte slice. But since key files are generally not very large I think this is an acceptable trade-off. People can always look at the source and make their own variant if they need it.