keychain

How to use “SecItemAdd” to store a symmetric key in OS X?

陌路散爱 提交于 2019-12-20 03:26:14
问题 I want to store a symmetric key in the keychain of OS X. I read by the Apple DevDocs that I should use SecItemAdd in order to do this. I also read the CryptoExercise without any solutions for Me. But when I'm doing so, I always got OSStatus errSecNoSuchAttr (-25303) . Codesnippet as follows: //Labels and app tags NSString *label = @"My Testkey"; NSData * peerTag = [[NSData alloc] initWithBytes:(const void *)[label UTF8String] length:[label length]]; // Generating testkey NSMutableData *key =

How do I correct the “Undefined symbols for architecture i386: ”_main" linking issue?

*爱你&永不变心* 提交于 2019-12-19 18:28:27
问题 I am trying to use the KeyChainitemwrapper provided by apple. My project is using ARC but I have turned of ARC on KeyChainitemwrapper.m. I linked the 'security.framework' framework to my project. I am getting this linking issue: Undefined symbols for architecture i386: "_main", referenced from: start in crt1.10.6.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) I am new to ios development but my guess is that the

How do I correct the “Undefined symbols for architecture i386: ”_main" linking issue?

假如想象 提交于 2019-12-19 18:28:01
问题 I am trying to use the KeyChainitemwrapper provided by apple. My project is using ARC but I have turned of ARC on KeyChainitemwrapper.m. I linked the 'security.framework' framework to my project. I am getting this linking issue: Undefined symbols for architecture i386: "_main", referenced from: start in crt1.10.6.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) I am new to ios development but my guess is that the

Does SecTrustEvaluate() look for root certificates in the application keychain?

耗尽温柔 提交于 2019-12-18 18:07:08
问题 The docs say: “If not all the certificates needed to verify the leaf certificate are included in the trust management object, then SecTrustEvaluate searches for certificates in the keychain search list (see SecTrustSetKeychains) and in the system’s store of anchor certificates (see SecTrustSetAnchorCertificates).” However, since SecTrustSetKeychains() is not available on iOS, it’s not clear whether this function will also look in the application’s keychain. 回答1: Seems like it's been a while

Storing username/password on Mac using Java

↘锁芯ラ 提交于 2019-12-18 12:28:23
问题 I'm writing a small program (a twitter client) in Java, aimed at Mac OS X. As part of its functionality, it needs to have a place to store the twitter username/password. The natural place would be the mac keychain, but I can't find any way of accessing it. Is there any way of accessing the mac keychain from Java, or failing that, what is your recommendation for where to store the username/password instead? 回答1: There is Java keychain API, in that there's an implementation of KeyStore on OS X

swift 2.0 keychain type errors for SecItemCopyMatching

瘦欲@ 提交于 2019-12-18 04:13:11
问题 We had this snippet of code with the previous version of Swift var retrievedData: NSData? var extractedData: Unmanaged<AnyObject>? = nil let status = SecItemCopyMatching(keyChainQuery, &extractedData) if (status == errSecSuccess) { if let validExtractedData = extractedData { let opaque = validExtractedData.toOpaque() retrievedData = Unmanaged<NSData>.fromOpaque(opaque).takeUnretainedValue() } } However this now gives us the following error: Cannot convert value of type 'inout Unmanaged?' (aka

Can't import Code-signing Public or Private keys using Keychain access (Mac OS X Mavericks)

不羁岁月 提交于 2019-12-18 03:55:04
问题 In an attempt to build an iOS project (in XCode), I need to import my colleague's public and private keys for the code signing identity, but I am unable to do so because I get an error in Keychain Access that says "An error has occurred. Unable to import an item. / The contents of this item cannot be retrieved" FULL DETAILS: I have got two keys from my colleague's computer, exported them from his Keychain as two files: Roomer Inc.p12 (the private key) Roomer Inc.pem (the public key) When he

Get Certificates in Keychain

若如初见. 提交于 2019-12-17 22:42:18
问题 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? 回答1: 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(@

Android Keychain for user credentials

跟風遠走 提交于 2019-12-17 22:32:58
问题 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! 回答1: Short answer, there isn't one. But you can expect the filesystem

OSStatus error code -34018

风格不统一 提交于 2019-12-17 17:36:46
问题 I am using SecItemCopyMatching to access the iOS keychain. About 1 in a hundred times I get a -34018 result code right after relaunching the app from the background. The documentation states: The assigned error space for Keychain Services is discontinuous: –25240 through –25279 and –25290 through –25329. Keychain Item Services may also return noErr (0) or paramErr (–50), or CSSM result codes So it seems that -34018 is a 'CSSM result code'. I have followed the suggested link but could not find