{"id":18031765,"url":"https://github.com/dagronf/dsfsimplekeychainpassword","last_synced_at":"2025-08-10T20:06:31.572Z","repository":{"id":149491905,"uuid":"160988325","full_name":"dagronf/DSFSimpleKeychainPassword","owner":"dagronf","description":"Simple Swift wrapper around keychain generic password handling","archived":false,"fork":false,"pushed_at":"2018-12-08T23:40:53.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T21:45:54.966Z","etag":null,"topics":["keychain","macos","swift"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dagronf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-08T23:40:29.000Z","updated_at":"2023-12-05T06:02:58.000Z","dependencies_parsed_at":"2024-07-17T02:05:30.551Z","dependency_job_id":null,"html_url":"https://github.com/dagronf/DSFSimpleKeychainPassword","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dagronf/DSFSimpleKeychainPassword","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FDSFSimpleKeychainPassword","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FDSFSimpleKeychainPassword/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FDSFSimpleKeychainPassword/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FDSFSimpleKeychainPassword/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dagronf","download_url":"https://codeload.github.com/dagronf/DSFSimpleKeychainPassword/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FDSFSimpleKeychainPassword/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269780617,"owners_count":24474686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["keychain","macos","swift"],"created_at":"2024-10-30T10:10:42.679Z","updated_at":"2025-08-10T20:06:31.524Z","avatar_url":"https://github.com/dagronf.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DSFSimpleKeychain\n\nA simple Swift wrapper around keychain functions for storing and retrieving keychain 'generic passwords'\n\n## Create a keychain password\n\n\t\tlet service = DSFSimpleKeychain.Service(\"My Application Data\")\n\t\tlet addAccountStatus = service.add(accountNamed: \"AWSLoginID\", password: \"\u003cpassword\u003e\")\n\t\tif case .success(let addAccountInfo) = addAccountStatus\n\t\t{\n\t\t\tprint(\"Created account: \\(addAccountInfo.account)\")\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprint(\"Unable to create password\")\n\t\t\treturn\n\t\t}\n\n### Command line equivalent\n\n\t\t$ security add-generic-password -s \"My Application Data\" -a \"AWSLoginID\" -w \"\u003cpassword\u003e\"\n\n## List the stored passwords for a service\n\n\t\tlet service = DSFSimpleKeychain.Service(\"My Application Data\")\n\t\tlet allAccounts = service.accounts()\n\t\tif case .success(let accounts) = allAccounts\n\t\t{\n\t\t\tprint(\"Found accounts: \\(accounts)\")\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprint(\"Unable to retrieve account information\")\n\t\t}\n\n## Retrieve a keychain password\n\n\t\tlet service = DSFSimpleKeychain.Service(\"My Application Data\")\n\t\tlet retrieveStatus = service.retrieve(accountNamed: \"AWSLoginID\")\n\t\tguard case .success(let accountInfo) = retrieveStatus else\n\t\t{\n\t\t\tprint(\"Unable to retrieve password\")\n\t\t\treturn\n\t\t}\n\t\tprint(\"Password is \\(accountInfo.password)\")\n\n### Command line equivalent\n\t\t\n\t\t$ security find-generic-password -s \"My Application Data\" -a \"AWSLoginID\" -w\n\t\t\u003cpassword\u003e\n\n## Delete a password from the keychain\n\n\t\tlet service = DSFSimpleKeychain.Service(\"My Application Data\")\n\t\tlet deleteResult = service.delete(accountNamed: \"AWSLoginID\")\n\t\tif deleteResult != DSFSimpleKeychain.Status.success\n\t\t{\n\t\t\tprint(\"Unable to delete password\")\n\t\t\treturn\n\t\t}\n\n### Command line equivalent\n\n\t\t$ security delete-generic-password -s \"My Application Data\" -a \"AWSLoginID\" \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdagronf%2Fdsfsimplekeychainpassword","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdagronf%2Fdsfsimplekeychainpassword","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdagronf%2Fdsfsimplekeychainpassword/lists"}