-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for JWK thumbprints (RFC 7638) (#156)
* Add support for JWK thumbprints (RFC 7638) * Expand thumbprint tests * Add a test for badly-normalized values This is for the RSA exponent case; other members / key types have not been checked. * JWK thumbprints: Hide ring from public API, expand documentation
- Loading branch information
Showing
6 changed files
with
217 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//! Secure cryptographic digests | ||
//! | ||
//! Currently used by JWK thumbprints. | ||
//! This simply wraps the ring::digest module, while providing forward compatibility | ||
//! should the implementation change. | ||
/// A digest algorithm | ||
pub struct Algorithm(pub(crate) &'static ring::digest::Algorithm); | ||
|
||
// SHA-1 as specified in FIPS 180-4. Deprecated. | ||
// SHA-1 is not exposed at the moment, as the only user is JWK thumbprints, | ||
// which postdate SHA-1 deprecation and don't have a backwards-compatibility reason to use it. | ||
//pub static SHA1_FOR_LEGACY_USE_ONLY: Algorithm = Algorithm(&ring::digest::SHA1_FOR_LEGACY_USE_ONLY); | ||
|
||
/// SHA-256 as specified in FIPS 180-4. | ||
pub static SHA256: Algorithm = Algorithm(&ring::digest::SHA256); | ||
|
||
/// SHA-384 as specified in FIPS 180-4. | ||
pub static SHA384: Algorithm = Algorithm(&ring::digest::SHA384); | ||
|
||
/// SHA-512 as specified in FIPS 180-4. | ||
pub static SHA512: Algorithm = Algorithm(&ring::digest::SHA512); | ||
|
||
/// SHA-512/256 as specified in FIPS 180-4. | ||
pub static SHA512_256: Algorithm = Algorithm(&ring::digest::SHA512_256); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters