keychain

Adding Items to and Querying the iOS Keychain with Swift

别说谁变了你拦得住时间么 提交于 2019-11-28 22:35:51
问题 I'm having trouble converting all of the Objective C code samples that are available for adding data and querying data from the iOS Keychain into Swift . I'm trying to do a basic storage of a string (an access token) and reading it back. I've had a look at some of the other questions on Stack Overflow, but I can't quite get it to work. I've tried to piece together a solution from the various sources. Edit 1: I tried with a more basic setup, because I thought my self.defaultKeychainQuery might

Swift keychain and provisioning profiles

徘徊边缘 提交于 2019-11-28 21:42:00
问题 We've created an app in swift that uses keychain. The app works fine when run on a device or in the simulator but can't access the keychain when provisioned via Testflight unless provisioned to a new device that's never had the app previously installed via Xcode 6.1. Following is an excerpt of the keychain code: import UIKit import Security let serviceIdentifier = "com.ourdomain" let kSecClassValue = kSecClass as NSString let kSecAttrAccountValue = kSecAttrAccount as NSString let

error: git-credential-osxkeychain died of signal 11

♀尐吖头ヾ 提交于 2019-11-28 21:11:19
I have installed github version 0.8.4, but when i try to fetch something from git, it is showing this message. Fetching all tracking branches from Queue-iOS completed successfully. command: git fetch Queue-iOS error: git-credential-osxkeychain died of signal 11 error: git-credential-osxkeychain died of signal 11 error: git-credential-osxkeychain died of signal 11 error: git-credential-osxkeychain died of signal 11 From https://github.com/appstute/Queue-iOS 59bb075..b2da838 master -> Queue-iOS/master It is a problem regarding keychain, when i go for pull from git hub, the following message is

Keychain: Item reported as errSecItemNotFound, but receive errSecDuplicateItem on addition

喜夏-厌秋 提交于 2019-11-28 21:08:58
This issue has been bugging me for a while, and I hope someone has insight as to the cause of this. Essentially, I have a small percentage of users who are unable to save/update items to the keychain. The problematic flow of control is as follows: We check for the existence of the item using SecItemCopyMatching . This returns the error code errSecItemNotFound We then try to add the item via SecItemAdd , but this then returns errSecDuplicateItem . Because of this, we have some users who are unable to update a subset of keychain items at all, requiring them to restore their device to clear the

Generate key pair on iphone and print to log as NSString

我怕爱的太早我们不能终老 提交于 2019-11-28 20:56:46
Following Apple example code in: http://developer.apple.com/library/ios/#documentation/Security/Conceptual/CertKeyTrustProgGuide/iPhone_Tasks/iPhone_Tasks.html I'm able to successfully generate key-pair with the code snippet below, but unable to print the keys... The function SecKeyGeneratePair() - returns the keys as SecKeyRef type. I have no idea how to handle this type, I understand that this is the keychain representation but how can I actually view the key-pair as NSString?? More specifically, how to convert SecKeyRef to NSString?? static const UInt8 publicKeyIdentifier[] = "com.apple

Obtaining admin privileges to delete files using rm from a Cocoa app

强颜欢笑 提交于 2019-11-28 19:50:42
I am making a small app that deletes log files. I am using an NSTask instance which runs rm and srm (secure rm) to delete files. I want to be able to delete files in: /Library/Logs ~/Library/Logs The issue is that the user account does not have permissions to access some files in the system library folder, such as the Adobe logs subfolder and others. For example, only the "system" user (group?) has r/w permissions for the Adobe logs folder and its contents, and the current user doesn't even have an entry in the permissions shown in the Get Info window for the folder. What I want to be able to

Get Certificates in Keychain

拜拜、爱过 提交于 2019-11-28 19:41:45
I've looked over the Security framework documentation but I can't seem to be able to find a way to get all of the certificates on a given keychain. Are there methods to accomplish this? After mining the documentation, header files, and source files, I’ve come up with the following code: #import <Security/Security.h> - (void)logMessageForStatus:(OSStatus)status functionName:(NSString *)functionName { CFStringRef errorMessage; errorMessage = SecCopyErrorMessageString(status, NULL); NSLog(@"error after %@: %@", functionName, (NSString *)errorMessage); CFRelease(errorMessage); } - (void

Store NSDictionary in keychain

我的未来我决定 提交于 2019-11-28 17:35:13
问题 It is possible to store a NSDictionary in the iPhone keychain, using KeychainItemWrapper (or without)? If it's not possible, have you another solution? 回答1: You must properly serialize the NSDictionary before storing it into the Keychain. Using: [dic description] [dic propertyList] you will end up with a NSDictionary collection of only NSString objects. If you want to maintain the data types of the objects, you can use NSPropertyListSerialization . KeychainItemWrapper *keychain = [

Android Keychain for user credentials

孤街浪徒 提交于 2019-11-28 17:22:09
Is there an equivalent to iOS's keychain on Android? My understanding of the Preferences API is that it is not encrypted. For my application it doesn't matter wether these credentials are persisted across devices (i.e. a different use-case to iPhone-like Keychain in Android? ) I also looked at the KeyStore API but it seems to leave the actual storage of user credentials up to the application developer. Thanks for your help! Short answer, there isn't one. But you can expect the filesystem to be secure. Each app operates under a different user, and the filesystem used to store app data is

I lost my public key. Can I recover it from a private key?

怎甘沉沦 提交于 2019-11-28 16:31:12
问题 I created a key pair + signed certificate for iOS/OSX development. Somewhere along the way, I lost the public key that goes with my private key. Maybe it's because Keychain Access doesn't group the private and public keys together, like it does with certificates and private keys (that is so irritating! why does it (not) do that!) In Keychain Access, I can still right-click the private key -> "Request a certificate"; but without the public key available I get the error "The specified item