Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add accessibility support to SecKey, SecKeyPair, SecCertificate & SecIdentity #78

Merged
merged 7 commits into from
Oct 17, 2023

Conversation

kdubb
Copy link
Collaborator

@kdubb kdubb commented Oct 16, 2023

Allows selecting accessibility (i.e. kSecAttrAccessible) when generating or saving items.

As a requirement we add kSecUseDataProtectionKeychain to keychain requests. This has the benefit of normalizing keychain access across macOS & iOS, tvOS, watchOS); allowing the removal of the last usage of #if os(macOS)/#endif when accessing the keychain.

SecKey.attributes() now retrieves all attributes from using SecItemCopyMatching instead of SecKeyCopyAttributes; this is backward compatible with previous functionality with more attributes. SecKey.keyAttributes() can be used to get previous smaller list of attributes (which may also be faster).

… & `SecIdentity`

Allows selecting accessibility (i.e. `kSecAttrAccessible`) when generating or saving items.

As a requirement we add `kSecUseDataProtectionKeychain` to keychain requests. This has the benefit of normalizing keychain access across macOS & iOS, tvOS, watchOS); allowing the removal of the last usage of `#if os(macOS)/#endif` when accessing the keychain.

`SecKey.attributes()` now retrieves _all_ attributes from using `SecItemCopyMatching` instead of  `SecKeyCopyAttributes`; this is backward compatible with previous functionality with _more_ attributes. `SecKey.keyAttributes()` can be used to get previous _smaller_ list of attributes (which may also be faster).
@kdubb kdubb force-pushed the feature/accessibility branch 2 times, most recently from 59e41c3 to 5d8a76e Compare October 17, 2023 02:41
@sonarcloud
Copy link

sonarcloud bot commented Oct 17, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

85.6% 85.6% Coverage
0.0% 0.0% Duplication

@kdubb kdubb merged commit 4d6b38a into main Oct 17, 2023
12 checks passed
@kdubb kdubb deleted the feature/accessibility branch October 17, 2023 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant