1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Cryptographic interfaces and definitions.
//!
//! Many `OAuth2` grants and auxiliary interfaces require cryptographic
//! operations to ensure properties such as integrity, authentication,
//! confidentiality, and non-repudiation.
//!
//! This module holds the signing ([`signer`]), verification ([`verifier`]), and
//! encryption ([`cipher`]) traits, plus the shared key-matching types
//! ([`KeyMatchStrength`]). Concrete implementations live in platform crates.
//!
//! Each base trait comes with a family of composable wrappers (multi-key,
//! refreshable, scheduled-refresh, retrying) that decorate it without changing
//! its interface. See [composing crypto
//! strategies](crate::_docs::explanation::crypto_strategies) for how they stack.
pub
/// States how well a particular key matched the selection criteria from a JOSE header.
///
/// Used by both JWS verifiers and JWE ciphers to express the strength of a key match,
/// allowing multi-key types to prefer exact matches over algorithm-only matches.
/// The shared `kid` half of the key-matching rules, applied after the
/// algorithm has already been found compatible: both sides present and equal
/// is a `ByKeyId` match, both present and different is a mismatch, and a
/// `kid` missing on either side falls back to `ByAlgorithm`.
pub