## org.apache.hadoop.security.authentication.util
Class KerberosUtil

    java.lang.Object
      org.apache.hadoop.security.authentication.util.KerberosUtil

    public class KerberosUtil

extends Object

Constructor Summary
`KerberosUtil()`

Method Summary
`static String` `getDefaultRealm()`
`static String` `getKrb5LoginModuleName()`
`static Oid` `getOidInstance(String oidName)`
`static String` `getServicePrincipal(String service, String hostname)` Create Kerberos principal for a given service and hostname.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### KerberosUtil

    public KerberosUtil()

Method Detail

### getKrb5LoginModuleName

    public static String getKrb5LoginModuleName()

### getOidInstance

    public static Oid getOidInstance(String oidName)
                              throws ClassNotFoundException,
                                     GSSException,
                                     NoSuchFieldException,
                                     IllegalAccessException

  Throws:
    `ClassNotFoundException`
    `GSSException`
    `NoSuchFieldException`
    `IllegalAccessException`

### getDefaultRealm

    public static String getDefaultRealm()
                                  throws ClassNotFoundException,
                                         NoSuchMethodException,
                                         IllegalArgumentException,
                                         IllegalAccessException,
                                         InvocationTargetException

  Throws:
    `ClassNotFoundException`
    `NoSuchMethodException`
    `IllegalArgumentException`
    `IllegalAccessException`
    `InvocationTargetException`

### getServicePrincipal

    public static final String getServicePrincipal(String service,
                                                   String hostname)
                                            throws UnknownHostException

  Create Kerberos principal for a given service and hostname. It converts hostname to lower case. If hostname is null or "0.0.0.0", it uses dynamically looked-up fqdn of the current host instead.

  Parameters:
    `service` - Service for which you want to generate the principal.
    `hostname` - Fully-qualified domain name.
  Returns:
    Converted Kerberos principal name.
  Throws:
    `UnknownHostException` - If no IP address for the local host could be found.

Copyright © 2009 The Apache Software Foundation