46 * |
46 * |
47 */ |
47 */ |
48 public class HostnameChecker { |
48 public class HostnameChecker { |
49 |
49 |
50 // Constant for a HostnameChecker for TLS |
50 // Constant for a HostnameChecker for TLS |
51 public final static byte TYPE_TLS = 1; |
51 public static final byte TYPE_TLS = 1; |
52 private final static HostnameChecker INSTANCE_TLS = |
52 private static final HostnameChecker INSTANCE_TLS = |
53 new HostnameChecker(TYPE_TLS); |
53 new HostnameChecker(TYPE_TLS); |
54 |
54 |
55 // Constant for a HostnameChecker for LDAP |
55 // Constant for a HostnameChecker for LDAP |
56 public final static byte TYPE_LDAP = 2; |
56 public static final byte TYPE_LDAP = 2; |
57 private final static HostnameChecker INSTANCE_LDAP = |
57 private static final HostnameChecker INSTANCE_LDAP = |
58 new HostnameChecker(TYPE_LDAP); |
58 new HostnameChecker(TYPE_LDAP); |
59 |
59 |
60 // constants for subject alt names of type DNS and IP |
60 // constants for subject alt names of type DNS and IP |
61 private final static int ALTNAME_DNS = 2; |
61 private static final int ALTNAME_DNS = 2; |
62 private final static int ALTNAME_IP = 7; |
62 private static final int ALTNAME_IP = 7; |
63 |
63 |
64 // the algorithm to follow to perform the check. Currently unused. |
64 // the algorithm to follow to perform the check. Currently unused. |
65 private final byte checkType; |
65 private final byte checkType; |
66 |
66 |
67 private HostnameChecker(byte checkType) { |
67 private HostnameChecker(byte checkType) { |