Content-Length: 6853 | pFad | http://himtodo.fc2web.com/java/x509.html

クライアント証明書

Java プログラムメモ


トップ

クライアント証明書

SSL が有効な場合に Servlet でクライアント証明書を取得するには、 リクエストがセキュアでなければいけません。 セキュアか否かの確認には、ServletRequest#isSecure() を使います。 その上で、リクエストの属性に設定されているクライアント証明書を取得します。

ソース記述例

if (request.isSecure()) { X509Certificate[] certList = (X509Certificate[])request .getAttribute("javax.servlet.request.X509Certificate"); if (certList != null) { for (int i = 0; i < certList.length; i++) { Principal userDN = certList[0].getSubjectDN(); System.out.println(userDN); } } }


プログラムメモ アフリカ雑貨・珈琲豆・アールブリュット作品 マゴソスクール クラウドファンディング
SEO [PR] 爆速!無料ブログ 無料ホームページ開設 無料ライブ放送








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://himtodo.fc2web.com/java/x509.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy