File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ pub enum Profile {
90
90
issuer : Name ,
91
91
/// should the key agreement flag of KeyUsage be enabled
92
92
enable_key_agreement : bool ,
93
+ /// should the key encipherment flag of KeyUsage be enabled
94
+ enable_key_encipherment : bool ,
93
95
} ,
94
96
#[ cfg( feature = "hazmat" ) ]
95
97
/// Opt-out of the default extensions
@@ -169,11 +171,13 @@ impl Profile {
169
171
}
170
172
Profile :: Leaf {
171
173
enable_key_agreement,
174
+ enable_key_encipherment,
172
175
..
173
176
} => {
174
- let mut key_usage = KeyUsages :: DigitalSignature
175
- | KeyUsages :: NonRepudiation
176
- | KeyUsages :: KeyEncipherment ;
177
+ let mut key_usage = KeyUsages :: DigitalSignature | KeyUsages :: NonRepudiation ;
178
+ if * enable_key_encipherment {
179
+ key_usage |= KeyUsages :: KeyEncipherment ;
180
+ }
177
181
if * enable_key_agreement {
178
182
key_usage |= KeyUsages :: KeyAgreement ;
179
183
}
Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ fn leaf_certificate() {
116
116
let profile = Profile :: Leaf {
117
117
issuer,
118
118
enable_key_agreement : false ,
119
+ enable_key_encipherment : false ,
119
120
} ;
120
121
121
122
let subject = Name :: from_str ( "CN=service.domination.world" )
You can’t perform that action at this time.
0 commit comments