-
Notifications
You must be signed in to change notification settings - Fork 173
Closed
Description
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 ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels