//! Produce & verify TrueLayer API `Tl-Signature` request headers.
//!
//! # Example
//! ```no_run
//! # fn main() -> Result<(), truelayer_signing::Error> {
//! # let (kid, private_key, idempotency_key, body) = unimplemented!();
//! // `Tl-Signature` value to send with the request.
//! let tl_signature = truelayer_signing::sign_with_pem(kid, private_key)
//! .method("POST")
//! .path("/payouts")
//! .header("Idempotency-Key", idempotency_key)
//! .body(body)
//! .sign()?;
//! # Ok(()) }
//! ```
pub use JwsHeader;
pub use Signer;
pub use Verifier;
/// Start building a request `Tl-Signature` header value using private key
/// pem data & the key's `kid`.
///
/// # Example
/// ```no_run
/// # fn main() -> Result<(), truelayer_signing::Error> {
/// # let (kid, private_key, idempotency_key, body) = unimplemented!();
/// let tl_signature = truelayer_signing::sign_with_pem(kid, private_key)
/// .method("POST")
/// .path("/payouts")
/// .header("Idempotency-Key", idempotency_key)
/// .body(body)
/// .sign()?;
/// # Ok(()) }
/// ```
/// Start building a `Tl-Signature` header verifier using public key pem data.
///
/// # Example
/// ```no_run
/// # fn main() -> Result<(), truelayer_signing::Error> {
/// # let (public_key, idempotency_key, body, tl_signature) = unimplemented!();
/// truelayer_signing::verify_with_pem(public_key)
/// .method("POST")
/// .path("/payouts")
/// .require_header("Idempotency-Key")
/// .header("Idempotency-Key", idempotency_key)
/// .body(body)
/// .verify(tl_signature)?;
/// # Ok(()) }
/// ```
/// Start building a `Tl-Signature` header verifier using public key JWKs JSON response data.
///
/// See <https://datatracker.ietf.org/doc/html/rfc7517>.
///
/// # Example
/// ```no_run
/// # fn main() -> Result<(), truelayer_signing::Error> {
/// # let (jwks, body, tl_signature) = unimplemented!();
/// # let headers: Vec<(&str, &[u8])> = unimplemented!();
/// // jwks json of form: {"keys":[...]}
/// truelayer_signing::verify_with_jwks(jwks)
/// .method("POST")
/// .path("/webhook")
/// .headers(headers)
/// .body(body)
/// .verify(tl_signature)?;
/// # Ok(()) }
/// ```
/// Extract [`JwsHeader`] info from a `Tl-Signature` header value.
///
/// This can then be used to pick a verification key using the `kid` etc.
/// Sign/verification error.