summaryrefslogtreecommitdiffstats
path: root/openpgp/examples/decrypt-with.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-02-18 11:05:09 +0100
committerJustus Winter <justus@sequoia-pgp.org>2020-02-18 11:23:03 +0100
commit32174f69cd4d94b4f621f3273781d487e97fa031 (patch)
tree0d3aaec16fbd743609cce0539f55422daabb596c /openpgp/examples/decrypt-with.rs
parent363110b87dd5228e5a22f336fa96fc53a17149be (diff)
openpgp: Improve tracking of secret keys.
- We use marker traits to track with the type system if a Key has secret key material attached. Previously, it was possible to subvert that by taking the secret key material using Key4::set_secret, creating a Key4<SecretParts, ..> without any secrets. - Related, the accessor functions returned an Option<SecretKeyMaterial> even for Key4<SecretParts, ..>. - Replace set_secret by add_secret and take_secret that also change the Key's type accordingly. Make the accessors infallible if we know we have a secret key, rename Key4<P, R>::secret to Key4<P, R>::optional_secret to make the distinction clear. - Fixes #435.
Diffstat (limited to 'openpgp/examples/decrypt-with.rs')
0 files changed, 0 insertions, 0 deletions