Skip to content

Commit 30aa35d

Browse files
committed
Deprecate direct field access in GenerateKeyOptions
1 parent 65cf819 commit 30aa35d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

security-framework/src/key.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,20 +363,27 @@ pub enum Token {
363363
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
364364
pub struct GenerateKeyOptions {
365365
/// kSecAttrKeyType
366+
#[deprecated(note = "use set_key_type()")]
366367
pub key_type: Option<KeyType>,
367368
/// kSecAttrKeySizeInBits
369+
#[deprecated(note = "use set_size_in_bits()")]
368370
pub size_in_bits: Option<u32>,
369371
/// kSecAttrLabel
372+
#[deprecated(note = "use set_label()")]
370373
pub label: Option<String>,
371374
/// kSecAttrTokenID
375+
#[deprecated(note = "use set_token()")]
372376
pub token: Option<Token>,
373377
/// Which keychain to store the key in, if any.
378+
#[deprecated(note = "use set_location()")]
374379
pub location: Option<Location>,
375380
/// Access control
381+
#[deprecated(note = "use set_access_control()")]
376382
pub access_control: Option<SecAccessControl>,
377383
}
378384

379385
#[cfg(any(feature = "OSX_10_12", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))]
386+
#[allow(deprecated)]
380387
impl GenerateKeyOptions {
381388
/// Set `key_type`
382389
pub fn set_key_type(&mut self, key_type: KeyType) -> &mut Self {

0 commit comments

Comments
 (0)