-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sha2: provide support for
spki::AlgorithmIdentifier
This implements `AlgorithmIdentifier` according to [RFC5754 section 2] [RFC5754 section 2]: https://www.rfc-editor.org/rfc/rfc5754#section-2
- Loading branch information
Showing
5 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//! Implements [`AlgorithmIdentifier`] according to [RFC5754 section 2] | ||
//! | ||
//! [RFC5754 section 2]: https://www.rfc-editor.org/rfc/rfc5754#section-2 | ||
|
||
use digest::{ | ||
const_oid::AssociatedOid, | ||
spki::{der::asn1::AnyRef, AlgorithmIdentifierRef, AssociatedAlgorithmIdentifier}, | ||
}; | ||
|
||
use super::{OidSha224, OidSha256, OidSha384, OidSha512}; | ||
|
||
macro_rules! impl_aai { | ||
($name:ident) => { | ||
impl AssociatedAlgorithmIdentifier for $name { | ||
type Params = AnyRef<'static>; | ||
|
||
const ALGORITHM_IDENTIFIER: AlgorithmIdentifierRef<'static> = AlgorithmIdentifierRef { | ||
oid: Self::OID, | ||
parameters: None, | ||
}; | ||
} | ||
}; | ||
} | ||
|
||
impl_aai!(OidSha224); | ||
impl_aai!(OidSha256); | ||
impl_aai!(OidSha384); | ||
impl_aai!(OidSha512); |