當前位置:首頁 » 編程語言 » javaopenssl

javaopenssl

發布時間: 2022-04-29 15:52:10

java程序如何使用openssl

First of all: what do you need the library for?

If you are going to use simple cryptographic functions, then use the Java SE Security components deployed with the JDK.
If you need more advanced functions (such as some digital signing formats, etc), use a cryptographic library (BouncyCastle is one of the the most popular)
But, if what you need is to open SSL connections from Java code, and
handle certificates authentication, etc, you won't need any of these:
If you are working on a Java EE Container, your container can
validate incoming SSL requests: it's just a matter of configuration
Also, if you need to connect to a SSL port, the JDK presents some basic classes for doing so (see this example). Note that in this case, you'll need to set some system properties on your java command.

Like these properties:

-Djavax.net.ssl.keyStore=keystore_path-Djavax.net.ssl.keyStorePassword=password-Djavax.net.ssl.trustStore=truststore_path-Djavax.net.ssl.trustStorePassword=trustword

http://stackoverflow.com/questions/5416194/openssl-with-java

② 如何在由openssl生成的java中使用.key和.crt文件

您好,這樣:
第一步,從key和crt生成pkcs12格式的keystore
openssl pkcs12 -export -in mycert.crt -inkey mykey.key
-out mycert.p12 -name tomcat -CAfile myCA.crt
-caname root -chain
第二步 生成tomcat需要的keystore

keytool -importkeystore -v -srckeystore mycert.p12 -srcstoretype pkcs12 -srcstorepass 123456 -destkeystore tomcat.keystore -deststoretype jks -deststorepass 123456 。

③ openssl 生成的*.key文件。java怎麼從中獲得私鑰

這個是pem格式的數字證書,可以嘗試調用openssl的api函數PEM_read_bio_PrivateKey()來讀取密鑰。

④ java中 用到.cer的安全證書,如何通過openssl來生成這個證書

openssl貌似 linux系統里用的多, 也可以用java的keytool生成,jdk自帶的.

⑤ 如何用Java調用Openssl生成一個數字證書

openssl genrsa -des3 -out server.key 1024運行時會提示輸入密碼,此密碼用於加密key文件(參數des3便是指加密演算法,當然也可以選用其他你認為安全的演算法.),以後每當需讀取此文件(通過openssl提供的命令或API)都需輸入口令.如果覺得不方便,也可以..

⑥ java調用openssl的dll,用jni如何調用

sha1的java軟演算法也有,可以考慮用bouncycastle

熱點內容
安卓十二系統什麼時候更新 發布:2025-07-02 00:12:28 瀏覽:344
shell腳本需要編譯鏈接 發布:2025-07-02 00:04:20 瀏覽:473
微信如何重設密碼 發布:2025-07-02 00:02:27 瀏覽:545
java代碼基礎 發布:2025-07-02 00:00:46 瀏覽:304
煙花的代碼c語言 發布:2025-07-01 23:56:04 瀏覽:224
安卓默認打開文件方式怎麼修改 發布:2025-07-01 23:30:38 瀏覽:862
壓縮機接線座 發布:2025-07-01 23:17:48 瀏覽:662
iqoo瀏覽器緩存路徑 發布:2025-07-01 23:12:38 瀏覽:692
明日之後如何獲得最新伺服器 發布:2025-07-01 23:12:35 瀏覽:51
tv加密頻道 發布:2025-07-01 23:10:58 瀏覽:625