keychain

Save and retrieve value via KeyChain

做~自己de王妃 提交于 2019-12-17 10:25:25
问题 I'm trying to store an Integer and retrieve it using KeyChain. This is how I save it: func SaveNumberOfImagesTaken() { let key = "IMAGE_TAKEN" var taken = 10 let data = NSKeyedArchiver.archivedDataWithRootObject(taken) let query : [String:AnyObject] = [ kSecClass as String : kSecClassGenericPassword, kSecAttrAccount as String : key, kSecValueData as String : data ] let status : OSStatus = SecItemAdd(query as CFDictionaryRef, nil) } This is how I try to retrieve it: func

Save and retrieve value via KeyChain

删除回忆录丶 提交于 2019-12-17 10:25:18
问题 I'm trying to store an Integer and retrieve it using KeyChain. This is how I save it: func SaveNumberOfImagesTaken() { let key = "IMAGE_TAKEN" var taken = 10 let data = NSKeyedArchiver.archivedDataWithRootObject(taken) let query : [String:AnyObject] = [ kSecClass as String : kSecClassGenericPassword, kSecAttrAccount as String : key, kSecValueData as String : data ] let status : OSStatus = SecItemAdd(query as CFDictionaryRef, nil) } This is how I try to retrieve it: func

iOS get Configuration Profiles that are installed

霸气de小男生 提交于 2019-12-17 09:32:44
问题 The app I am currently working on requires the use of Configuration Profiles in order to connect to a server to download XML. The certificates are distributed in the form of .p12 files, and they can be installed in the settings app in the iPhone like the bottom-left image. The problem is that all over the internet people are saying that this is impossible. HOWEVER, Junos Pulse can do this(bottom-right image). It is only reading the Configuration Profiles which is exactly what I need. I did

Querying iOS Keychain using Swift

烂漫一生 提交于 2019-12-17 08:53:12
问题 I'm stuck converting the Keychain query result using Swift. My request seems to be working: let queryAttributes = NSDictionary(objects: [kSecClassGenericPassword, "MyService", "MyAccount", true], forKeys: [kSecClass, kSecAttrService, kSecAttrAccount, kSecReturnData]) dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), { var dataTypeRef : Unmanaged<AnyObject>? let status = SecItemCopyMatching(queryAttributes, &dataTypeRef); let retrievedData : NSData = dataTypeRef!

Save and Load from KeyChain | Swift [duplicate]

不问归期 提交于 2019-12-17 08:09:20
问题 This question already has answers here : Save and retrieve value via KeyChain (7 answers) Closed 3 years ago . How to simply store a String in Keychain and load when needed. There are several SO solution which mostly refers to Git repo. But I need the smallest and the simplest solution on latest Swift. Certainly, I don't want to add git framework for simply storing a password in my project. There are similar solution Save and retrieve value via KeyChain , which did not work for me. Tired with

Enumerate all Keychain items in my iOS application

主宰稳场 提交于 2019-12-17 04:24:10
问题 What's the easiest way to programmatically (from within my app) get all items stored in the keychain? It probably has something to do with SecItemCopyMatching(), but the documentation for that function is not very clear (and I failed to find a decent sample on the web). 回答1: SecItemCopyMatching is the right call for that. First we build our query dictionary so that the items' attributes are returned in dictionaries, and that all items are returned: NSMutableDictionary *query =

How to share keychain data between iOS applications

旧城冷巷雨未停 提交于 2019-12-17 03:00:21
问题 I am describing a problem for which it took me quite some time to learn the answer. The "GenericKeychain" example is a good start at providing a wrapper for sharing keychain data between applications when using the accessGroup in the init. However, implementing this in my app yielded an obscure error code (which took forever to locate) -25243, which means: No access control. I ran Apple's example app (GenericKeychain) on my iPad only to get the same error. Huh? Does Apple's documentation fail

Missing certificates and keys in the keychain while using Jenkins/Hudson as Continuous Integration for iOS and Mac development

怎甘沉沦 提交于 2019-12-17 02:59:59
问题 I'm trying to improve Hudson CI for iOS and start Hudson as soon as system starts up. To do this I'm using the following launchd script: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>Hudson CI</string> <key>ProgramArguments</key> <array> <string>/usr/bin/java</string> <string>-jar</string> <string>/Users/user/Hudson/hudson.war</string> </array>

Distribution Profile requesting a Developer certificate

偶尔善良 提交于 2019-12-14 02:07:52
问题 Using Xcode 9.1, after building an iOS app, I try to archive it. But I get the following error message: Provisioning profile "MyAppProfile" doesn't include signing certificate "iPhone Developer: My Name (X1YZ2AB3CD)". After looking closer, I see that MyAppProfile is a Distribution Provisioning Profile (this is what I want) and X1YZ2AB3CD matches a Developer certificate.But when building MyAppProfile (for App Store) I was provided with the choice of a unique Distribution certificate (No

how to correctly setup credential-osxkeychain for git

允我心安 提交于 2019-12-14 01:27:54
问题 I have followed the instructions on how to set up git to integrate the OS X keychain to the git command. The instructions say that the password prompt should come up once more, and that the keychain access window will come up. the password prompt up, but the keychain window did not. Also, subsequent commands requiring authentication (to a https:// url) came up with a password prompt. None of these commands raised any kind of error or warning that something went foul. My question is how can i