FileDocCategorySizeDatePackage
SSLServerKeyManager.javaAPI DocExample955Mon Jan 15 12:16:44 GMT 2001javasec.samples.ch14

SSLServerKeyManager

public class SSLServerKeyManager extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

	Security.addProvider(new XYZProvider());

        SSLContext sc = SSLContext.getInstance("TLS");
        KeyStore ks = KeyStore.getInstance("jceks");
        char[] password = args[1].toCharArray();
        ks.load(new FileInputStream(args[0]), null);

        KeyManagerFactory kmf = KeyManagerFactory.getInstance("XYZ");
        kmf.init(ks, password);
        sc.init(kmf.getKeyManagers(), null, null);

        ServerSocketFactory ssf = sc.getServerSocketFactory();
        ServerSocket ss = ssf.createServerSocket(9096);

        while (true) {
            new SSLSimpleServer(ss.accept()).start();
        }