diff --git a/keychain.go b/keychain.go index 0a51103..419a1aa 100644 --- a/keychain.go +++ b/keychain.go @@ -191,20 +191,20 @@ var syncTypeRef = map[Synchronizable]C.CFTypeRef{ } // DataProtection is the items data protection status -type DataProtection int +type UseDataProtectionKeychain int const ( - // DataProtectionYes enables data protection mode - DataProtectionYes = 1 - // DataProtectionNo disables data protection mode - DataProtectionNo = 2 + // UseDataProtectionKeychainYes enables data protection mode + UseDataProtectionKeychainYes = 1 + // UseDataProtectionKeychainNo disables data protection mode + UseDataProtectionKeychainNo = 2 ) // DataProtectionKey is the key type for DataProtection -var DataProtectionKey = attrKey(C.CFTypeRef(C.kSecUseDataProtectionKeychain)) -var dataProtectionTypeRef = map[DataProtection]C.CFTypeRef{ - DataProtectionYes: C.CFTypeRef(C.kCFBooleanTrue), - DataProtectionNo: C.CFTypeRef(C.kCFBooleanFalse), +var UseDataProtectionKey = attrKey(C.CFTypeRef(C.kSecUseDataProtectionKeychain)) +var dataProtectionTypeRef = map[UseDataProtectionKeychain]C.CFTypeRef{ + UseDataProtectionKeychainYes: C.CFTypeRef(C.kCFBooleanTrue), + UseDataProtectionKeychainNo: C.CFTypeRef(C.kCFBooleanFalse), } // Accessible is the items accessibility @@ -321,8 +321,8 @@ func (k *Item) SetSynchronizable(sync Synchronizable) { } // SetSynchronizable sets the synchronizable attribute -func (k *Item) SetKeychainDataProtection(dataProtection DataProtection) { - k.attr[DataProtectionKey] = dataProtectionTypeRef[dataProtection] +func (k *Item) SetUseDataProtectionKeychain(dataProtection UseDataProtectionKeychain) { + k.attr[UseDataProtectionKey] = dataProtectionTypeRef[dataProtection] } // SetAccessible sets the accessible attribute