2010-05-19 5 views
6

OpenSSL을 사용하여 .pfx 파일을 만드는 몇 가지 명령이 제공되었습니다. 대부분의 경우, 내 파트너는이 정보 수집 : Is it possible to convert an SSL certificate from a .key file to a .pfx?OpenSSL을 사용하여 .pfx 파일 만들기

을 내가 가지고있는 다음 파일 :

  1. 2010certificate.cer
  2. 2010cert_and_key.pem
  3. private_verisign10to11.key

두 가지 모두를 사용하여 생성하려고 시도했습니다.

openssl pkcs12 -export -out s2010-1.pfx -inkey private_verisign10to11.key -in 2010cert_and_key.pem -certfile 2010certificate.cer 
and 
openssl pkcs12 -export -out s2010-1.pfx -inkey private_verisign10to11.key -in 2010certificate.cer -certfile 2010cert_and_key.pem 

이 상황에서는 오류가 발생하지 않지만 생성 된 파일 s2010-1.pfx를 보거나 가져 오려고하면 Protecle이 열 수 없다고 말합니다. 키 도구는 말한다 : 나는 문제를 가정하고

keytool -import -file s2010-1.pfx x -keystore cacerts -alias fqdn -storepass <.pfx's pass word> 
keytool error: java.lang.Exception: Input not an X.509 certificate 

.PFX 세대,하지만 난 정말 키 도구 명령까지를 테스트하는 방법을 모르겠어요. 여기에서 무엇을해야하는지에 대한 제안은 훌륭합니다.

+0

keytool -importkeystore -srckeystore my.pfx -srcstoretype PKCS12 -srcstorepass <mysecret> -destkeystore cacerts -deststoretype JKS -deststorepass changeit 
2015 후이 Q)] (http://www.oracle.com/technetwork/java/javase/8u60-relnotes-2620227.html)를 지정해야합니다 :'keytool -list -keystore whatever.pfx -storetype pkcs12 ' –

답변

1

TinyCA을 사용하여 3 개의 파일을 각각 열어보십시오. 그 파일의 확장자가 특별히 말하자면 .pem 파일 일 수 있기 때문입니다. 그런 다음 TinyCA를 사용하여 키를 내 보냅니다. openssl 명령과 해당 명령의 출력을 모두 표시하는 메시지 창이 있습니다.

0

문제는 keytool -importcert (-import : Java < 1.6)에서만 x509 인증서를 가져올 수 있기 때문입니다. cacerts 포함 자바 .jks 파일에 (때로는 .pfx 파일로 제공)를 PKCS12를 가져 오려면

:

자바 키 저장소 _as_ PKCS12를 치료하지만, [8u60 전에 (의 수
관련 문제