创建密钥库BKS用于HTTPS连接的android [英] Creating keystore BKS for https android connection
本文介绍了创建密钥库BKS用于HTTPS连接的android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我发现教程介绍如何创建和使用密钥库的HTTPS连接。但我有很小白的问题:我应该把这个code创建密钥库?在OpenSSL的命令PROMT或密钥工具按键提示。
出口CLASSPATH = bcprov-jdk16-145.jar
的CertStore = RES /生/ mystore.bks
如果[-a $的CertStore]。然后
RM $的CertStore || 1号出口
科幻
密钥工具\\
-import \\
-v \\
-trustcacerts \\
-alias 0 \\
-file≤(OpenSSL的X509 -in mycert.pem)\\
-keystore $的CertStore \\
-storetype BKS \\
-provider org.bouncycastle.jce.provider.BouncyCastleProvider \\
-providerpath /usr/share/java/bcprov.jar \\
-storepass一些密码
解决方案
都不是。您已粘贴的code是一个bash脚本。通常情况下,你会说出这个文件的 make-keystore.sh 。添加为第一行:
#!/斌/庆典
请确保它可以在你的Linux机器执行
搭配chmod + X
和像
运行 ./ make-keystore.sh
I found tutorial which describes how create and use keystore for https connection. But I have very noob question: where should i put this code to create keystore? at the openssl command promt or in keytool key prompt.
export CLASSPATH=bcprov-jdk16-145.jar
CERTSTORE=res/raw/mystore.bks
if [ -a $CERTSTORE ]; then
rm $CERTSTORE || exit 1
fi
keytool \
-import \
-v \
-trustcacerts \
-alias 0 \
-file <(openssl x509 -in mycert.pem) \
-keystore $CERTSTORE \
-storetype BKS \
-provider org.bouncycastle.jce.provider.BouncyCastleProvider \
-providerpath /usr/share/java/bcprov.jar \
-storepass some-password
解决方案
Neither. The code you have pasted is a bash script. Typically you would name this file make-keystore.sh. Add this as a first line:
#!/bin/bash
Make sure it can execute on your linux box
chmod +x
and run it like
./make-keystore.sh
这篇关于创建密钥库BKS用于HTTPS连接的android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文