Java Code Examples for javax.security.auth.kerberos.KerberosTicket#getClientAddresses()

The following examples show how to use javax.security.auth.kerberos.KerberosTicket#getClientAddresses() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Krb5Util.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public static Credentials ticketToCreds(KerberosTicket kerbTicket)
        throws KrbException, IOException {
    KerberosPrincipal clientAlias = KerberosSecrets
            .getJavaxSecurityAuthKerberosAccess()
            .kerberosTicketGetClientAlias(kerbTicket);
    KerberosPrincipal serverAlias = KerberosSecrets
            .getJavaxSecurityAuthKerberosAccess()
            .kerberosTicketGetServerAlias(kerbTicket);
    return new Credentials(
        kerbTicket.getEncoded(),
        kerbTicket.getClient().getName(),
        (clientAlias != null ? clientAlias.getName() : null),
        kerbTicket.getServer().getName(),
        (serverAlias != null ? serverAlias.getName() : null),
        kerbTicket.getSessionKey().getEncoded(),
        kerbTicket.getSessionKeyType(),
        kerbTicket.getFlags(),
        kerbTicket.getAuthTime(),
        kerbTicket.getStartTime(),
        kerbTicket.getEndTime(),
        kerbTicket.getRenewTill(),
        kerbTicket.getClientAddresses());
}
 
Example 2
Source File: Krb5Util.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public static Credentials ticketToCreds(KerberosTicket kerbTicket)
        throws KrbException, IOException {
    KerberosPrincipal clientAlias = KerberosSecrets
            .getJavaxSecurityAuthKerberosAccess()
            .kerberosTicketGetClientAlias(kerbTicket);
    KerberosPrincipal serverAlias = KerberosSecrets
            .getJavaxSecurityAuthKerberosAccess()
            .kerberosTicketGetServerAlias(kerbTicket);
    return new Credentials(
        kerbTicket.getEncoded(),
        kerbTicket.getClient().getName(),
        (clientAlias != null ? clientAlias.getName() : null),
        kerbTicket.getServer().getName(),
        (serverAlias != null ? serverAlias.getName() : null),
        kerbTicket.getSessionKey().getEncoded(),
        kerbTicket.getSessionKeyType(),
        kerbTicket.getFlags(),
        kerbTicket.getAuthTime(),
        kerbTicket.getStartTime(),
        kerbTicket.getEndTime(),
        kerbTicket.getRenewTill(),
        kerbTicket.getClientAddresses());
}
 
Example 3
Source File: Krb5Util.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public static Credentials ticketToCreds(KerberosTicket kerbTicket)
        throws KrbException, IOException {
    KerberosPrincipal clientAlias = KerberosSecrets
            .getJavaxSecurityAuthKerberosAccess()
            .kerberosTicketGetClientAlias(kerbTicket);
    KerberosPrincipal serverAlias = KerberosSecrets
            .getJavaxSecurityAuthKerberosAccess()
            .kerberosTicketGetServerAlias(kerbTicket);
    return new Credentials(
        kerbTicket.getEncoded(),
        kerbTicket.getClient().getName(),
        (clientAlias != null ? clientAlias.getName() : null),
        kerbTicket.getServer().getName(),
        (serverAlias != null ? serverAlias.getName() : null),
        kerbTicket.getSessionKey().getEncoded(),
        kerbTicket.getSessionKeyType(),
        kerbTicket.getFlags(),
        kerbTicket.getAuthTime(),
        kerbTicket.getStartTime(),
        kerbTicket.getEndTime(),
        kerbTicket.getRenewTill(),
        kerbTicket.getClientAddresses());
}
 
Example 4
Source File: Krb5Util.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static Credentials ticketToCreds(KerberosTicket kerbTicket)
        throws KrbException, IOException {
    return new Credentials(
        kerbTicket.getEncoded(),
        kerbTicket.getClient().getName(),
        kerbTicket.getServer().getName(),
        kerbTicket.getSessionKey().getEncoded(),
        kerbTicket.getSessionKeyType(),
        kerbTicket.getFlags(),
        kerbTicket.getAuthTime(),
        kerbTicket.getStartTime(),
        kerbTicket.getEndTime(),
        kerbTicket.getRenewTill(),
        kerbTicket.getClientAddresses());
}
 
Example 5
Source File: Krb5Util.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static Credentials ticketToCreds(KerberosTicket kerbTicket)
        throws KrbException, IOException {
    return new Credentials(
        kerbTicket.getEncoded(),
        kerbTicket.getClient().getName(),
        kerbTicket.getServer().getName(),
        kerbTicket.getSessionKey().getEncoded(),
        kerbTicket.getSessionKeyType(),
        kerbTicket.getFlags(),
        kerbTicket.getAuthTime(),
        kerbTicket.getStartTime(),
        kerbTicket.getEndTime(),
        kerbTicket.getRenewTill(),
        kerbTicket.getClientAddresses());
}
 
Example 6
Source File: Krb5Util.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static Credentials ticketToCreds(KerberosTicket kerbTicket)
        throws KrbException, IOException {
    return new Credentials(
        kerbTicket.getEncoded(),
        kerbTicket.getClient().getName(),
        kerbTicket.getServer().getName(),
        kerbTicket.getSessionKey().getEncoded(),
        kerbTicket.getSessionKeyType(),
        kerbTicket.getFlags(),
        kerbTicket.getAuthTime(),
        kerbTicket.getStartTime(),
        kerbTicket.getEndTime(),
        kerbTicket.getRenewTill(),
        kerbTicket.getClientAddresses());
}
 
Example 7
Source File: Krb5Util.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static Credentials ticketToCreds(KerberosTicket kerbTicket)
        throws KrbException, IOException {
    return new Credentials(
        kerbTicket.getEncoded(),
        kerbTicket.getClient().getName(),
        kerbTicket.getServer().getName(),
        kerbTicket.getSessionKey().getEncoded(),
        kerbTicket.getSessionKeyType(),
        kerbTicket.getFlags(),
        kerbTicket.getAuthTime(),
        kerbTicket.getStartTime(),
        kerbTicket.getEndTime(),
        kerbTicket.getRenewTill(),
        kerbTicket.getClientAddresses());
}
 
Example 8
Source File: Krb5InitCredential.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
static Krb5InitCredential getInstance(GSSCaller caller, Krb5NameElement name,
                               int initLifetime)
    throws GSSException {

    KerberosTicket tgt = getTgt(caller, name, initLifetime);
    if (tgt == null)
        throw new GSSException(GSSException.NO_CRED, -1,
                               "Failed to find any Kerberos tgt");

    if (name == null) {
        String fullName = tgt.getClient().getName();
        name = Krb5NameElement.getInstance(fullName,
                                   Krb5MechFactory.NT_GSS_KRB5_PRINCIPAL);
    }

    return new Krb5InitCredential(name,
                                  tgt.getEncoded(),
                                  tgt.getClient(),
                                  tgt.getServer(),
                                  tgt.getSessionKey().getEncoded(),
                                  tgt.getSessionKeyType(),
                                  tgt.getFlags(),
                                  tgt.getAuthTime(),
                                  tgt.getStartTime(),
                                  tgt.getEndTime(),
                                  tgt.getRenewTill(),
                                  tgt.getClientAddresses());
}
 
Example 9
Source File: Krb5Util.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static Credentials ticketToCreds(KerberosTicket kerbTicket)
        throws KrbException, IOException {
    return new Credentials(
        kerbTicket.getEncoded(),
        kerbTicket.getClient().getName(),
        kerbTicket.getServer().getName(),
        kerbTicket.getSessionKey().getEncoded(),
        kerbTicket.getSessionKeyType(),
        kerbTicket.getFlags(),
        kerbTicket.getAuthTime(),
        kerbTicket.getStartTime(),
        kerbTicket.getEndTime(),
        kerbTicket.getRenewTill(),
        kerbTicket.getClientAddresses());
}
 
Example 10
Source File: Krb5Util.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static Credentials ticketToCreds(KerberosTicket kerbTicket)
        throws KrbException, IOException {
    return new Credentials(
        kerbTicket.getEncoded(),
        kerbTicket.getClient().getName(),
        kerbTicket.getServer().getName(),
        kerbTicket.getSessionKey().getEncoded(),
        kerbTicket.getSessionKeyType(),
        kerbTicket.getFlags(),
        kerbTicket.getAuthTime(),
        kerbTicket.getStartTime(),
        kerbTicket.getEndTime(),
        kerbTicket.getRenewTill(),
        kerbTicket.getClientAddresses());
}
 
Example 11
Source File: Addresses.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {

        KDC.saveConfig(OneKDC.KRB5_CONF, new OneKDC(null),
                "noaddresses = false",
                "extra_addresses = 10.0.0.10, 10.0.0.11 10.0.0.12");
        Config.refresh();

        KerberosTicket ticket =
                Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false)
                        .s().getPrivateCredentials(KerberosTicket.class)
                        .iterator().next();

        InetAddress loopback = InetAddress.getLoopbackAddress();
        InetAddress extra1 = InetAddress.getByName("10.0.0.10");
        InetAddress extra2 = InetAddress.getByName("10.0.0.11");
        InetAddress extra3 = InetAddress.getByName("10.0.0.12");

        boolean loopbackFound = false;
        boolean extra1Found = false;
        boolean extra2Found = false;
        boolean extra3Found = false;
        boolean networkFound = false;

        for (InetAddress ia: ticket.getClientAddresses()) {
            System.out.println(ia);
            if (ia.equals(loopback)) {
                loopbackFound = true;
                System.out.println("  loopback found");
            } else if (ia.equals(extra1)) {
                extra1Found = true;
                System.out.println("  extra1 found");
            } else if (ia.equals(extra2)) {
                extra2Found = true;
                System.out.println("  extra2 found");
            } else if (ia.equals(extra3)) {
                extra3Found = true;
                System.out.println("  extra3 found");
            } else if (ia instanceof Inet4Address) {
                networkFound = true;
                System.out.println("  another address (" + ia +
                        "), assumed real network");
            }
        }

        if (!loopbackFound || !networkFound
                || !extra1Found || !extra2Found || !extra3Found ) {
            throw new Exception();
        }
    }
 
Example 12
Source File: AddressesAndNameType.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args)
        throws Exception {

    OneKDC kdc = new OneKDC(null);
    kdc.writeJAASConf();

    String extraLine;
    switch (args[0]) {
        case "1": extraLine = "noaddresses = false"; break;
        case "2": extraLine = "noaddresses = true"; break;
        default: extraLine = ""; break;
    }

    KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
            extraLine);
    Config.refresh();

    Context c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false);
    Set<KerberosTicket> tickets =
            c.s().getPrivateCredentials(KerberosTicket.class);

    if (tickets.isEmpty()) throw new Exception();
    KerberosTicket ticket = tickets.iterator().next();
    InetAddress[] addresses = ticket.getClientAddresses();

    switch (args[0]) {
        case "1":
            if (addresses == null || addresses.length == 0) {
                throw new Exception("No addresses");
            }
            if (ticket.getServer().getNameType()
                    != KerberosPrincipal.KRB_NT_SRV_INST) {
                throw new Exception(
                        "Wrong type: " + ticket.getServer().getNameType());
            }
            break;
        default:
            if (addresses != null && addresses.length != 0) {
                throw new Exception("See addresses");
            }
            break;
    }
}
 
Example 13
Source File: Addresses.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {

        KDC.saveConfig(OneKDC.KRB5_CONF, new OneKDC(null),
                "noaddresses = false",
                "extra_addresses = 10.0.0.10, 10.0.0.11 10.0.0.12");
        Config.refresh();

        KerberosTicket ticket =
                Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false)
                        .s().getPrivateCredentials(KerberosTicket.class)
                        .iterator().next();

        InetAddress loopback = InetAddress.getLoopbackAddress();
        InetAddress extra1 = InetAddress.getByName("10.0.0.10");
        InetAddress extra2 = InetAddress.getByName("10.0.0.11");
        InetAddress extra3 = InetAddress.getByName("10.0.0.12");

        boolean loopbackFound = false;
        boolean extra1Found = false;
        boolean extra2Found = false;
        boolean extra3Found = false;
        boolean networkFound = false;

        for (InetAddress ia: ticket.getClientAddresses()) {
            System.out.println(ia);
            if (ia.equals(loopback)) {
                loopbackFound = true;
                System.out.println("  loopback found");
            } else if (ia.equals(extra1)) {
                extra1Found = true;
                System.out.println("  extra1 found");
            } else if (ia.equals(extra2)) {
                extra2Found = true;
                System.out.println("  extra2 found");
            } else if (ia.equals(extra3)) {
                extra3Found = true;
                System.out.println("  extra3 found");
            } else if (ia instanceof Inet4Address) {
                networkFound = true;
                System.out.println("  another address (" + ia +
                        "), assumed real network");
            }
        }

        if (!loopbackFound || !networkFound
                || !extra1Found || !extra2Found || !extra3Found ) {
            throw new Exception();
        }
    }
 
Example 14
Source File: AddressesAndNameType.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args)
        throws Exception {

    OneKDC kdc = new OneKDC(null);
    kdc.writeJAASConf();

    String extraLine;
    switch (args[0]) {
        case "1": extraLine = "noaddresses = false"; break;
        case "2": extraLine = "noaddresses = true"; break;
        default: extraLine = ""; break;
    }

    KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
            extraLine);
    Config.refresh();

    Context c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false);
    Set<KerberosTicket> tickets =
            c.s().getPrivateCredentials(KerberosTicket.class);

    if (tickets.isEmpty()) throw new Exception();
    KerberosTicket ticket = tickets.iterator().next();
    InetAddress[] addresses = ticket.getClientAddresses();

    switch (args[0]) {
        case "1":
            if (addresses == null || addresses.length == 0) {
                throw new Exception("No addresses");
            }
            if (ticket.getServer().getNameType()
                    != KerberosPrincipal.KRB_NT_SRV_INST) {
                throw new Exception(
                        "Wrong type: " + ticket.getServer().getNameType());
            }
            break;
        default:
            if (addresses != null && addresses.length != 0) {
                throw new Exception("See addresses");
            }
            break;
    }
}
 
Example 15
Source File: Addresses.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {

        KDC.saveConfig(OneKDC.KRB5_CONF, new OneKDC(null),
                "noaddresses = false",
                "extra_addresses = 10.0.0.10, 10.0.0.11 10.0.0.12");
        Config.refresh();

        KerberosTicket ticket =
                Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false)
                        .s().getPrivateCredentials(KerberosTicket.class)
                        .iterator().next();

        InetAddress loopback = InetAddress.getLoopbackAddress();
        InetAddress extra1 = InetAddress.getByName("10.0.0.10");
        InetAddress extra2 = InetAddress.getByName("10.0.0.11");
        InetAddress extra3 = InetAddress.getByName("10.0.0.12");

        boolean loopbackFound = false;
        boolean extra1Found = false;
        boolean extra2Found = false;
        boolean extra3Found = false;
        boolean networkFound = false;

        for (InetAddress ia: ticket.getClientAddresses()) {
            System.out.println(ia);
            if (ia.equals(loopback)) {
                loopbackFound = true;
                System.out.println("  loopback found");
            } else if (ia.equals(extra1)) {
                extra1Found = true;
                System.out.println("  extra1 found");
            } else if (ia.equals(extra2)) {
                extra2Found = true;
                System.out.println("  extra2 found");
            } else if (ia.equals(extra3)) {
                extra3Found = true;
                System.out.println("  extra3 found");
            } else if (ia instanceof Inet4Address) {
                networkFound = true;
                System.out.println("  another address (" + ia +
                        "), assumed real network");
            }
        }

        if (!loopbackFound || !networkFound
                || !extra1Found || !extra2Found || !extra3Found ) {
            throw new Exception();
        }
    }
 
Example 16
Source File: Addresses.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {

        KDC.saveConfig(OneKDC.KRB5_CONF, new OneKDC(null),
                "noaddresses = false",
                "extra_addresses = 10.0.0.10, 10.0.0.11 10.0.0.12");
        Config.refresh();

        KerberosTicket ticket =
                Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false)
                        .s().getPrivateCredentials(KerberosTicket.class)
                        .iterator().next();

        InetAddress loopback = InetAddress.getLoopbackAddress();
        InetAddress extra1 = InetAddress.getByName("10.0.0.10");
        InetAddress extra2 = InetAddress.getByName("10.0.0.11");
        InetAddress extra3 = InetAddress.getByName("10.0.0.12");

        boolean loopbackFound = false;
        boolean extra1Found = false;
        boolean extra2Found = false;
        boolean extra3Found = false;
        boolean networkFound = false;

        for (InetAddress ia: ticket.getClientAddresses()) {
            System.out.println(ia);
            if (ia.equals(loopback)) {
                loopbackFound = true;
                System.out.println("  loopback found");
            } else if (ia.equals(extra1)) {
                extra1Found = true;
                System.out.println("  extra1 found");
            } else if (ia.equals(extra2)) {
                extra2Found = true;
                System.out.println("  extra2 found");
            } else if (ia.equals(extra3)) {
                extra3Found = true;
                System.out.println("  extra3 found");
            } else if (ia instanceof Inet4Address) {
                networkFound = true;
                System.out.println("  another address (" + ia +
                        "), assumed real network");
            }
        }

        if (!loopbackFound || !networkFound
                || !extra1Found || !extra2Found || !extra3Found ) {
            throw new Exception();
        }
    }
 
Example 17
Source File: AddressesAndNameType.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args)
        throws Exception {

    OneKDC kdc = new OneKDC(null);
    kdc.writeJAASConf();

    String extraLine;
    switch (args[0]) {
        case "1": extraLine = "noaddresses = false"; break;
        case "2": extraLine = "noaddresses = true"; break;
        default: extraLine = ""; break;
    }

    KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
            extraLine);
    Config.refresh();

    Context c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false);
    Set<KerberosTicket> tickets =
            c.s().getPrivateCredentials(KerberosTicket.class);

    if (tickets.isEmpty()) throw new Exception();
    KerberosTicket ticket = tickets.iterator().next();
    InetAddress[] addresses = ticket.getClientAddresses();

    switch (args[0]) {
        case "1":
            if (addresses == null || addresses.length == 0) {
                throw new Exception("No addresses");
            }
            if (ticket.getServer().getNameType()
                    != KerberosPrincipal.KRB_NT_SRV_INST) {
                throw new Exception(
                        "Wrong type: " + ticket.getServer().getNameType());
            }
            break;
        default:
            if (addresses != null && addresses.length != 0) {
                throw new Exception("See addresses");
            }
            break;
    }
}
 
Example 18
Source File: AddressesAndNameType.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args)
        throws Exception {

    OneKDC kdc = new OneKDC(null);
    kdc.writeJAASConf();

    String extraLine;
    switch (args[0]) {
        case "1": extraLine = "noaddresses = false"; break;
        case "2": extraLine = "noaddresses = true"; break;
        default: extraLine = ""; break;
    }

    KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
            extraLine);
    Config.refresh();

    Context c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false);
    Set<KerberosTicket> tickets =
            c.s().getPrivateCredentials(KerberosTicket.class);

    if (tickets.isEmpty()) throw new Exception();
    KerberosTicket ticket = tickets.iterator().next();
    InetAddress[] addresses = ticket.getClientAddresses();

    switch (args[0]) {
        case "1":
            if (addresses == null || addresses.length == 0) {
                throw new Exception("No addresses");
            }
            if (ticket.getServer().getNameType()
                    != KerberosPrincipal.KRB_NT_SRV_INST) {
                throw new Exception(
                        "Wrong type: " + ticket.getServer().getNameType());
            }
            break;
        default:
            if (addresses != null && addresses.length != 0) {
                throw new Exception("See addresses");
            }
            break;
    }
}
 
Example 19
Source File: AddressesAndNameType.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args)
        throws Exception {

    OneKDC kdc = new OneKDC(null);
    kdc.writeJAASConf();

    String extraLine;
    switch (args[0]) {
        case "1": extraLine = "noaddresses = false"; break;
        case "2": extraLine = "noaddresses = true"; break;
        default: extraLine = ""; break;
    }

    KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
            extraLine);
    Config.refresh();

    Context c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false);
    Set<KerberosTicket> tickets =
            c.s().getPrivateCredentials(KerberosTicket.class);

    if (tickets.isEmpty()) throw new Exception();
    KerberosTicket ticket = tickets.iterator().next();
    InetAddress[] addresses = ticket.getClientAddresses();

    switch (args[0]) {
        case "1":
            if (addresses == null || addresses.length == 0) {
                throw new Exception("No addresses");
            }
            if (ticket.getServer().getNameType()
                    != KerberosPrincipal.KRB_NT_SRV_INST) {
                throw new Exception(
                        "Wrong type: " + ticket.getServer().getNameType());
            }
            break;
        default:
            if (addresses != null && addresses.length != 0) {
                throw new Exception("See addresses");
            }
            break;
    }
}
 
Example 20
Source File: AddressesAndNameType.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args)
        throws Exception {

    OneKDC kdc = new OneKDC(null);
    kdc.writeJAASConf();

    String extraLine;
    switch (args[0]) {
        case "1": extraLine = "noaddresses = false"; break;
        case "2": extraLine = "noaddresses = true"; break;
        default: extraLine = ""; break;
    }

    KDC.saveConfig(OneKDC.KRB5_CONF, kdc,
            extraLine);
    Config.refresh();

    Context c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false);
    Set<KerberosTicket> tickets =
            c.s().getPrivateCredentials(KerberosTicket.class);

    if (tickets.isEmpty()) throw new Exception();
    KerberosTicket ticket = tickets.iterator().next();
    InetAddress[] addresses = ticket.getClientAddresses();

    switch (args[0]) {
        case "1":
            if (addresses == null || addresses.length == 0) {
                throw new Exception("No addresses");
            }
            if (ticket.getServer().getNameType()
                    != KerberosPrincipal.KRB_NT_SRV_INST) {
                throw new Exception(
                        "Wrong type: " + ticket.getServer().getNameType());
            }
            break;
        default:
            if (addresses != null && addresses.length != 0) {
                throw new Exception("See addresses");
            }
            break;
    }
}