Get Keychain Status
Hi,
I would like to write a command line utility that returns the status (locked/unlocked) of either the default keychain or one passed as a parameter as no functionality exists in Bash to do same.
I'm open to using either ObjC or (pref) Swift to do this but am struggling to get code samples working.
Anyone free to help briefly?
Below is the non-working sample I have hacked together so far.
Many thanks
Dan
import Foundation
import Security
typealias SecKeychainStatus = UInt32
//func SecKeychainGetStatus(_ keychain: SecKeychain!,
// _ keychainStatus: UnsafeMutablePointer<SecKeychainStatus>) -> OSStatus
func SecKeychainGetStatus(NULL: SecKeychain!,
keychainStatus: UnsafeMutablePointer<SecKeychainStatus>) -> OSStatus {
// Can't work out what I should have here
}
println(SecKeychainGetStatus) // Would I print to stdout thus?
OS X Yosemite (10.10.3)