blochberger / Keychain

Convenient Swift bindings for Keychain services on iOS and macOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Keychain

Build Status Coverage Documentation

Convenient Swift bindings for the Keychain services.

The project is not supporting many Keychain features. If you want more, create or vote for an issue, or create a pull request. Before creating pull requests, you can discuss the intended change by creating an issue first.

Examples

Generic Passwords

import Keychain

let account = "user" // A user account, for which the password is used
let service = "service" // A service, e.g., your app name
let label = "\(account)@\(service)" // Descriptive name

let item = GenericPasswordItem(for: service, using: account, with: label)

// Store password
try Keychain.store(password: "foo", in: item)

// Retrieve password
let password = try Keychain.retrievePassword(for: item)

// Update password
try Keychain.update(password: "bar", for: item)

// Delete item
try Keychain.delete(item: item)

About

Convenient Swift bindings for Keychain services on iOS and macOS

License:ISC License


Languages

Language:Swift 82.0%Language:Shell 15.0%Language:Python 1.8%Language:Objective-C 1.1%