Package java.security

Examples of java.security.SecureRandom


        {
        }
        public void checkServerTrusted(X509Certificate[] chain,  String authType) throws CertificateException
        {
        }
      }}, new SecureRandom());
      SSLSocketFactory sf = new SSLSocketFactory(sslContext, new AllowAllHostnameVerifier());
      httpsScheme = new Scheme("https", 443, sf);
    }
    else
      httpsScheme = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());
View Full Code Here


        {
        }
        public void checkServerTrusted(X509Certificate[] chain,  String authType) throws CertificateException
        {
        }
      }}, new SecureRandom());
      SSLSocketFactory sf = new SSLSocketFactory(sslContext, new AllowAllHostnameVerifier());
      httpsScheme = new Scheme("https", 443, sf);
    }
    else
      httpsScheme = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());
View Full Code Here

        {
        }
        public void checkServerTrusted(X509Certificate[] chain,  String authType) throws CertificateException
        {
        }
      }}, new SecureRandom());
      SSLSocketFactory sf = new SSLSocketFactory(sslContext, new AllowAllHostnameVerifier());
      httpsScheme = new Scheme("https", 443, sf);
    }
    else
      httpsScheme = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());
View Full Code Here

            try {
              String[] sslContexts = new String[]{ "TLS", "SSL" };

              for(String ctx : sslContexts) {
                SSLContext sc = SSLContext.getInstance(ctx);
                sc.init(keyManagers, trustManagers, new SecureRandom());
                h.setSSLSocketFactory(sc.getSocketFactory());
              }

            } catch(Exception ex) {
              throw new XMLRPCException(ex);
View Full Code Here

        {
        }
        public void checkServerTrusted(X509Certificate[] chain,  String authType) throws CertificateException
        {
        }
      }}, new SecureRandom());
      SSLSocketFactory sf = new SSLSocketFactory(sslContext, new AllowAllHostnameVerifier());
      httpsScheme = new Scheme("https", 443, sf);
    }
    else
      httpsScheme = new Scheme("http", 80, PlainSocketFactory.getSocketFactory());
View Full Code Here

     * @return an UUID instance.
     */
    public static String randomUUID() {
        byte[] data;
        // lock on the class to protect lazy init
        SecureRandom rng = new SecureRandom();
        rng.nextBytes(data = new byte[16]);
        long mostSigBits = (data[0] & 0xFFL) << 56;
        mostSigBits |= (data[1] & 0xFFL) << 48;
        mostSigBits |= (data[2] & 0xFFL) << 40;
        mostSigBits |= (data[3] & 0xFFL) << 32;
        mostSigBits |= (data[4] & 0xFFL) << 24;
View Full Code Here

    @Inject
    public CustomPersistentRememberMeServices(Environment env, org.springframework.security.core.userdetails.UserDetailsService userDetailsService) {

        super(env.getProperty("jhipster.security.rememberme.key"), userDetailsService);
        random = new SecureRandom();
    }
View Full Code Here

                for (InterfaceAddress address : ifc.getInterfaceAddresses()) {
                    addresses.add(new Client.HostPort(address.getAddress().getHostAddress(), opts.port));
                }
            }
        }
        long serverId = new SecureRandom().nextLong();

        Set<Server> servers = instance.getSet("servers");
        Server r = new Server(serverId, addresses);
        servers.add(r);
        logger.warn("Currently have these servers: {}", servers);
View Full Code Here

//        logPolicy.setLogRequestProto(true);
//        logPolicy.setLogResponseProto(true);
//        bootstrap.setLogger(logPolicy);

        //Finally binding the bootstrap to the TCP port will start off the socket accepting and clients can start to connect.
        long serverId = new SecureRandom().nextLong();
        String zk_str = props.getProperty("zookeeper.connection.string", ZK_CONNECT_STRING);
        if (args.length == 3) {
            zk_str = args[2];
        }
View Full Code Here

                for (InterfaceAddress address : ifc.getInterfaceAddresses()) {
                    addresses.add(new Client.HostPort(address.getAddress().getHostAddress(), port));
                }
            }
        }
        serverId = new SecureRandom().nextLong();

        us = new Server(serverId, addresses);
    }
View Full Code Here

TOP

Related Classes of java.security.SecureRandom

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.