Skip to content

Commit 69ec86a

Browse files
committed
Rename variables and functions to match Apple
1 parent 9ab73c4 commit 69ec86a

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

keychain.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -191,20 +191,20 @@ var syncTypeRef = map[Synchronizable]C.CFTypeRef{
191191
}
192192

193193
// DataProtection is the items data protection status
194-
type DataProtection int
194+
type UseDataProtectionKeychain int
195195

196196
const (
197-
// DataProtectionYes enables data protection mode
198-
DataProtectionYes = 1
199-
// DataProtectionNo disables data protection mode
200-
DataProtectionNo = 2
197+
// UseDataProtectionKeychainYes enables data protection mode
198+
UseDataProtectionKeychainYes = 1
199+
// UseDataProtectionKeychainNo disables data protection mode
200+
UseDataProtectionKeychainNo = 2
201201
)
202202

203203
// DataProtectionKey is the key type for DataProtection
204-
var DataProtectionKey = attrKey(C.CFTypeRef(C.kSecUseDataProtectionKeychain))
205-
var dataProtectionTypeRef = map[DataProtection]C.CFTypeRef{
206-
DataProtectionYes: C.CFTypeRef(C.kCFBooleanTrue),
207-
DataProtectionNo: C.CFTypeRef(C.kCFBooleanFalse),
204+
var UseDataProtectionKey = attrKey(C.CFTypeRef(C.kSecUseDataProtectionKeychain))
205+
var dataProtectionTypeRef = map[UseDataProtectionKeychain]C.CFTypeRef{
206+
UseDataProtectionKeychainYes: C.CFTypeRef(C.kCFBooleanTrue),
207+
UseDataProtectionKeychainNo: C.CFTypeRef(C.kCFBooleanFalse),
208208
}
209209

210210
// Accessible is the items accessibility
@@ -321,8 +321,8 @@ func (k *Item) SetSynchronizable(sync Synchronizable) {
321321
}
322322

323323
// SetSynchronizable sets the synchronizable attribute
324-
func (k *Item) SetKeychainDataProtection(dataProtection DataProtection) {
325-
k.attr[DataProtectionKey] = dataProtectionTypeRef[dataProtection]
324+
func (k *Item) SetUseDataProtectionKeychain(dataProtection UseDataProtectionKeychain) {
325+
k.attr[UseDataProtectionKey] = dataProtectionTypeRef[dataProtection]
326326
}
327327

328328
// SetAccessible sets the accessible attribute

0 commit comments

Comments
 (0)