Java Code Examples for sun.security.krb5.PrincipalName#getNameType()

The following examples show how to use sun.security.krb5.PrincipalName#getNameType() . 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: HostAddresses.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public HostAddresses(PrincipalName serverPrincipal)
    throws UnknownHostException, KrbException {

    String[] components = serverPrincipal.getNameStrings();

    if (serverPrincipal.getNameType() != PrincipalName.KRB_NT_SRV_HST ||
        components.length < 2)
        throw new KrbException(Krb5.KRB_ERR_GENERIC, "Bad name");

    String host = components[1];
    InetAddress addr[] = InetAddress.getAllByName(host);
    HostAddress hAddrs[] = new HostAddress[addr.length];

    for (int i = 0; i < addr.length; i++) {
        hAddrs[i] = new HostAddress(addr[i]);
    }

    addresses = hAddrs;
}
 
Example 2
Source File: HostAddresses.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public HostAddresses(PrincipalName serverPrincipal)
    throws UnknownHostException, KrbException {

    String[] components = serverPrincipal.getNameStrings();

    if (serverPrincipal.getNameType() != PrincipalName.KRB_NT_SRV_HST ||
        components.length < 2)
        throw new KrbException(Krb5.KRB_ERR_GENERIC, "Bad name");

    String host = components[1];
    InetAddress addr[] = InetAddress.getAllByName(host);
    HostAddress hAddrs[] = new HostAddress[addr.length];

    for (int i = 0; i < addr.length; i++) {
        hAddrs[i] = new HostAddress(addr[i]);
    }

    addresses = hAddrs;
}
 
Example 3
Source File: KerberosPrincipal.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Reads this object from a stream (i.e., deserializes it)
 */
private void readObject(ObjectInputStream ois)
        throws IOException, ClassNotFoundException {
    byte[] asn1EncPrincipal = (byte [])ois.readObject();
    byte[] encRealm = (byte [])ois.readObject();
    try {
       Realm realmObject = new Realm(new DerValue(encRealm));
       PrincipalName krb5Principal = new PrincipalName(
               new DerValue(asn1EncPrincipal), realmObject);
       realm = realmObject.toString();
       fullName = krb5Principal.toString();
       nameType = krb5Principal.getNameType();
    } catch (Exception e) {
        throw new IOException(e);
    }
}
 
Example 4
Source File: HostAddresses.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
public HostAddresses(PrincipalName serverPrincipal)
    throws UnknownHostException, KrbException {

    String[] components = serverPrincipal.getNameStrings();

    if (serverPrincipal.getNameType() != PrincipalName.KRB_NT_SRV_HST ||
        components.length < 2)
        throw new KrbException(Krb5.KRB_ERR_GENERIC, "Bad name");

    String host = components[1];
    InetAddress addr[] = InetAddress.getAllByName(host);
    HostAddress hAddrs[] = new HostAddress[addr.length];

    for (int i = 0; i < addr.length; i++) {
        hAddrs[i] = new HostAddress(addr[i]);
    }

    addresses = hAddrs;
}
 
Example 5
Source File: KerberosPrincipal.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Reads this object from a stream (i.e., deserializes it)
 */
private void readObject(ObjectInputStream ois)
        throws IOException, ClassNotFoundException {
    byte[] asn1EncPrincipal = (byte [])ois.readObject();
    byte[] encRealm = (byte [])ois.readObject();
    try {
       Realm realmObject = new Realm(new DerValue(encRealm));
       PrincipalName krb5Principal = new PrincipalName(
               new DerValue(asn1EncPrincipal), realmObject);
       realm = realmObject.toString();
       fullName = krb5Principal.toString();
       nameType = krb5Principal.getNameType();
    } catch (Exception e) {
        throw new IOException(e);
    }
}
 
Example 6
Source File: KerberosPrincipal.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Reads this object from a stream (i.e., deserializes it)
 */
private void readObject(ObjectInputStream ois)
        throws IOException, ClassNotFoundException {
    byte[] asn1EncPrincipal = (byte [])ois.readObject();
    byte[] encRealm = (byte [])ois.readObject();
    try {
       Realm realmObject = new Realm(new DerValue(encRealm));
       PrincipalName krb5Principal = new PrincipalName(
               new DerValue(asn1EncPrincipal), realmObject);
       realm = realmObject.toString();
       fullName = krb5Principal.toString();
       nameType = krb5Principal.getNameType();
    } catch (Exception e) {
        throw new IOException(e);
    }
}
 
Example 7
Source File: HostAddresses.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public HostAddresses(PrincipalName serverPrincipal)
    throws UnknownHostException, KrbException {

    String[] components = serverPrincipal.getNameStrings();

    if (serverPrincipal.getNameType() != PrincipalName.KRB_NT_SRV_HST ||
        components.length < 2)
        throw new KrbException(Krb5.KRB_ERR_GENERIC, "Bad name");

    String host = components[1];
    InetAddress addr[] = InetAddress.getAllByName(host);
    HostAddress hAddrs[] = new HostAddress[addr.length];

    for (int i = 0; i < addr.length; i++) {
        hAddrs[i] = new HostAddress(addr[i]);
    }

    addresses = hAddrs;
}
 
Example 8
Source File: KerberosPrincipal.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Reads this object from a stream (i.e., deserializes it)
 */
private void readObject(ObjectInputStream ois)
        throws IOException, ClassNotFoundException {
    byte[] asn1EncPrincipal = (byte [])ois.readObject();
    byte[] encRealm = (byte [])ois.readObject();
    try {
       Realm realmObject = new Realm(new DerValue(encRealm));
       PrincipalName krb5Principal = new PrincipalName(
               new DerValue(asn1EncPrincipal), realmObject);
       realm = realmObject.toString();
       fullName = krb5Principal.toString();
       nameType = krb5Principal.getNameType();
    } catch (Exception e) {
        throw new IOException(e);
    }
}
 
Example 9
Source File: HostAddresses.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public HostAddresses(PrincipalName serverPrincipal)
    throws UnknownHostException, KrbException {

    String[] components = serverPrincipal.getNameStrings();

    if (serverPrincipal.getNameType() != PrincipalName.KRB_NT_SRV_HST ||
        components.length < 2)
        throw new KrbException(Krb5.KRB_ERR_GENERIC, "Bad name");

    String host = components[1];
    InetAddress[] addr = InetAddress.getAllByName(host);
    HostAddress[] hAddrs = new HostAddress[addr.length];

    for (int i = 0; i < addr.length; i++) {
        hAddrs[i] = new HostAddress(addr[i]);
    }

    addresses = hAddrs;
}
 
Example 10
Source File: KerberosPrincipal.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Reads this object from a stream (i.e., deserializes it)
 */
private void readObject(ObjectInputStream ois)
        throws IOException, ClassNotFoundException {
    byte[] asn1EncPrincipal = (byte [])ois.readObject();
    byte[] encRealm = (byte [])ois.readObject();
    try {
       Realm realmObject = new Realm(new DerValue(encRealm));
       PrincipalName krb5Principal = new PrincipalName(
               new DerValue(asn1EncPrincipal), realmObject);
       realm = realmObject.toString();
       fullName = krb5Principal.toString();
       nameType = krb5Principal.getNameType();
    } catch (Exception e) {
        throw new IOException(e);
    }
}
 
Example 11
Source File: KerberosPrincipal.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Reads this object from a stream (i.e., deserializes it)
 */
private void readObject(ObjectInputStream ois)
        throws IOException, ClassNotFoundException {
    byte[] asn1EncPrincipal = (byte [])ois.readObject();
    byte[] encRealm = (byte [])ois.readObject();
    try {
       Realm realmObject = new Realm(new DerValue(encRealm));
       PrincipalName krb5Principal = new PrincipalName(
               new DerValue(asn1EncPrincipal), realmObject);
       realm = realmObject.toString();
       fullName = krb5Principal.toString();
       nameType = krb5Principal.getNameType();
    } catch (Exception e) {
        throw new IOException(e);
    }
}
 
Example 12
Source File: KerberosPrincipal.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Reads this object from a stream (i.e., deserializes it)
 */
private void readObject(ObjectInputStream ois)
        throws IOException, ClassNotFoundException {
    byte[] asn1EncPrincipal = (byte [])ois.readObject();
    byte[] encRealm = (byte [])ois.readObject();
    try {
       Realm realmObject = new Realm(new DerValue(encRealm));
       PrincipalName krb5Principal = new PrincipalName(
               new DerValue(asn1EncPrincipal), realmObject);
       realm = realmObject.toString();
       fullName = krb5Principal.toString();
       nameType = krb5Principal.getNameType();
    } catch (Exception e) {
        throw new IOException(e);
    }
}
 
Example 13
Source File: HostAddresses.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public HostAddresses(PrincipalName serverPrincipal)
    throws UnknownHostException, KrbException {

    String[] components = serverPrincipal.getNameStrings();

    if (serverPrincipal.getNameType() != PrincipalName.KRB_NT_SRV_HST ||
        components.length < 2)
        throw new KrbException(Krb5.KRB_ERR_GENERIC, "Bad name");

    String host = components[1];
    InetAddress addr[] = InetAddress.getAllByName(host);
    HostAddress hAddrs[] = new HostAddress[addr.length];

    for (int i = 0; i < addr.length; i++) {
        hAddrs[i] = new HostAddress(addr[i]);
    }

    addresses = hAddrs;
}
 
Example 14
Source File: HostAddresses.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
public HostAddresses(PrincipalName serverPrincipal)
    throws UnknownHostException, KrbException {

    String[] components = serverPrincipal.getNameStrings();

    if (serverPrincipal.getNameType() != PrincipalName.KRB_NT_SRV_HST ||
        components.length < 2)
        throw new KrbException(Krb5.KRB_ERR_GENERIC, "Bad name");

    String host = components[1];
    InetAddress addr[] = InetAddress.getAllByName(host);
    HostAddress hAddrs[] = new HostAddress[addr.length];

    for (int i = 0; i < addr.length; i++) {
        hAddrs[i] = new HostAddress(addr[i]);
    }

    addresses = hAddrs;
}
 
Example 15
Source File: KerberosPrincipal.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Reads this object from a stream (i.e., deserializes it)
 */
private void readObject(ObjectInputStream ois)
        throws IOException, ClassNotFoundException {
    byte[] asn1EncPrincipal = (byte [])ois.readObject();
    byte[] encRealm = (byte [])ois.readObject();
    try {
       Realm realmObject = new Realm(new DerValue(encRealm));
       PrincipalName krb5Principal = new PrincipalName(
               new DerValue(asn1EncPrincipal), realmObject);
       realm = realmObject.toString();
       fullName = krb5Principal.toString();
       nameType = krb5Principal.getNameType();
    } catch (Exception e) {
        throw new IOException(e);
    }
}
 
Example 16
Source File: HostAddresses.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public HostAddresses(PrincipalName serverPrincipal)
    throws UnknownHostException, KrbException {

    String[] components = serverPrincipal.getNameStrings();

    if (serverPrincipal.getNameType() != PrincipalName.KRB_NT_SRV_HST ||
        components.length < 2)
        throw new KrbException(Krb5.KRB_ERR_GENERIC, "Bad name");

    String host = components[1];
    InetAddress addr[] = InetAddress.getAllByName(host);
    HostAddress hAddrs[] = new HostAddress[addr.length];

    for (int i = 0; i < addr.length; i++) {
        hAddrs[i] = new HostAddress(addr[i]);
    }

    addresses = hAddrs;
}
 
Example 17
Source File: KerberosPrincipal.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Reads this object from a stream (i.e., deserializes it)
 */
private void readObject(ObjectInputStream ois)
        throws IOException, ClassNotFoundException {
    byte[] asn1EncPrincipal = (byte [])ois.readObject();
    byte[] encRealm = (byte [])ois.readObject();
    try {
       Realm realmObject = new Realm(new DerValue(encRealm));
       PrincipalName krb5Principal = new PrincipalName(
               new DerValue(asn1EncPrincipal), realmObject);
       realm = realmObject.toString();
       fullName = krb5Principal.toString();
       nameType = krb5Principal.getNameType();
    } catch (Exception e) {
        throw new IOException(e);
    }
}
 
Example 18
Source File: KerberosPrincipal.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Reads this object from a stream (i.e., deserializes it)
 */
private void readObject(ObjectInputStream ois)
        throws IOException, ClassNotFoundException {
    byte[] asn1EncPrincipal = (byte [])ois.readObject();
    byte[] encRealm = (byte [])ois.readObject();
    try {
       Realm realmObject = new Realm(new DerValue(encRealm));
       PrincipalName krb5Principal = new PrincipalName(
               new DerValue(asn1EncPrincipal), realmObject);
       realm = realmObject.toString();
       fullName = krb5Principal.toString();
       nameType = krb5Principal.getNameType();
    } catch (Exception e) {
        throw new IOException(e);
    }
}
 
Example 19
Source File: KerberosPrincipal.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Reads this object from a stream (i.e., deserializes it)
 */
private void readObject(ObjectInputStream ois)
        throws IOException, ClassNotFoundException {
    byte[] asn1EncPrincipal = (byte [])ois.readObject();
    byte[] encRealm = (byte [])ois.readObject();
    try {
       Realm realmObject = new Realm(new DerValue(encRealm));
       PrincipalName krb5Principal = new PrincipalName(
               new DerValue(asn1EncPrincipal), realmObject);
       realm = realmObject.toString();
       fullName = krb5Principal.toString();
       nameType = krb5Principal.getNameType();
    } catch (Exception e) {
        throw new IOException(e);
    }
}
 
Example 20
Source File: HostAddresses.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public HostAddresses(PrincipalName serverPrincipal)
    throws UnknownHostException, KrbException {

    String[] components = serverPrincipal.getNameStrings();

    if (serverPrincipal.getNameType() != PrincipalName.KRB_NT_SRV_HST ||
        components.length < 2)
        throw new KrbException(Krb5.KRB_ERR_GENERIC, "Bad name");

    String host = components[1];
    InetAddress addr[] = InetAddress.getAllByName(host);
    HostAddress hAddrs[] = new HostAddress[addr.length];

    for (int i = 0; i < addr.length; i++) {
        hAddrs[i] = new HostAddress(addr[i]);
    }

    addresses = hAddrs;
}