Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/workingdog/keychainclass

Swift simple keychain access class
https://github.com/workingdog/keychainclass

Last synced: about 5 hours ago
JSON representation

Swift simple keychain access class

Awesome Lists containing this project

README

        

# KeychainClass
Swift simple keychain access class

Usage:

KeychainInterface.service = "test.com.test"
KeychainInterface.account = "test.com.apikey"

func doSaveKey(_ theKey: String) {
// if there is no key, store `theKey` in keychain
if KeychainInterface.getKey() == nil {
KeychainInterface.setKey(key: theKey)
} else {
// if there is already a key in keychain, must use update to override the old one
KeychainInterface.updateKey(key: theKey)
}
}

Note, make sure you have set your App.entitlements that includes:

keychain-access-groups

$(AppIdentifierPrefix)test.com.test