當前位置:首頁 » 編程語言 » 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-05-15 10:36:16 瀏覽:993
ehcache存儲對象 發布:2025-05-15 10:35:31 瀏覽:527
搭建虛擬電腦的伺服器 發布:2025-05-15 10:29:31 瀏覽:269
湖人雙核配置哪個最好 發布:2025-05-15 10:09:48 瀏覽:979
手機熱點密碼怎麼查看 發布:2025-05-15 09:54:47 瀏覽:108
生意發力雲存儲 發布:2025-05-15 09:54:45 瀏覽:616
編寫一個shell腳本添加用戶 發布:2025-05-15 09:54:43 瀏覽:505
資料庫查看錶命令 發布:2025-05-15 09:52:27 瀏覽:914
p30是不是自帶方舟編譯器 發布:2025-05-15 09:51:48 瀏覽:599
追擊世界房間密碼是多少 發布:2025-05-15 09:51:46 瀏覽:995