diff --git a/bind/bind.go b/bind/bind.go index c677d69..16543c2 100644 --- a/bind/bind.go +++ b/bind/bind.go @@ -7,7 +7,7 @@ import ( "fmt" "reflect" - "github.com/keybase/go-keychain" + "github.com/cloudengio/go-keychain" ) // Test is a bind interface for the test diff --git a/bindtest/bind_test.go b/bindtest/bind_test.go index 8acb92c..9c6652b 100644 --- a/bindtest/bind_test.go +++ b/bindtest/bind_test.go @@ -6,7 +6,7 @@ package bindtest import ( "testing" - "github.com/keybase/go-keychain/bind" + "github.com/cloudengio/go-keychain/bind" "github.com/stretchr/testify/require" ) diff --git a/go.mod b/go.mod index cbaa2fe..fb55fe9 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/keybase/go-keychain +module github.com/cloudengio/go-keychain go 1.21 diff --git a/keychain.go b/keychain.go index 7d0a1ac..cc51648 100644 --- a/keychain.go +++ b/keychain.go @@ -185,6 +185,8 @@ var ( CreationDateKey = attrKey(C.CFTypeRef(C.kSecAttrCreationDate)) // ModificationDateKey is for kSecAttrModificationDate ModificationDateKey = attrKey(C.CFTypeRef(C.kSecAttrModificationDate)) + + DataProtectionKeyChainKey = attrKey(C.CFTypeRef(C.kSecUseDataProtectionKeychain)) ) // Synchronizable is the items synchronizable status @@ -362,6 +364,15 @@ func (k *Item) SetSynchronizable(sync Synchronizable) { } } +// SetDataProtectionKeyChain sets the data protection keychain attribute. +func (k *Item) SetDataProtectionKeyChain(value bool) { + if value { + k.attr[DataProtectionKeyChainKey] = true + } else { + delete(k.attr, DataProtectionKeyChainKey) + } +} + // SetAccessible sets the accessible attribute func (k *Item) SetAccessible(accessible Accessible) { if accessible != AccessibleDefault {