File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,23 @@ var syncTypeRef = map[Synchronizable]C.CFTypeRef{
190
190
SynchronizableNo : C .CFTypeRef (C .kCFBooleanFalse ),
191
191
}
192
192
193
+ // DataProtection is the items data protection status
194
+ type UseDataProtectionKeychain int
195
+
196
+ const (
197
+ // UseDataProtectionKeychainYes enables data protection mode
198
+ UseDataProtectionKeychainYes = 1
199
+ // UseDataProtectionKeychainNo disables data protection mode
200
+ UseDataProtectionKeychainNo = 2
201
+ )
202
+
203
+ // DataProtectionKey is the key type for DataProtection
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 ),
208
+ }
209
+
193
210
// Accessible is the items accessibility
194
211
type Accessible int
195
212
@@ -303,6 +320,11 @@ func (k *Item) SetSynchronizable(sync Synchronizable) {
303
320
}
304
321
}
305
322
323
+ // SetSynchronizable sets the synchronizable attribute
324
+ func (k * Item ) SetUseDataProtectionKeychain (dataProtection UseDataProtectionKeychain ) {
325
+ k .attr [UseDataProtectionKey ] = dataProtectionTypeRef [dataProtection ]
326
+ }
327
+
306
328
// SetAccessible sets the accessible attribute
307
329
func (k * Item ) SetAccessible (accessible Accessible ) {
308
330
if accessible != AccessibleDefault {
You can’t perform that action at this time.
0 commit comments