keychain

What is the best way to secure user's data saved locally in app and how to test security level?

浪子不回头ぞ 提交于 2019-12-05 17:12:28
After the recent attack on App Store I was thinking is the security meaures implemented in app for the user data security are enough? I know there is no guaranteed way to prevent attacks to your app’s data and logic but still we can frustrate attackers by implementing some kind of security .I am looking for the answers for the following questions. is NSUserDefault is secure? is Keychain Access is secure? Which is the better approach NSUserDefault or Keychain Access or any other recommended? After implementing is there any way I can test by attacking my app ? Store credentials for accessing

CLI: Switch keychains in order to sign an xcodebuild

ε祈祈猫儿з 提交于 2019-12-05 17:01:34
问题 I am trying to switch on a certain keychain, and close another one. I need this because our enterprise & appstore identities are called the same. Right now, I do a "security unlock-keychain" followed by a "security default-keychain" to open the correct keychain and do a "security lock-keychain" on the keychain I wish not to use. But xcodebuild still sees the entries in both keychains and gives up. iPhone Distribution: Company name.: ambiguous (matches "iPhone Distribution: Company name." in

Mac Code Signing: Bypass the Keychain Access private key prompt from Terminal

无人久伴 提交于 2019-12-05 15:44:32
问题 I'm working on an app in Mac OS X Mountain Lion that needs to access the private key of some of my certificates within the Keychain Access. Since this app is going to run on a server, I need to avoid the pop up dialog that requires the user to allow the app to access the private key: I know that by clicking "Always Allow" the dialog won't popup anymore for that private key, the problem is that I will be working with different keys. Thanks in advance, Mikywan. 回答1: The only way I found to

Listing system keychain certificates

ε祈祈猫儿з 提交于 2019-12-05 11:53:04
I'm developing an iOS application which needs access to the system certificates and keys for digitally signing data. I've done some research and I've found that theoretically it's not possible from a third party app to get access to the system keychain since it only has access to its own keychain. Here is a stackoverflow post explaining that. However, some applications like the Cisco AnyConnect show a list with all the system certificates for VPN configuration. That might mean that THERE ACTUALLY IS a way to get that system certificates list. This image shows how the certificates are displayed

KeychainItemWrapper crash on iOS10

点点圈 提交于 2019-12-05 10:10:45
When I try to add the item to Keychain i found this crash on iOS10 *** Assertion failure in -[KeychainItemWrapper writeToKeychain] On iOS 9.3 I write the key in the keychain without problem Thanks It looks like a bug; a bug report has been filed, but there's a workaround. Just enable "Keychain Sharing" (under your app -> Capabilities tab in Xcode). See https://forums.developer.apple.com/thread/51071 for full background. Edit: Ignore what I was rambling about... duh, forgot that under the project target's Capabilities tab I have also enabled Keychain sharing... Though still would like to get a

Reading from Keychain Xcode 9 simulators returns nothing

試著忘記壹切 提交于 2019-12-05 09:18:15
Since I'm using Xcode 9, all unit tests communicating with keychain are broken. It also happens with Xcode GM. As I traced, there is no OSStatus errors while reading and writing but reading from keychain returns nothing and causes failure for all unit tests using keychain. I've already faced something like this when Apple released Xcode 8 with iOS 10 simulator which keychain was not working and Apple fixed that in Xcode 8.2. Is anybody else facing this issue with iOS 11 simulator too? Any idea on this? Elyas Naranjee Sani Finally we found the problem. As @Gix said the problem is with unit

how to obtain SecIdentityRef from SecCertificateRef and PrivateKey?

我怕爱的太早我们不能终老 提交于 2019-12-05 08:02:33
How to create a SecIdentityRef if you have a SecCertificateRef and Private Key in iOS? I have a X509 certificate which is passed from server and an associated private key, but now I am struggling to establish trust in NSURLCredentials . A similar question was asked here How to establish a SecIdentityRef in an iPhone keychain ? (Without a .p12) As mentioned IMPORTANT in above post, i did create SecCertificateRef using SecCertificateCreateWithData first and then added into the keychain using SecItemAdd but don't know what to do now to generate SecIdentityRef. Many Thanks, Manish P.S. - I don't

How do you write to the OSX System keychain?

浪尽此生 提交于 2019-12-05 04:03:20
问题 As part of the process of creating a VPN connection programatically in OSX, using Cocoa, I need to store the PPP password in the System keychain. When I try to do this using the keychain API, I get the following error as a result of calling SecKeychainAddGenericPassword: "Could not write to the file. It may have been opened with insufficient access privileges." Here is the code I am using: - (void)storePasswordInKeychain { SecKeychainRef keychain = nil; err = SecKeychainCopyDomainDefault

Apple keychain private/public key issue

蓝咒 提交于 2019-12-05 02:29:44
I accidentally deleted the private and public key pair of my certificate, but I can't find anything helpful to undo or add those to my certificate again. Actually the developement certificate has expired, so i redownloaded the new one. Than I wanted to add the private/public key to my new certificate. And there it happend, i deleted it. How can I get these and set them to my actual certificate again. I had this issue two days ago. Open Keychain Access What you have to do is make backups of all your certificates and then go and delete all the private and public keys and certificates on your

SecItemAdd creating two identities

瘦欲@ 提交于 2019-12-05 01:46:16
问题 I'm developing an application for IPhone that needs a certificate to call some services, so I'm adding a certificate to my keychain doing this: SecCertificateRef cert = SecCertificateCreateWithData(NULL, (__bridge CFDataRef) certificadoData); NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] init]; [dictionary setObject:(__bridge id)kSecClassCertificate forKey:(__bridge id)kSecClass]; [dictionary setObject:(__bridge id)(cert) forKey:(__bridge id<NSCopying>)(kSecValueRef)];