keychain

Whats the Correct Way to Prompt a User for their Password?

我的未来我决定 提交于 2019-12-13 18:51:58
问题 This is a follow up to this question. If I'm going to store a user's username and password with Keychain Services, should I simply create my own prompt view with an NSSecureTextField for the password, and then once the user enters their info pass it to a Keychain Services API (I found this one)? I'm concerned Apple won't like me interacting with a users sensitive data directly like that. 回答1: this sounds like the appropriate thing to do. The following function calls will do the stuff you need

Is there any advantage of having atomic property for saving in keychains/userdefaults?

末鹿安然 提交于 2019-12-13 06:16:33
问题 For storing some values in NSUserDefaults / keychains is there any advantage of having atomic or non-atomic properties? 回答1: The difference between "atomic" and "non-atomic" is that atomic requires that all of the data must be successfully written while "non-atomic" means "write as much as possible" (i.e. not necessarily all of it). So for many things (e.g. small bits of data), there's not much of a practical difference between non-atomic or atomic. But for larger blocks of data, then non

Why SecItemAdd return me -50 (invalid params)

浪尽此生 提交于 2019-12-13 04:08:44
问题 I want to store in the keychain the value "MyKeyValue" and I do like this : NSData* key = [@"MyKeyValue" dataUsingEncoding:NSUTF8StringEncoding]; NSData* tag = [@"com.example.MyKey" dataUsingEncoding:NSUTF8StringEncoding]; NSDictionary* addquery = @{ (id)kSecValueRef: key, (id)kSecClass: (id)kSecClassKey, (id)kSecAttrApplicationTag: tag, }; OSStatus status = SecItemAdd((__bridge CFDictionaryRef)addquery, NULL); but this failed with error -50 (Invalid params) What i did wrong ? I would like to

About ios KeychainItemWrapper store username/password other than object

倖福魔咒の 提交于 2019-12-12 23:23:03
问题 I know save username/password use KeychainItemWrapper class method below, but I want an additional [ipTF text] in KeychainItemWrapper. How to do it? KeychainItemWrapper *keychainItem = [[KeychainItemWrapper alloc] initWithIdentifier:@"Login" accessGroup:nil]; [keychainItem setObject:[useridTF text] forKey:(__bridge id)(kSecAttrAccount)]; [keychainItem setObject:[passTF text] forKey:(__bridge id)(kSecValueData)]; [keychainItem setObject:[ipTF text] forKey:@"ip"];//not success! 回答1: I don't

iphone - data signing using NSData of the private key

大兔子大兔子 提交于 2019-12-12 17:04:53
问题 I am working on a e-banking iphone application. I am using WSS with XML-Signature to sign the requests to the customer's SOAP server. Since the iPhone device can not be trusted (due to jail-breaking), the customer requirement is to manually encrypt the RSA key pair (using AES128) before storing the keys into keychain. From what I have found so far, the keys are automatically added to the keychain when generated. So my idea is to extract the data afterwards (the same way the public key is

XCode Code Sign error because of no Keys in Keychain

╄→尐↘猪︶ㄣ 提交于 2019-12-12 13:20:53
问题 You might think, not again such a question where are already thousands of topics about. However, I've not been capable of finding the answer I needed to fix this problem. None of these topics go as deep as the Keychain. When I'm trying to deploy my app to an iPhone, I'm recieving the following message: Code Sign error: The identity 'iPhone Developer: [Name] ([ID])' doesn't match any valid, non-expired certificate/private key pair in your keychains. Now, as said, I have been looking for

iOS Keychain Data Lost Upon iPhone Memory Pressure?

☆樱花仙子☆ 提交于 2019-12-12 12:11:11
问题 I'm running an iOS app via a debugger on my iPhone 5s. I'm using the keychain to store a password (I'm using the KeychainItemWrapper example from Apple to store and retrieve my keychain items). About 99.99% of the time, the keychain retrieval works perfectly. However, there have been two cases in which my application could not get the password. For example, once, my phone was experiencing memory pressure and I had to restart the phone and relaunch the app. Upon the app relaunch, my app could

Multiple popup for codesign wants to access key “access” in your keychain

十年热恋 提交于 2019-12-12 11:03:52
问题 After build my app, I got error with codesign wants to access key "access" in your keychain and multiple popup as shown in screenshot attached: I would like to ask how to fix this error? After entering all the password didn't solve the issue. Clicking "Always Allow" didn't solve the issue either. Many thanks. 回答1: You have to allow codesign in the access list: security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k keychainPass 回答2: Enter your password and then Click on Always

Cocoa interface to MacOS X Keychain

穿精又带淫゛_ 提交于 2019-12-12 07:46:04
问题 I've got a bit of Mac code that needs to store, access and update passwords in order to connect users with a web API. The right place to put this information should be the Mac Keychain, but there doesn't seem to be a cocoa interface (see this answer) -- is this still correct? I've looked at Apple's Keychain documentation, and the API seems incredibly clunky. I can store to it and retrieve records, but anything more complex seems to require a lot of thought as to what might go wrong (see this

Authenticating with OAuth2 on iOS

放肆的年华 提交于 2019-12-12 07:19:49
问题 I am currently trying to authorize my users with OAuth2. I am currently using the following library: https://github.com/p2/OAuth2 let oauth2 = OAuth2CodeGrant(settings: [ "client_id": "my-id", "authorize_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://www.googleapis.com/oauth2/v3/token", "scope": "profile", // depends on the API you use "redirect_uris": ["com.TestAuthorizeApp:/oauth2Callback"], ]) //let oauth2 = OAuth2CodeGrant(settings: settings) oauth2.onAuthorize =