KeychainManager

KCM Logo

Keychain Manager

Keychain Manager is a Layer-2 framework built over Keychain API which helps in using Keychain in all your Apple devices with easiness and flexibility. It focuses on using all the power of Keychain with high simplicity. The easy to use methods of Keychain Manager helps to setup Keychain on any Apple device with great convenience.

📔 Usage

⚙ī¸ Intilisation

Before using any Keychain Manager methods we need to intialise the class. Keychain Manager supports various types of inilisation which depends upon variety of use cases

đŸ—ŗ Basic Initialisation

let KCM = KeychainManager()

đŸ—ŗ Prefix Initiliser

đŸ—ŗ Sharable Initiliser

let KCM = KeychainManager(accessGroup: "TeamID.KeychainGroupID", synchronizable: true)

đŸ—ŗ Prefix + Sharable

 let KCM = KeychainManager(keyPrefix: "test", accessGroup: "TeamID.KeychainGroupID", synchronizable: true)

🛠 Operations

Following are the methods which help to perfrom various operations:

🔑 SET

String

KCM.set(value: "value", service: service_ID, account: account_name)

Bool

KCM.set(value: true, service: service_ID, account: account_name)

Custom Object

KCM.set(object: Any_Codable_Object, service: service_ID, account: account_name)

Web Credentials

KCM.set(server: server_ID, account: account_name, password: password)

Tip: Make sure Account, Service & Server parameter must be unique for every item.

🔑 GET

String

let value = KCM.get(service: service_ID, account: account_name)

Bool

let value = KCM.getBool(service: service_ID, account: account_name)

Custom Object

 let value = KCM.get(object: Any_Codable_Object, service: service_ID, account: account_name)

Web Credentials

let value = KCM.get(server: server_ID, account: account_name)

Get All Values

🔑 UPDATE

String

KCM.update(value: "value", service: service_ID, account: account_name)

Bool

KCM.update(value: true, service: service_ID, account: account_name)

Custom Object

KCM.update(object: Any_Codable_Object, service: service_ID, account: account_name)

Web Credentials

KCM.update(server: server_ID, account: account_name, password: password)

🔑 DELETE

Service Deletion

 do {
    try KCMTest.delete(service: service_ID, isCustomObjectType: false)
 }
 catch {
    print(error.localizedDescription)
}

Server Deletion

 do {
    try KCMTest.delete(server: server_ID)
 }
 catch {
    print(error.localizedDescription)
}

🔑 VALIDATE

Service

 if KCM.isValidService(service: service_ID, account: account_name) {
        print("🙂")
 } else {
        print("☚ī¸")
 }

Server

 if KCM.isValidService(server: server_ID, account: account_name) {
     print("🙂")
 } else {
     print("☚ī¸")
 }

☁ī¸ iCloud Sync

📱 Device Supported

| No | Device | Version | | – | – | – | | 1 | iOS | 13.0.0 + | | 2 | iPadOS | 13.0.0 + | | 3 | WatchOS | 6.0.0 +| | 4 | MacOS | 11.0.0 + | | 5 | tvOS | 11.0.0 + |

📌 Keynotes

Make sure you know these keynotes before using Keychain Manager

đŸ“Ļ SPM

Keychain Manger is available through Swift Package Manager. To add Keychain Manager through SPM

https://github.com/gokulnair2001/KeychainManager

SPM Dialogue

🌐 Keychain Sharing

Keychain Sharing Capability

Screenshot 2022-06-17 at 3 38 39 PM

đŸĒ„ How to contribute ?

⚖ī¸ License

Like the framework ?

BMC logo+wordmark - Black

Made with ❤ī¸ in 🇮đŸ‡ŗ By Gokul Nair