Adds a marker trait for `Signature` types computable as `S(H(m))` where:
- `S`: signature algorithm
- `H`: hash (a.k.a. digest) function
- `m`: message
For signature types that implement this trait, a blanket impl of
`Signer` will be provided for all types that
`impl signature::digest::Signer`.
Some sweeping refactoring here which hopefully cleans up the project
organization and helps simplify its implementation:
- `Sign` => `Signer`, `Verify` => `Verifier`
- Move all `digest`-related functionality under the `digest` module:
- `signature::digest::Signer`
- `signature::digest::Verifier`
- Re-export `::digest::Digest` as `signature::digest::Digest`
- Remove `Send` + `Sync` bounds on traits: if people wants these bounds
they can add them themselves.
Replaces the previous error enum with a struct that, on `std`, contains
an optional cause which is captured as `Box<std::error::Error>`.
This allows the core signature traits to remain object safe (since they
don't need a generic error type) but also allows passing through a
provider-specific error type, e.g. for HSMs which may have any number
of errors which prevent a signature operation from occuring (e.g. I/O
errors, authentication errors, missing keys).
It also includes downcast methods that conveniently allow extracting
provider-specific errors as concrete types if so desired.
Adds a `Signature` trait which serialized signature types implement.
Adds an initial `Error` type to be returned from `Signature::from_bytes`
in the event the signature is not valid.