security-framework

SecKeyGeneratePair returns errSecUnimplemented

血红的双手。 提交于 2019-12-05 14:44:44
Im attempting to implement an RSA encryption algorithm into my iOS app, but when I attempt to generate a public and private key pair, the function returns me the errSecUnimplemented error. I am using the 5.1 SDK and targeting 5.1 at the moment. Can I not use this function, or did I set up something wrong in attempting to generate the pair? Here is my code for the key generation: SecKeyRef publicKey, privateKey; CFDictionaryRef parameters; const void* keys[] = {kSecAttrKeyType, kSecAttrKeyTypeRSA}; int keySize = 1024; const void *values[] = {kSecAttrKeySizeInBits, &keySize}; parameters =

How can I access identity profiles and certificates with iPhone SDK?

孤者浪人 提交于 2019-12-04 12:01:29
问题 I am trying to verify the user identity on my application using a certificate / identity that the user has stored by opening a .cer / .p12 attached to an email. The certificate appears on the settings app of the phone under the group "Configuration Profiles". Is there any way of accessing the certificate using the iphone SDK (I have tried to use the Security Framework, but it seems that it is only possible to access certificates stored in the application keychain or other keychains from its

Get the Username(s) stored in Keychain, using only the ServiceName? OR: Where are you supposed to store the Username?

白昼怎懂夜的黑 提交于 2019-12-04 09:21:20
So the OS X Keychain has three pieces of information: ServiceName (the name of my app) Username Password I obviously always know the ServiceName. Is there a way to find any saved Username(s) for that ServiceName? (Finding the password is easy once you know the Username.) I would much prefer to use a nice Cocoa wrapper such as EMKeychain to do this. But EMKeychain requires the UserName to get any keychain item! + (EMGenericKeychainItem *)genericKeychainItemForService:(NSString *)serviceNameString withUsername:(NSString *)usernameString; How are you expected to fully utilize saving credentials

iOS keychain: SecItemUpdate returns -50 (paramErr) when updating kSecAttrAccessible

穿精又带淫゛_ 提交于 2019-12-03 17:03:02
I need to update the kSecAttrAccessible of a keychain entry. I don't need to update the actual data, just the accessibility attribute. First I try to find the item to make sure that my query dictionary is good: sanityCheck = SecItemCopyMatching((__bridge CFDictionaryRef)(queryPrivateKey), (void *)&privateKeyRef); This line successfully finds me the item I am looking for (return code is 0). I then update the kSecAttrAccessible attribute using the same query: if (sanityCheck == noErr && privateKeyRef != nil) { // found it, update accessibility NSMutableDictionary *updatedAttributes = [

How can I access identity profiles and certificates with iPhone SDK?

好久不见. 提交于 2019-12-03 07:34:36
I am trying to verify the user identity on my application using a certificate / identity that the user has stored by opening a .cer / .p12 attached to an email. The certificate appears on the settings app of the phone under the group "Configuration Profiles". Is there any way of accessing the certificate using the iphone SDK (I have tried to use the Security Framework, but it seems that it is only possible to access certificates stored in the application keychain or other keychains from its group)? You talked about the Security framework already, but did you try the following functions in the

SecKeyRawVerify and OSError -9809

拟墨画扇 提交于 2019-11-29 10:27:17
I am using digital certificates to sign data files in my App. The code fragment below fails when the call to SecKeyRawVerify returns with -9809. This is running on an iPhone. I can't even identify exactly what this error code means The prior Security Framework calls to load and create the SecTrustRef from which the public key is obtained seem fine - no errors. The only slight issue is that the call to SecTrustEvaluate returns a kSecTrustResultUnspecified , but I assume that is because the policy I am using is the boilerplate one returned by the SecPolicyCreateBasicX509 call. Any assistance or