Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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)

Posted on Apr 21, 2015 2:58 AM

Reply

There are no replies.

Get Keychain Status

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.