Category Archives: Java

Creating Your Own SSL Certificate Authority (and Dumping Self Signed Certs)

Creating Your Own SSL Certificate Authority (and Dumping Self Signed Certs) Jan 11th, 2016: New Year! Also, there was a comment below about adding -sha256 to the signing (both self-signed and CSR signing) since browsers are starting to reject... Read More | Share it now!

Java实现 SSL双向认证 Socket

我们常见的SSL验证较多的只是验证我们的服务器是否是真实正确的,当然如果你访问的URL压根就错了,那谁也没有办法。这个就是所谓的SSL单向认证。   但是实际中,我们有可能还会验证客户端是否符合要求,也就是给我们每个用户颁发一个证书,比且每个数字证书都是唯一的,不公开的。这样就能通过这个数字证书保证当前访问我服务器的这个用户是经过服务器认可的,其他人不可访问。   双向认证... Read More | Share it now!

常用的Java Keytool Keystore命令

https://www.chinassl.net/ssltools/keytool-commands.html   Java... Read More | Share it now!

Jetty SSL Configuration Example

From: https://examples.javacodegeeks.com/enterprise-java/jetty/jetty-ssl-configuration-example/ In this example, we are going to configure SSL on Jetty Server. We are first generate SSL key and certificates using OpenSSL. Then we will configure our... Read More | Share it now!

Adding SSL Support to an Embedded Jetty Server

From: https://dzone.com/articles/adding-ssl-support-embedded As I discussed in a series of four posts (see Part 1, Part 2, Part 3, and Part 4), I recently taught a class on Spring WebMVC and how it can be used to REST-enable a standalone Java... Read More | Share it now!

httpclient中使用HTTPS的方法

import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import... Read More | Share it now!

Java SSL/TLS 安全通讯协议介绍

在人类建立了通信系统之后,如何保证通信的安全始终是一个重要的问题。伴随着现代化通信系统的建立,人们利用数学理论找到了一些行之有效的方法来保证数字通信的安全。简单来说就是把两方通信的过程进行保密处理,比如对双方通信的内容进行加密,这样就可以有效防止偷听者轻易截获通信的内容。目前... Read More | Share it now!

How to convert an ArrayList containing Integers to primitive int array?

public static int[] convertIntegers(List integers) { int[] ret = new int; for (int i=0; i < ret.length; i++) { ret = integers.get(i).intValue(); } return ret; } Google Guava: List list = ...; int[] values =... Read More | Share it now!

Hashing issue between guava versions

I was using guava 14 to do String hashing like so: Hashing.sha256().newHasher().putString("String").hash().toString(); => 4d1ca6dce72e20ce214b706168340683bb6b571a7c977c1a9fe029a1cc1c4d06 just upgraded to guava16, calling this... Read More | Share it now!

HashMap遍历的两种方式

第一种: Map map = new HashMap(); Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) {     Map.Entry entry = (Map.Entry) iter.next();     Object key = entry.getKey();     Object val = entry.getValue(); }... Read More | Share it now!