Search in sources :

Example 16 with KrbException

use of sun.security.krb5.KrbException in project jdk8u_jdk by JetBrains.

the class DNS method main.

public static void main(String[] args) throws Exception {
    System.setProperty("java.security.krb5.conf", System.getProperty("test.src", ".") + "/no-such-file.conf");
    Config config = Config.getInstance();
    try {
        String r = config.getDefaultRealm();
        throw new Exception("What? There is a default realm " + r + "?");
    } catch (KrbException ke) {
        ke.printStackTrace();
        if (ke.getCause() != null) {
            throw new Exception("There should be no cause. Won't try DNS");
        }
    }
    String kdcs = config.getKDCList("X");
    if (!kdcs.equals("a.com.:88 b.com.:99") && !kdcs.equals("a.com. b.com.:99")) {
        throw new Exception("Strange KDC: [" + kdcs + "]");
    }
    ;
}
Also used : Config(sun.security.krb5.Config) KrbException(sun.security.krb5.KrbException) KrbException(sun.security.krb5.KrbException)

Aggregations

KrbException (sun.security.krb5.KrbException)7 IOException (java.io.IOException)3 PrincipalName (sun.security.krb5.PrincipalName)3 KerberosString (sun.security.krb5.internal.util.KerberosString)3 PrivilegedActionException (java.security.PrivilegedActionException)2 KerberosTicket (javax.security.auth.kerberos.KerberosTicket)2 GSSException (org.ietf.jgss.GSSException)2 Config (sun.security.krb5.Config)2 CredentialsCache (sun.security.krb5.internal.ccache.CredentialsCache)2 KeyTab (sun.security.krb5.internal.ktab.KeyTab)2 AuthTimeWithHash (sun.security.krb5.internal.rcache.AuthTimeWithHash)2 DerOutputStream (sun.security.util.DerOutputStream)2 FileOutputStream (java.io.FileOutputStream)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 SocketTimeoutException (java.net.SocketTimeoutException)1 SeekableByteChannel (java.nio.channels.SeekableByteChannel)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 Subject (javax.security.auth.Subject)1 KerberosKey (javax.security.auth.kerberos.KerberosKey)1 KerberosPrincipal (javax.security.auth.kerberos.KerberosPrincipal)1