Skip to content

Commit

Permalink
Add modern keys to control keychain access.
Browse files Browse the repository at this point in the history
This keys replace deprecated ones that was specific to TouchID,
and allow to use FaceID feature as well (tested on iPhone X device).
  • Loading branch information
savelichalex committed Apr 11, 2019
1 parent 28fa85c commit f7eb22b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export enum RNSensitiveInfoAccessControlOptions {
'kSecAccessControlTouchIDAny',
'kSecAccessControlTouchIDCurrentSet',
'kSecAccessControlUserPresence',
'kSecAccessControlBiometryAny',
'kSecAccessControlBiometryCurrentSet',
}

export enum RNSensitiveInfoAttrAccessibleOptions {
Expand Down
6 changes: 6 additions & 0 deletions ios/RNSensitiveInfo/RNSensitiveInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ CFStringRef convertkSecAttrAccessible(NSString* key){
if([key isEqual: @"kSecAttrAccessibleAlwaysThisDeviceOnly"]){
return kSecAttrAccessibleAlwaysThisDeviceOnly;
}
if ([key isEqual: @"kSecAccessControlBiometryAny"]) {
return kSecAccessControlBiometryAny;
}
if ([key isEqual: @"kSecAccessControlBiometryCurrentSet"]) {
return kSecAccessControlBiometryCurrentSet;
}
return kSecAttrAccessibleWhenUnlocked;
}

Expand Down

0 comments on commit f7eb22b

Please sign in to comment.