Path: blob/master/test/jdk/javax/net/ssl/sanity/pluggability/MySSLEngineImpl.java
41154 views
/*1* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223import java.util.*;24import java.nio.ByteBuffer;25import java.security.cert.Certificate;26import java.security.cert.X509Certificate;27import java.security.*;28import java.net.*;29import javax.net.*;30import javax.net.ssl.*;3132public class MySSLEngineImpl extends SSLEngine {33private static String[] supportedCS = CipherSuites.CUSTOM;3435public static void useStandardCipherSuites() {36supportedCS = CipherSuites.STANDARD;37}38public static void useCustomCipherSuites() {39supportedCS = CipherSuites.CUSTOM;40}41public MySSLEngineImpl() {42super();43}44public MySSLEngineImpl(String host, int port) {45super(host, port);46}47public SSLEngineResult wrap(ByteBuffer [] src, int off, int len,48ByteBuffer dst) throws SSLException { return null; }49public SSLEngineResult unwrap(ByteBuffer src,50ByteBuffer [] dst, int off, int len)51throws SSLException { return null; }52public Runnable getDelegatedTask() { return null; }53public void closeInbound() {}54public boolean isInboundDone() { return false; }55public void closeOutbound() {}56public boolean isOutboundDone() { return false; }5758public String[] getEnabledCipherSuites() {59return getSupportedCipherSuites();60}61public String[] getSupportedCipherSuites() {62return (String[]) supportedCS.clone();63}64public void setEnabledCipherSuites(String[] suites) {}65public String[] getSupportedProtocols() { return null; }66public String[] getEnabledProtocols() { return null; }67public void setEnabledProtocols(String[] protocols) {}68public SSLSession getSession() { return null; }69public void beginHandshake() throws SSLException {}70public SSLEngineResult.HandshakeStatus getHandshakeStatus() {71return SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING;72}73public void setUseClientMode(boolean mode) {};74public boolean getUseClientMode() { return false; }75public void setNeedClientAuth(boolean need) {}76public boolean getNeedClientAuth() { return false; }77public void setWantClientAuth(boolean need) {}78public boolean getWantClientAuth() { return false; }79public void setEnableSessionCreation(boolean flag) {}80public boolean getEnableSessionCreation() { return false; }81}828384