codesign doesn't use the keychain path passed via --keychain

I have two certs with same name so prevent the ambiguity that codesign has when it finds two certs with same name in the keychain, I tried to create a new keychain and moved the cert I want into it and passed the path with --keychain param to the codesign tool. But it still looks for the cert in the login keychain. What's wrong with the below command?

codesign -fs "$CODE_SIGN_IDENTITY" --keychain "full/path/to/codesigning.keychain-db" $FILE

I’m not entirely sure what’s going on with the --keychain parameter but the best way to solve this issue:

I have two certs with same name so prevent the ambiguity that codesign has when it finds two certs with same name

is to pass the hash of the signing identity’s certificate to codesign. I talk about this in Creating Distribution-Signed Code for Mac (search the doc for SHA-1).

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

codesign doesn't use the keychain path passed via --keychain
 
 
Q