Class HostnameToCertificateChecker

java.lang.Object
eu.emi.security.authn.x509.helpers.ssl.HostnameToCertificateChecker

public class HostnameToCertificateChecker extends Object
Verifies if a peer's host name matches a DN of its certificate. It is useful on client side when connecting to a server.

By default the implementation checks the certificate's Subject Alternative Name and Common Name, following the server identity part of RFC 2818. Additionally the 'service/hostname' syntax is supported (the service prefix is simply ignored).

If there is a name mismatch the nameMismatch() method is called. User of this class must extend it and provide the application specific reaction in this method.

Note that this class should be used only on SSL connections which are authenticated with X.509 certificates.

Author:
Joni Hahkala, K. Benedyczak