문제

I'm trying to import a .pfx certificate via command line. This certificate is secured by a password. Is there a way to do this in terminal? I'm running OS X 10.8.

When I use this command I get the default pop-up asking for the password:

security import certificate.pfx -k ~/Library/Keychains/login.keychain

When I use this command:

security import certificate.pfx -k ~/Library/Keychains/login.keychain -P password

I get this error:

SecKeychainItemImport: MAC verification failed during PKCS12 import (wrong password?)

I'm sure the password is correct because it works if I enter it manually.

Thanks!

도움이 되었습니까?

해결책

Got it!

The password starts with a dollar and I didn't escape it with a \.

So let's say the password is $tup1dP@ssw0rd the command has to be:

security import certificate.pfx -k ~/Library/Keychains/login.keychain -P \$tup1dP@ssw0rd
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top