summaryrefslogtreecommitdiffstats
path: root/openpgp/examples/sign.rs
AgeCommit message (Collapse)Author
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-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-03-16openpgp: Fix examples.Justus Winter
- Properly finalize the armor writer.
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-06openpgp: Rename methods 'set_policy' to 'with_policy'.Justus Winter
- Fixes #427.
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-06openpgp: Pass a timestamp to the KeyIter instead of each filter.Neal H. Walfield
- KeyIter::revoked and KeyIter::key_flags (and its variants) didn't take a time stamp so they could only be used for filtering keys based on their current state, not their state at some time in the past. Adding a time stamp to each of the filters would have fixed the problem, but it would have made the interface ugly: callers always want the same time stamp for all filters. - Split KeyIter into two structures: a KeyIter and a ValidKeyIter. - Add KeyIter::policy. It takes a time stamp, which is then used for filters like `alive` and `revoked`, and it returns a ValidKeyIter, which exposes filters that require a time stamp.
2019-12-20openpgp: Simplify key iteration interface.Neal H. Walfield
- Cert::keys_valid() is just a short-cut for Cert::keys_all().alive().revoked(false). - Remove Cert::keys_valid() and rename Cert::keys_all() to Cert::keys().
2019-12-19openpgp: Change KeyIter to return a struct instead of a tuple.Neal H. Walfield
- A tuple is just an unnamed, inflexible struct. Use a struct instead. - Fixes #400.
2019-12-04openpgp: Rename KeyIter filters.Justus Winter
- See #359.
2019-11-28Call TPKs Certificates, update identifiers, documentation.Justus Winter
- Fixes #387.
2019-11-25openpgp: Specialize key iterator to return Key<SecretParts, _>.Justus Winter
- Once KeyIter::secret or KeyIter::unencrypted_secret is called, change the iterator type to iterate over &Key<SecretParts, _>. - Fixes #384.
2019-11-22openpgp: Make conversions into Key<SecretParts, _> fallible.Justus Winter
- Fixes #380.
2019-11-19openpgp: Use the builder pattern for stream::LiteralWriter.Justus Winter
- See #375.
2019-11-19openpgp: Use the builder pattern for stream::Signer.Justus Winter
- See #375.
2019-09-10openpgp: Make 'LiteralWriter::new's arguments optional.Justus Winter
2019-08-23openpgp: Use marker types to denote a Key's type.Neal H. Walfield
- In addition to providing some added protection, this allows us to implement 'From<Key<_, _>> for Packet'.
2019-07-15Prepare for Rust 2018.Justus Winter
- This is the result of running `cargo fix --edition`, with some manual adjustments. - The vast majority of changes merely qualify module paths with 'crate::'. - Two instances of adding an anonymous pattern to a trait's function. - `async` is a keyword in Rust 2018, and hence it needs to be escaped (e.g. in the case of the net::r#async module). - The manual adjustments were needed due to various shortcomings of the analysis employed by `cargo fix`, e.g. unexpanded macros, procedural macros, lalrpop grammars.
2019-06-01openpgp: Simplify examples.Justus Winter
2019-03-26tool: Read passwords from the tty.Justus Winter
- Fixes #24.
2019-03-18openpgp: Make hash algorithm configurable in streaming Signer.Justus Winter
- See #208.
2019-03-14openpgp: Replace TPK::select_keys with an iterator.Neal H. Walfield
- TPK::select_keys mixes iterating and filtering. - Make KeyIter an implicit builder, which supports convenient filtering. - Provide a convenience function to key an iterator with a reasonable filter default.
2019-01-15openpgp: Hand a Vec<crypto::Signer> to stream::Signer.Justus Winter
- Using `crypto::Signer`s has several benefits. First, it shifts the decision which key to use to the caller, moving policy out of the caller. Second, it forces the caller to deal with encrypted keys. Finally, it allows us to use remote keys like smart cards in the future. - Fixes #142.
2018-12-14openpgp: Introduce trait Parse.Justus Winter
- Trait Parse introduces a uniform interface to parse packets, messages, keys, and related data structures.
2018-11-26openpgp: Update examples.Justus Winter
- The packet parser transparently strips armor now.
2018-11-24Rename the openpgp crate to sequoia-openpgp.Justus Winter
2018-11-14Avoid identity slicing.Justus Winter
2018-10-16openpgp: Improve the streaming writer API.Justus Winter
- Also, improve documentation and doctests.
2018-10-16openpgp: Improve examples.Justus Winter
- Fixes #112.
2018-08-22openpgp: Fix comment.Justus Winter
2018-08-14openpgp: Typos.Justus Winter
2018-07-24openpgp: Support setting ASCII-armor's headersNeal H. Walfield
2018-07-20openpgp: Rename finalize{,_all} to finalize{_one,}.Justus Winter
2018-07-10openpgp: Add and use a type for the literal data packet's format.Justus Winter
2018-07-10openpgp: Use broken-down time in the literal data packet.Justus Winter
- Also, make the `date` argument in the LiteralWriter's constructor optional, and explain what the parameters are for.
2018-07-04openpgp: Hide the `writer::Stackable` trait.Justus Winter
- Do not expose the `writer::Stackable` trait in the API. Instead, use a tuple struct to wrap boxed objects of this kind. - Add and use `writer::Stack::finalize()` and `writer::Stack::finalize_all()` to pop one or all writers from the stack.
2018-07-02openpgp: Implement detached signature generation in the Signer.Justus Winter
- Also, simplify the example accordingly. - Add an example for a normal signature.