Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ibm mobilefirst 应用程序身份验证-从命令行提取公共签名密钥_Ibm Mobilefirst_Mobilefirst Cli - Fatal编程技术网

Ibm mobilefirst 应用程序身份验证-从命令行提取公共签名密钥

Ibm mobilefirst 应用程序身份验证-从命令行提取公共签名密钥,ibm-mobilefirst,mobilefirst-cli,Ibm Mobilefirst,Mobilefirst Cli,我的客户端没有安装用于eclipse的MobileFirst插件,我需要指导他提取用于应用程序身份验证的公共签名密钥。 有没有办法从命令行提取公共签名密钥?用于保存用于为APK签名的密钥的密钥库只是JKS格式的普通Java密钥库,可以使用标准Java“keytool”命令对其进行操作。您可以通过执行以下操作以PEM格式提取证书: keytool -exportcert -keystore keystore_name -alias alias_name -rfc > cert.txt op

我的客户端没有安装用于eclipse的MobileFirst插件,我需要指导他提取用于应用程序身份验证的公共签名密钥。
有没有办法从命令行提取公共签名密钥?

用于保存用于为APK签名的密钥的密钥库只是JKS格式的普通Java密钥库,可以使用标准Java“keytool”命令对其进行操作。您可以通过执行以下操作以PEM格式提取证书:

keytool -exportcert -keystore keystore_name -alias alias_name -rfc > cert.txt
openssl x509 -in cert.txt -pubkey -noout
keytool -exportcert -keystore keystore_name -alias alias_name -storepass keystore_password -rfc | openssl x509 -pubkey -noout | grep -v PUBLIC
(其中“keystore_name”是密钥库文件的名称,“alias_name”是用于签署APK的密钥的密钥别名)

然后从您刚刚创建的“cert.txt”文件中提取公钥,方法如下:

keytool -exportcert -keystore keystore_name -alias alias_name -rfc > cert.txt
openssl x509 -in cert.txt -pubkey -noout
keytool -exportcert -keystore keystore_name -alias alias_name -storepass keystore_password -rfc | openssl x509 -pubkey -noout | grep -v PUBLIC
您需要的公钥将出现在“----开始公钥------”和“----结束公钥------”行之间

如果要在单个命令中执行此操作,请执行以下操作:

keytool -exportcert -keystore keystore_name -alias alias_name -rfc > cert.txt
openssl x509 -in cert.txt -pubkey -noout
keytool -exportcert -keystore keystore_name -alias alias_name -storepass keystore_password -rfc | openssl x509 -pubkey -noout | grep -v PUBLIC
只提取并打印公钥,这样您就可以在shell变量或其他东西中捕获它