2013-10-28 41 views

回答

2

下面是一個簡單的腳本,我爲此創建:

#!/bin/bash 
if (($# != 2)) 
then 
    echo "Usage: aliasname password" 
    exit 1 
fi 

keytool -genkey -keystore ./$1.p12 -deststoretype PKCS12 -storepass $2 -alias $1 -keyalg "RSA" -keysize 2048 -validity 9000 
openssl pkcs12 -in $1.p12 
keytool -v -importkeystore -srckeystore ./$1.p12 -srcstoretype PKCS12 -srcstorepass $2 -destkeystore ./$1.jks -deststoretype JKS -deststorepass $2 

這將創建一個SSL證書並打印私鑰和證書公衆。

您的應用程序創建

使用的API瀏覽器的示例應用程序的私有密鑰中使用酒館證書。