summaryrefslogtreecommitdiffstats
path: root/openpgp/examples
AgeCommit message (Collapse)Author
2020-12-07openpgp: Make serialize::stream::Message Send + Sync.Justus Winter
- See #615.
2020-11-10openpgp: Use Padme as default padding policy.Wiktor Kwapisiewicz
2020-11-10openpgp: Make stream::Padder use the builder pattern.Wiktor Kwapisiewicz
- Split Padder::new() into new and build. - Adjust code in dependent projects (sop and sq). - Fixes #600.
2020-10-22openpgp: Improve documentation on how to encrypt for multiple certs.Justus Winter
2020-10-22openpgp: Select only supported encryption-capable keys.Justus Winter
2020-09-21openpgp: Convert `extern crate` to `use` in examples.Wiktor Kwapisiewicz
2020-09-21openpgp: Call all layers of the message `message`.Wiktor Kwapisiewicz
2020-09-21openpgp: Fix examples to use stream::Armorer.Wiktor Kwapisiewicz
2020-09-21openpgp: Adjust examples to use try operator.Wiktor Kwapisiewicz
- Change `expect` to `context(...)?`, - Change `unwrap` to `?`.
2020-08-05openpgp: Don't implement Default for the Bitflags types.Justus Winter
- See #525.
2020-07-28openpgp: Reimplement the KeyFlags struct using Bitfield.Justus Winter
- This also drops the implementation of PartialOrd since we did not use it in the key selection after all. - Fixes #525.
2020-07-15openpgp: Collect statistics about public key algorithms.Justus Winter
2020-05-28openpgp: Change the `decrypt` proxy in the decryption helper.Justus Winter
- Returning rich errors from this function may compromise secret key material due to Bleichenbacher-style attacks. Change the API to prevent this. - Hat tip to Hanno Böck. - Fixes #507.
2020-05-28openpgp: Change PKESK::decrypt to return an Option<_>.Justus Winter
- Returning rich errors from this function may compromise secret key material due to Bleichenbacher-style attacks. Change the API to prevent this. - Hat tip to Hanno Böck. - See #507.
2020-05-13openpgp: Convert from ValidKeyAmalgamation for Recipient.Justus Winter
- Simplify examples accordingly.
2020-05-13openpgp: Avoid constructing vectors of recipients.Justus Winter
- Every iterator implements IntoIterator. Simplify accordingly.
2020-05-13openpgp: Make Encryptor::for_recipients polymorphic.Justus Winter
2020-05-07openpgp: Use a builder to construct Decryptor.Justus Winter
- See #498.
2020-05-07openpgp: Use a builder to construct Verifier.Justus Winter
- See #498.
2020-04-20openpgp: Add armor::Writer::with_headers.Justus Winter
- Add a new constructor that takes headers. This allows us to make the header argument polymorphic.
2020-04-16Revert "openpgp: Make PacketParserResult a std::result::Result."Justus Winter
This reverts commit 2e1eec5fe4157a391a13554ff7df3075cfe043cc.
2020-04-09openpgp: Make PacketParserResult a std::result::Result.Justus Winter
- This avoids the partial implementation imitating std::option::Option, replacing it with std::result::Result. - As a benefit, std::result::Result is in the prelude, simplifying a lot of parsing loops.
2020-04-06openpgp: Rename VerificationHelper::get_public_keys to get_certs.Justus Winter
2020-04-03openpgp: Unawkwardify the streaming encryptor.Justus Winter
2020-04-02openpgp: Move the padding module to serialize::stream.Justus Winter
2020-03-26Remove redundant field names.Wiktor Kwapisiewicz
2020-03-16openpgp: Fix examples.Justus Winter
- Properly finalize the armor writer.
2020-03-09Switch from failure to anyhow.Justus Winter
- Use the anyhow crate instead of failure to implement the dynamic side of our error handling. anyhow::Error derefs to dyn std::error::Error, allowing better interoperability with other stdlib-based error handling libraries. - Fixes #444.
2020-03-09Reduce use of explicit failure::Fallible.Justus Winter
2020-03-03openpgp: Only impl Serialize for objects that are normally exported.Neal H. Walfield
- Add two new traits: `Marshal` and `MarshalInto`. - Implement them instead of `Serialize` and `SerializeInto`. - Only implement `Serialize` and `SerializeInto` for data structures that are normally exported. - This should prevent users from accidentally serializing a bare signature (`Signature`) when they meant to serialize a signature packet (`Packet`), for instance. - Fixes #368.
2020-02-26openpgp: Don't unnecessarily use ComponentAmalgamation::bundle.Neal H. Walfield
- A `ComponentAmalgamation` derefs to a `ComponentBundle`. Don't use `ComponentAmalgamation::bundle` if it is unnecessary and doesn't improve legibility.
2020-02-26openpgp: Add a prelude file to import things related to certificatesNeal H. Walfield
- Add `openpgp/src/cert/prelude.rs` to import most types and traits related to certificates. - Use it instead of using the types and traits individually.
2020-02-20openpgp: Split the ValidAmalgamation trait.Neal H. Walfield
- Split the ValidAmalgamation trait into two traits, Amalgamation and ValidAmalgamation, so that the functionality made available by the Amalgamation trait can be provided by a ComponentAmalgamation, which doesn't have a policy.
2020-02-19openpgp: Split VerificationResult.Justus Winter
- Split VerificationResult into Result<GoodChecksum, VerificationError>. - Fixes #416.
2020-02-18openpgp: Improve tracking of secret keys.Justus Winter
- 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.
2020-02-17openpgp: Reduce the number of explicit key conversions.Justus Winter
2020-02-12openpgp: Add optional cipher argument to DecryptionHelper::decrypt.Justus Winter
2020-02-12openpgp: Add optional cipher argument to PKESK3::decrypt.Justus Winter
2020-02-06openpgp: Rename methods 'set_policy' to 'with_policy'.Justus Winter
- Fixes #427.
2020-02-06openpgp, openpgp-ffi, ipc: Add missing dyn.Justus Winter
2020-02-06openpgp: Rename ComponentBinding to ComponentBundle, etc.Justus Winter
- Likewise KeyBinding, UserIDBinding, UserAttributeBinding, UnknownBinding, etc. - Reason: a self-signature on a component is a binding, but revocations and TPSes are not bindings. - Consistently call collections of components and associated signatures bundles now. Likewise for fields, methods. - Fixes #425.
2020-01-31openpgp: Add a policy object.Neal H. Walfield
- Change all functions that need to evaluate the validity of a signature (either directly or indirectly to take a policy object. - Use the policy object to allow the user to place additional constraints on a signature's validity. - This addresses the first half of #274 (it introduces the policy object, but does not yet implement any policy).
2020-01-20openpgp: Rename ComponentIter::components to bindings.Neal H. Walfield
- `ComponentIter::components` returns `ComponentBindings`. It is more accurate to call it `ComponentIter::component_bindings`. But, since it is called on a component, just use the shorter name, `ComponentIter::bindings`.
2020-01-20openpgp: Use the new framework for Cert::userid.Justus Winter
- Fixes #414.
2020-01-18openpgp: Use Cert::keys instead of Cert::subkeys.Justus Winter
2020-01-16openpgp: Remove variant VerificationResult::BadChecksum.Justus Winter
- This is better expressed as an error.
2020-01-14openpgp: Remove unneeded fields from VerificationResult::NotAlive.Neal H. Walfield
- VerificationResult::NotAlive means that the signature is not alive. This has nothing to do with a specific key. Indeed, there might not even be a key available, but we can still detect this error condition. - As such, remove the cert and key fields from VerificationResult::NotAlive.
2020-01-13openpgp: Add Error variant to VerificationResult.Neal H. Walfield
- Add an Error variant to VerificationResult.
2020-01-10openpgp: Prefer consuming MessageStructure's to referencing them.Neal H. Walfield
2020-01-10openpgp: Pass MessageStructure by value, not reference.Neal H. Walfield
- Instead of passing MessageStructure to VerificationHelper::check by reference, pass it by value. - After calling VerificationHelper::check, it is dropped. Passing it by value allows the caller to avoid some cloning.