You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The recently added bit tests method on KeyUsage doesn't give the expected result.
Reproduction
let key_usage = KeyUsage(KeyUsages::KeyEncipherment.into());println!("{}", key_usage.digital_signature());println!("{}", key_usage.0.contains(KeyUsages::DigitalSignature));
Output
true
false
Expected
false
false
This is due to the usage of KeyUsages::X as u16 which is not the same as the flag value. I'm preparing a PR. Would you like to keep the same API or have a wrapper function fn contains(&self, rhs: impl Into<FlagSet<KeyUsages>>) or maybe both ?
Activity