KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > net > ssl > HostnameVerifier


1 /*
2  * @(#)HostnameVerifier.java 1.8 04/02/16
3  *
4  * Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7   
8 /*
9  * NOTE:
10  * Because of various external restrictions (i.e. US export
11  * regulations, etc.), the actual source code can not be provided
12  * at this time. This file represents the skeleton of the source
13  * file, so that javadocs of the API can be created.
14  */

15
16 package javax.net.ssl;
17
18 /**
19  * This class is the base interface for hostname verification.
20  * <P>
21  * During handshaking, if the URL's hostname and
22  * the server's identification hostname mismatch, the
23  * verification mechanism can call back to implementers of this
24  * interface to determine if this connection should be allowed.
25  * <P>
26  * The policies can be certificate-based
27  * or may depend on other authentication schemes.
28  * <P>
29  * These callbacks are used when the default rules for URL hostname
30  * verification fail.
31  *
32  * @author Brad R. Wetmore
33  * @version 1.4, 06/24/03
34  * @since 1.4
35  */

36 public interface HostnameVerifier
37 {
38
39     /**
40      * Verify that the host name is an acceptable match with
41      * the server's authentication scheme.
42      *
43      * @param hostname the host name
44      * @param session SSLSession used on the connection to host
45      * @return true if the host name is acceptable
46      */

47     public boolean verify(String hostname, SSLSession session);
48 }
49
Popular Tags