Post

Replies

Boosts

Views

Activity

kSecUseOperationPrompt Text not displayed (iOS 13 only)
In my app i use the iOS keychain to store a private key (ec-256) for message signature.The code is working since iOS 11, but I can experience with iOS 13, that the TouchID popup when accessing the private key in the keychain is missing the custom text. It only shows one line: TouchID for "<APP NAME>", the custom text is not displayed. Using iOS 11 and iOS 12, there is a second line in the TouchID popup below that line.Code to generate/store the key in the keychain:let access: SecAccessControl if #available(iOS 11.3, *) { access = SecAccessControlCreateWithFlags(kCFAllocatorDefault, kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, [.privateKeyUsage, .biometryCurrentSet], nil)! } else { access = SecAccessControlCreateWithFlags(kCFAllocatorDefault, kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, [.privateKeyUsage, .touchIDCurrentSet], nil)! } let attributes = [ kSecAttrKeyClass: kSecAttrKeyClassPrivate, kSecAttrKeyType: kSecAttrKeyTypeECSECPrimeRandom, kSecAttrKeySizeInBits: 256, kSecAttrTokenID: kSecAttrTokenIDSecureEnclave, kSecPrivateKeyAttrs: [ kSecAttrIsPermanent: true, kSecAttrApplicationTag: keyTag, kSecAttrAccessControl: access ] as [String: Any] ] as [String: Any] var error: Unmanaged<CFError>? guard let privateKey = SecKeyCreateRandomKey(attributes as CFDictionary, &error) else { throw error!.takeRetainedValue() as Error }Code to retrieve the private key to sign a message:let authenticationText = NSLocalizedString("BIOMETRICS_LOGIN__FINGERPRINT_REQUEST_MESSAGE", comment: "") let query = [ kSecClass: kSecClassKey, kSecAttrKeyClass: kSecAttrKeyClassPrivate, kSecUseOperationPrompt: "\(authenticationText) \(accountId)", kSecAttrApplicationTag: keyTag, kSecAttrKeyType: kSecAttrKeyTypeECSECPrimeRandom, kSecReturnRef: true ] as [String: Any] var item: CFTypeRef? let status = SecItemCopyMatching(query as CFDictionary, &item) guard status == errSecSuccess else { throw AccountStorageError.privateKeyNotFound } let privateKey = item as! SecKeyThe above code works in all supported iOS versions (11, 12, 13 up to 13.2.3), private keys can be stored and retrieved, but only on iOS 13 devices, the text specified in kSecUseOperationPrompt is not displayed in the TouchID popup.Is there something wrong or is this a known issue in iOS 13?
6
0
2.1k
Dec ’19
Open files from Photo App with own app by using the Share Sheet
I want to open photos within the photo app with my app. My app already supports opening the file types public.png, public.jpeg, public.image <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeName</key> <string>My Files</string> <key>LSHandlerRank</key> <string>Alternate</string> <key>LSItemContentTypes</key> <array> <string>com.adobe.pdf</string> <string>public.png</string> <string>public.jpeg</string> </array> </dict> </array> It works fine when a file of the given filetypes is opened in the Files App or as Attachment from Mail. If I click the share icon, my app appears in the Share Sheet. When selected, my app opens in full screen mode and is able to access the file. But when I select a Photo in the Photo app, my app does not appear as option in the share sheet. Does anybody know why? I am not interested in opening a Share Extension Sheet of my app. What I want is opening my app in full screen mode with the ability to access the shared file. I can see apps which are able to do exactly what I want. But I do not find any hints in the official docs. Has anybody hints on how I can achieve this?
0
0
820
Feb ’23