zoukankan      html  css  js  c++  java
  • 列出JVM所支持的cipher

    import java.util.Iterator;
    import java.util.Map;
    import java.util.TreeMap;
    import javax.net.ssl.SSLServerSocketFactory;
    
    public class Ciphers
    {
        public static void main(String[] args)
            throws Exception
        {
            SSLServerSocketFactory ssf = (SSLServerSocketFactory)SSLServerSocketFactory.getDefault();
    
            String[] defaultCiphers = ssf.getDefaultCipherSuites();
            String[] availableCiphers = ssf.getSupportedCipherSuites();
    
            TreeMap ciphers = new TreeMap();
    
            for(int i=0; i<availableCiphers.length; ++i )
                ciphers.put(availableCiphers[i], Boolean.FALSE);
    
            for(int i=0; i<defaultCiphers.length; ++i )
                ciphers.put(defaultCiphers[i], Boolean.TRUE);
    
            System.out.println("Default	Cipher");
            for(Iterator i = ciphers.entrySet().iterator(); i.hasNext(); ) {
                Map.Entry cipher=(Map.Entry)i.next();
    
                if(Boolean.TRUE.equals(cipher.getValue()))
                    System.out.print('*');
                else
                    System.out.print(' ');
    
                System.out.print('	');
                System.out.println(cipher.getKey());
            }
        }
    }
  • 相关阅读:
    poj1703--Find them, Catch them
    poj2828--Buy Tickets
    POJ 2594 Treasure Exploration(Floyd+最小路径覆盖)
    HDU
    二分图的一些性质
    HDU
    POJ 1659 Frogs' Neighborhood (Havel定理构造图)
    HDU
    HDU
    2018 Multi-University Training Contest 1
  • 原文地址:https://www.cnblogs.com/dotaZhou/p/6497161.html
Copyright © 2011-2022 走看看