How to convert .cer to BKS

前端 未结 1 1502
傲寒
傲寒 2020-12-16 19:06

I have a certificate with .cer extension. My application will connect to site with https. I\'m trying to create BKS with this command

keytool -import -alias          


        
相关标签:
1条回答
  • 2020-12-16 19:40

    Try using this on Terminal (I assume you've downloaded Bouncy Castle jar at http://bouncycastle.org/latest_releases.html):

    keytool -importcert -v -trustcacerts -file "path_to_cert/interm_ca.cer" -alias IntermediateCA -keystore "path_to_your_app/res/raw/myKeystore.bks" -provider org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath "path_to_bouncycastle/bcprov-jdk16-145.jar" -storetype BKS -storepass mysecret

    it should create a BKS keystore on your app's /res/raw folder. Then, verify your keystore with the following command:

    keytool -list -keystore "path_to_your_app/res/raw/myKeystore.bks" -provider org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath "path_to_bouncycastle/bcprov-jdk16-145.jar" -storetype BKS -storepass mysecret

    it should output something like this: RootCA, 22.10.2010, trustedCertEntry, Thumbprint (MD5): 24:77:D9:A8:91:D1:3B:FA:88:2D:C2:FF:F8:CD:33:93 IntermediateCA, 22.10.2010, trustedCertEntry, Thumbprint (MD5): 98:0F:C3:F8:39:F7:D8:05:07:02:0D:E3:14:5B:29:43

    Source

    0 讨论(0)
提交回复
热议问题