Function

SecKeychainLock

Locks a keychain.

Declaration

OSStatus SecKeychainLock(SecKeychainRef keychain);

Parameters

keychain

A reference to the keychain to lock. Pass NULL to lock the default keychain.

Return Value

A result code. See Security Framework Result Codes. The result code errSecNoSuchKeychain indicates that specified keychain could not be found. The result code errSecInvalidKeychain indicates that the specified keychain is invalid.

Discussion

Your application should not call this function unless you are responding to a user’s request to lock a keychain. In general, you should leave the keychain unlocked so that the user does not have to unlock it again in another application.

See Also

Locking and Unlocking

SecKeychainLockAll

Locks all keychains belonging to the current user.

SecKeychainUnlock

Unlocks a keychain.