Skip to content

Commit

Permalink
Typo fixes in lib.rs and algorithms/mod.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrudy committed Dec 2, 2023
1 parent 8b0ffe1 commit 5fe6b1a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
17 changes: 16 additions & 1 deletion src/algorithms/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,22 @@ impl signature::SignatureEncoding for SignatureBytes {
type Repr = Bytes;
}

/// A macro to implement the required traits for common JWS alogorithms.
/// Implement the signing and verifying traits for a particular algorithm
/// which uses deterministic digest signing and verification.
///
/// This macro is used to implement the [`TokenSigner`] and [`TokenVerifier`] traits
/// for a particular algorithm, when the algorithm signer implements the
/// [`signature::DigestSigner`] trait and the algorithm verifier implements
/// the [`signature::DigestVerifier`] trait. It is intended to apply to a single
/// digest to allow for uniquely specifying the JWS [`AlgorithmIdentifier`].
///
/// The macro takes the following arguments:
///
/// - `$alg`: The name of the algorithm, which must be a valid [`AlgorithmIdentifier`].
/// - `$signer`: The type of the signer, which must implement [`signature::DigestSigner`].
/// - `$verifier`: The type of the verifier, which must implement [`signature::DigestVerifier`].
/// - `$digest`: The type of the digest, which must implement [`digest::Digest`].
/// - `$signature`: The type of the signature, which must implement [`signature::SignatureEncoding`].
#[macro_export]
macro_rules! jose_algorithm {
($alg:ident, $signer:ty, $verifier:ty, $digest:ty, $signature:ty) => {
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ ecosystem.
//! Most of the traits are designed to be object-safe when used with the [`Token`] type,
//! so that they can be used with a single type-erased key type.
//!
//! Since RustCrypto [signature](https://docs.rs/signature/latest/signature/) signing and
//! RustCrypto [signature](https://docs.rs/signature/latest/signature/) signing and
//! verifying traits are generic over the signature type, to allow for optimizations
//! from specific signature algorithms to be applied. When using a type-erased keys,
//! this is not possible, so the [`TokenSigner`] and [`TokenVerifier`] traits are
//! from specific signature algorithms to be used when desired. When using a type-erased
//! keys, this is not possible, so the [`TokenSigner`] and [`TokenVerifier`] traits are
//! also designed to work with the [`SignatureBytes`] type, which is a type-erased
//! signature type.
//!
Expand Down

0 comments on commit 5fe6b1a

Please sign in to comment.