Extract a public key from p12 file
- IT
- 2019. 2. 6. 12:10
250x250
반응형
http://stackoverflow.com/a/16847082
I remembered vaguely being able to do this with openssl on .pem files, so that's the direction I headed.
- In Keychain Access, export the private key as eg private.p12. Apply a password, or not.
- Convert it to .pem: openssl pkcs12 -in private.p12 -out private.pem. Enter password from previous step. You're forced to apply a password to the .pem.
- Extract the public portion: openssl rsa -in private.pem -pubout > public.pem. Enter password from previous step.
- Import into Keychain Access: security import public.pem -k login.keychain. If you don't specify a keychain, the import appears to complete but I couldn't find where the item was put.
- In Keychain Access, look in the login keychain for "Imported Public Key". Rename it and move to the desired location.
- Clean up after yourself, especially those .p12 and .pem private keys with no or poor passwords.
반응형
'IT' 카테고리의 다른 글
[Shell] 현재 날짜로 디렉토리 생성 (0) | 2019.02.06 |
---|---|
Import public/private key from key file to Mac Keychain (0) | 2019.02.06 |
Converting JKS to PKCS12 (0) | 2019.02.06 |
정규표현식(Regular Expression) 연습 사이트 (0) | 2019.02.06 |
Subversion 사용자 비밀번호에 SASL 적용 (0) | 2019.02.06 |