Skip to content

Conversation

@dishmaker
Copy link
Contributor

It's needed for generic Application, ContextSpecific, Private tags.

My old PR:

This PR contains der/src/tag/class.rs

.bits() will be used in generic wrappers like this:

impl<'a, const TAG: u32, T, const CLASS: u8> Choice<'a> for CustomClassExplicit<TAG, T, CLASS>
where
    T: Decode<'a> + Tagged,
{
    fn can_decode(tag: Tag) -> bool {
        tag.class().bits() == CLASS && tag.number() == TagNumber(TAG)
    }
}

and consts like this:

/// Application class wrapper, EXPLICIT
pub type ApplicationExplicit<const TAG: u32, T> = CustomClassExplicit<TAG, T, CLASS_APPLICATION>;

@baloo baloo merged commit 937e611 into RustCrypto:master Mar 24, 2025
107 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants