Questions tagged [keychain]

A keychain is an encrypted container that holds passwords for multiple applications and secure services. Apple Inc. uses keychains as password management system in Mac OS and iOS.

Keychain is Apple Inc.'s password management system in Mac OS and iOS. It was introduced with Mac OS 8.6, and has been included in all subsequent versions of Mac OS, including Mac OS X. A Keychain can contain various types of data: passwords (for Websites, FTP servers, SSH accounts, network shares, wireless networks, groupware applications, encrypted disk images), private keys, certificates, and secure notes.

In Mac OS X, keychain files are stored in ~/Library/Keychains/, /Library/Keychains/, and /Network/Library/Keychains/, and the Keychain Access GUI application is located in the Utilities folder in the Applications folder. It is free, open source software released under the terms of the APSL. The command line equivalent of Keychain Access is /usr/bin/security. The keychain file(s) stores a variety of data fields including a title, URL, notes and password. Other than Secure Notes created with Keychain Access, only the password is encrypted, with Triple DES. The contents of Secure Notes are also encrypted.

Source: Keychain

1969 questions
81
votes
8 answers

security / codesign in Sierra: Keychain ignores access control settings and UI-prompts for permission

Starting with macOS Sierra, I can't import a codesign-identity into a keychain with /usr/bin/security any more without usr/bin/codesign UI-prompting for access when using this identity. This breaks the packaging scripts of build server. There seems…
Sven Driemecker
  • 3,421
  • 1
  • 20
  • 22
78
votes
3 answers

Storing authentication tokens on iOS - NSUserDefaults vs Keychain?

Which is the place I should be storing tokens for when the user logins in to a service? I'm not saving passwords (obviously where I'd use the Keychain) but just the token. A lot of places say just use NSUserDefaults but some people on StackOverflow…
Doug Smith
  • 29,668
  • 57
  • 204
  • 388
73
votes
1 answer

Save and Load from KeyChain | Swift

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…
Sazzad Hissain Khan
  • 37,929
  • 33
  • 189
  • 256
73
votes
10 answers

How can I add private key to the distribution certificate?

Well, I've got my Developer Certificate linked with it's private key. Works Fine. I've downloaded my iOS Profile of distributor, but it says Valid signing identity not found. So I checked my certificates, and exactly, my developer certificate it's…
Pau Senabre
  • 4,155
  • 2
  • 27
  • 36
70
votes
1 answer

This certificate has an invalid issuer : Keychain marks all certificates as "Invalid Issuer"

Keychain shows all the certificates as Invalid in my keychain suddenly, as it working before 2 days and i also check in Developer portal and it shows valid there. It marks each and every certificate in Keychain as "This certificate has invalid…
technerd
  • 14,144
  • 10
  • 61
  • 92
69
votes
16 answers

Can't find private key for Apple Development Push Services

I've consulted many sources out there and still can't figure this out. http://code.google.com/p/apns-php/wiki/CertificateCreation Basically after I download the Development Push SSL Certificate from the iOS Provisioning Portal > App IDS (with Enable…
Ken Yu
  • 721
  • 1
  • 6
  • 6
60
votes
5 answers

An error has occurred. Unable to import an item. The contents of this item cannot be retrieved. Missing .pem file

I am struck with a problem. I installed the p12 certificates once into a MacBookPro and then deleted it, now when I am again trying to install it. Keychain is simply not accepting the certificate for strange reason. After some googling, I hit upon…
Raj Pawan Gumdal
  • 7,390
  • 10
  • 60
  • 92
59
votes
13 answers

Running xcodebuild from a forked terminal

I'm trying to setup an automated build server for an iPhone application. I'd like to be able to have nightly adhoc beta builds so that testers can follow the development. I've setted up xcode successfully xcode to perform adhoc builds and I can also…
Yann Biancheri
  • 1,637
  • 1
  • 13
  • 9
56
votes
4 answers

iOS Keychain Security

we want to use certificates on the iPhone to authenticate for MS Exchange Sync. We are not sure how the security concept is implemented to protect this certificates. e.g. is it possible to get "full" Keychain access on the iPhone if no ScreenLock is…
phx
  • 1,509
  • 3
  • 15
  • 18
55
votes
2 answers

How to share keychain data between iOS applications

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,…
GtotheB
  • 2,727
  • 4
  • 21
  • 17
50
votes
12 answers

key chain warning The “System Roots” keychain cannot be modified

Am landed with following error "“System Roots” keychain cannot be modified" when I double tap the certificate. After googling I come to know that drag and drop the certificate is the solution for this. But even after doing this also in code it says…
nik
  • 2,289
  • 6
  • 37
  • 60
50
votes
4 answers

OSStatus error code -34018

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…
Randomblue
  • 112,777
  • 145
  • 353
  • 547
48
votes
10 answers

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

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:
Dmytro
  • 2,522
  • 5
  • 27
  • 36
47
votes
4 answers

Reset keychain on the device

I'm testing login flow (using KeychainItemWrapper) inside my app on a device. How do I reset/delete keychain for my app? On the Simulator, I do it by clicking on iOS Simulator -> Reset Content and Settings....
syntagma
  • 23,346
  • 16
  • 78
  • 134
46
votes
3 answers

How to install developer certificate/private key and provisioning profile for iOS development via command line?

I'm configuring automated build server for iOS application project. I've done most of it. Now, it's the final round. The security. Developer certificate/private key and provisioning profile can be easily installed into Keychain with GUI. But I want…
eonil
  • 83,476
  • 81
  • 317
  • 516