Java Code Examples for sun.security.krb5.internal.Krb5#REALM_NULL

The following examples show how to use sun.security.krb5.internal.Krb5#REALM_NULL . 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: Realm.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static String parseRealmAtSeparator(String name)
    throws RealmException {
    if (name == null) {
        throw new IllegalArgumentException
            ("null input name is not allowed");
    }
    String temp = new String(name);
    String result = null;
    int i = 0;
    while (i < temp.length()) {
        if (temp.charAt(i) == PrincipalName.NAME_REALM_SEPARATOR) {
            if (i == 0 || temp.charAt(i - 1) != '\\') {
                if (i + 1 < temp.length()) {
                    result = temp.substring(i + 1, temp.length());
                } else {
                    throw new IllegalArgumentException
                            ("empty realm part not allowed");
                }
                break;
            }
        }
        i++;
    }
    if (result != null) {
        if (result.length() == 0)
            throw new RealmException(Krb5.REALM_NULL);
        if (!isValidRealmString(result))
            throw new RealmException(Krb5.REALM_ILLCHAR);
    }
    return result;
}
 
Example 2
Source File: Realm.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructs a Realm object.
 * @param encoding a Der-encoded data.
 * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data.
 * @exception IOException if an I/O error occurs while reading encoded data.
 * @exception RealmException if an error occurs while parsing a Realm object.
 */
public Realm(DerValue encoding)
    throws Asn1Exception, RealmException, IOException {
    if (encoding == null) {
        throw new IllegalArgumentException("encoding can not be null");
    }
    realm = new KerberosString(encoding).toString();
    if (realm == null || realm.length() == 0)
        throw new RealmException(Krb5.REALM_NULL);
    if (!isValidRealmString(realm))
        throw new RealmException(Krb5.REALM_ILLCHAR);
}
 
Example 3
Source File: Realm.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected static String parseRealm(String name) throws RealmException {
    String result = parseRealmAtSeparator(name);
    if (result == null)
        result = name;
    if (result == null || result.length() == 0)
        throw new RealmException(Krb5.REALM_NULL);
    if (!isValidRealmString(result))
        throw new RealmException(Krb5.REALM_ILLCHAR);
    return result;
}
 
Example 4
Source File: Realm.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static String parseRealmAtSeparator(String name)
    throws RealmException {
    if (name == null) {
        throw new IllegalArgumentException
            ("null input name is not allowed");
    }
    String temp = new String(name);
    String result = null;
    int i = 0;
    while (i < temp.length()) {
        if (temp.charAt(i) == PrincipalName.NAME_REALM_SEPARATOR) {
            if (i == 0 || temp.charAt(i - 1) != '\\') {
                if (i + 1 < temp.length()) {
                    result = temp.substring(i + 1, temp.length());
                } else {
                    throw new IllegalArgumentException
                            ("empty realm part not allowed");
                }
                break;
            }
        }
        i++;
    }
    if (result != null) {
        if (result.length() == 0)
            throw new RealmException(Krb5.REALM_NULL);
        if (!isValidRealmString(result))
            throw new RealmException(Krb5.REALM_ILLCHAR);
    }
    return result;
}
 
Example 5
Source File: Realm.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static String parseRealmAtSeparator(String name)
    throws RealmException {
    if (name == null) {
        throw new IllegalArgumentException
            ("null input name is not allowed");
    }
    String temp = new String(name);
    String result = null;
    int i = 0;
    while (i < temp.length()) {
        if (temp.charAt(i) == PrincipalName.NAME_REALM_SEPARATOR) {
            if (i == 0 || temp.charAt(i - 1) != '\\') {
                if (i + 1 < temp.length()) {
                    result = temp.substring(i + 1, temp.length());
                } else {
                    throw new IllegalArgumentException
                            ("empty realm part not allowed");
                }
                break;
            }
        }
        i++;
    }
    if (result != null) {
        if (result.length() == 0)
            throw new RealmException(Krb5.REALM_NULL);
        if (!isValidRealmString(result))
            throw new RealmException(Krb5.REALM_ILLCHAR);
    }
    return result;
}
 
Example 6
Source File: Realm.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructs a Realm object.
 * @param encoding a Der-encoded data.
 * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data.
 * @exception IOException if an I/O error occurs while reading encoded data.
 * @exception RealmException if an error occurs while parsing a Realm object.
 */
public Realm(DerValue encoding)
    throws Asn1Exception, RealmException, IOException {
    if (encoding == null) {
        throw new IllegalArgumentException("encoding can not be null");
    }
    realm = new KerberosString(encoding).toString();
    if (realm == null || realm.length() == 0)
        throw new RealmException(Krb5.REALM_NULL);
    if (!isValidRealmString(realm))
        throw new RealmException(Krb5.REALM_ILLCHAR);
}
 
Example 7
Source File: Realm.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected static String parseRealm(String name) throws RealmException {
    String result = parseRealmAtSeparator(name);
    if (result == null)
        result = name;
    if (result == null || result.length() == 0)
        throw new RealmException(Krb5.REALM_NULL);
    if (!isValidRealmString(result))
        throw new RealmException(Krb5.REALM_ILLCHAR);
    return result;
}
 
Example 8
Source File: Realm.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static String parseRealmAtSeparator(String name)
    throws RealmException {
    if (name == null) {
        throw new IllegalArgumentException
            ("null input name is not allowed");
    }
    String temp = new String(name);
    String result = null;
    int i = 0;
    while (i < temp.length()) {
        if (temp.charAt(i) == PrincipalName.NAME_REALM_SEPARATOR) {
            if (i == 0 || temp.charAt(i - 1) != '\\') {
                if (i + 1 < temp.length()) {
                    result = temp.substring(i + 1, temp.length());
                } else {
                    throw new IllegalArgumentException
                            ("empty realm part not allowed");
                }
                break;
            }
        }
        i++;
    }
    if (result != null) {
        if (result.length() == 0)
            throw new RealmException(Krb5.REALM_NULL);
        if (!isValidRealmString(result))
            throw new RealmException(Krb5.REALM_ILLCHAR);
    }
    return result;
}
 
Example 9
Source File: Realm.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected static String parseRealm(String name) throws RealmException {
    String result = parseRealmAtSeparator(name);
    if (result == null)
        result = name;
    if (result == null || result.length() == 0)
        throw new RealmException(Krb5.REALM_NULL);
    if (!isValidRealmString(result))
        throw new RealmException(Krb5.REALM_ILLCHAR);
    return result;
}
 
Example 10
Source File: Realm.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected static String parseRealm(String name) throws RealmException {
    String result = parseRealmAtSeparator(name);
    if (result == null)
        result = name;
    if (result == null || result.length() == 0)
        throw new RealmException(Krb5.REALM_NULL);
    if (!isValidRealmString(result))
        throw new RealmException(Krb5.REALM_ILLCHAR);
    return result;
}
 
Example 11
Source File: Realm.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected static String parseRealm(String name) throws RealmException {
    String result = parseRealmAtSeparator(name);
    if (result == null)
        result = name;
    if (result == null || result.length() == 0)
        throw new RealmException(Krb5.REALM_NULL);
    if (!isValidRealmString(result))
        throw new RealmException(Krb5.REALM_ILLCHAR);
    return result;
}
 
Example 12
Source File: Realm.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructs a Realm object.
 * @param encoding a Der-encoded data.
 * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data.
 * @exception IOException if an I/O error occurs while reading encoded data.
 * @exception RealmException if an error occurs while parsing a Realm object.
 */
public Realm(DerValue encoding)
    throws Asn1Exception, RealmException, IOException {
    if (encoding == null) {
        throw new IllegalArgumentException("encoding can not be null");
    }
    realm = new KerberosString(encoding).toString();
    if (realm == null || realm.length() == 0)
        throw new RealmException(Krb5.REALM_NULL);
    if (!isValidRealmString(realm))
        throw new RealmException(Krb5.REALM_ILLCHAR);
}
 
Example 13
Source File: Realm.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected static String parseRealm(String name) throws RealmException {
    String result = parseRealmAtSeparator(name);
    if (result == null)
        result = name;
    if (result == null || result.length() == 0)
        throw new RealmException(Krb5.REALM_NULL);
    if (!isValidRealmString(result))
        throw new RealmException(Krb5.REALM_ILLCHAR);
    return result;
}
 
Example 14
Source File: Realm.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructs a Realm object.
 * @param encoding a Der-encoded data.
 * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data.
 * @exception IOException if an I/O error occurs while reading encoded data.
 * @exception RealmException if an error occurs while parsing a Realm object.
 */
public Realm(DerValue encoding)
    throws Asn1Exception, RealmException, IOException {
    if (encoding == null) {
        throw new IllegalArgumentException("encoding can not be null");
    }
    realm = new KerberosString(encoding).toString();
    if (realm == null || realm.length() == 0)
        throw new RealmException(Krb5.REALM_NULL);
    if (!isValidRealmString(realm))
        throw new RealmException(Krb5.REALM_ILLCHAR);
}
 
Example 15
Source File: Realm.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructs a Realm object.
 * @param encoding a Der-encoded data.
 * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data.
 * @exception IOException if an I/O error occurs while reading encoded data.
 * @exception RealmException if an error occurs while parsing a Realm object.
 */
public Realm(DerValue encoding)
    throws Asn1Exception, RealmException, IOException {
    if (encoding == null) {
        throw new IllegalArgumentException("encoding can not be null");
    }
    realm = new KerberosString(encoding).toString();
    if (realm == null || realm.length() == 0)
        throw new RealmException(Krb5.REALM_NULL);
    if (!isValidRealmString(realm))
        throw new RealmException(Krb5.REALM_ILLCHAR);
}
 
Example 16
Source File: Realm.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static String parseRealmAtSeparator(String name)
    throws RealmException {
    if (name == null) {
        throw new IllegalArgumentException
            ("null input name is not allowed");
    }
    String temp = new String(name);
    String result = null;
    int i = 0;
    while (i < temp.length()) {
        if (temp.charAt(i) == PrincipalName.NAME_REALM_SEPARATOR) {
            if (i == 0 || temp.charAt(i - 1) != '\\') {
                if (i + 1 < temp.length()) {
                    result = temp.substring(i + 1, temp.length());
                } else {
                    throw new IllegalArgumentException
                            ("empty realm part not allowed");
                }
                break;
            }
        }
        i++;
    }
    if (result != null) {
        if (result.length() == 0)
            throw new RealmException(Krb5.REALM_NULL);
        if (!isValidRealmString(result))
            throw new RealmException(Krb5.REALM_ILLCHAR);
    }
    return result;
}
 
Example 17
Source File: Realm.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static String parseRealmAtSeparator(String name)
    throws RealmException {
    if (name == null) {
        throw new IllegalArgumentException
            ("null input name is not allowed");
    }
    String temp = new String(name);
    String result = null;
    int i = 0;
    while (i < temp.length()) {
        if (temp.charAt(i) == PrincipalName.NAME_REALM_SEPARATOR) {
            if (i == 0 || temp.charAt(i - 1) != '\\') {
                if (i + 1 < temp.length()) {
                    result = temp.substring(i + 1, temp.length());
                } else {
                    throw new IllegalArgumentException
                            ("empty realm part not allowed");
                }
                break;
            }
        }
        i++;
    }
    if (result != null) {
        if (result.length() == 0)
            throw new RealmException(Krb5.REALM_NULL);
        if (!isValidRealmString(result))
            throw new RealmException(Krb5.REALM_ILLCHAR);
    }
    return result;
}
 
Example 18
Source File: Realm.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructs a Realm object.
 * @param encoding a Der-encoded data.
 * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data.
 * @exception IOException if an I/O error occurs while reading encoded data.
 * @exception RealmException if an error occurs while parsing a Realm object.
 */
public Realm(DerValue encoding)
    throws Asn1Exception, RealmException, IOException {
    if (encoding == null) {
        throw new IllegalArgumentException("encoding can not be null");
    }
    realm = new KerberosString(encoding).toString();
    if (realm == null || realm.length() == 0)
        throw new RealmException(Krb5.REALM_NULL);
    if (!isValidRealmString(realm))
        throw new RealmException(Krb5.REALM_ILLCHAR);
}
 
Example 19
Source File: Realm.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected static String parseRealm(String name) throws RealmException {
    String result = parseRealmAtSeparator(name);
    if (result == null)
        result = name;
    if (result == null || result.length() == 0)
        throw new RealmException(Krb5.REALM_NULL);
    if (!isValidRealmString(result))
        throw new RealmException(Krb5.REALM_ILLCHAR);
    return result;
}
 
Example 20
Source File: Realm.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static String parseRealmAtSeparator(String name)
    throws RealmException {
    if (name == null) {
        throw new IllegalArgumentException
            ("null input name is not allowed");
    }
    String temp = new String(name);
    String result = null;
    int i = 0;
    while (i < temp.length()) {
        if (temp.charAt(i) == PrincipalName.NAME_REALM_SEPARATOR) {
            if (i == 0 || temp.charAt(i - 1) != '\\') {
                if (i + 1 < temp.length()) {
                    result = temp.substring(i + 1, temp.length());
                } else {
                    throw new IllegalArgumentException
                            ("empty realm part not allowed");
                }
                break;
            }
        }
        i++;
    }
    if (result != null) {
        if (result.length() == 0)
            throw new RealmException(Krb5.REALM_NULL);
        if (!isValidRealmString(result))
            throw new RealmException(Krb5.REALM_ILLCHAR);
    }
    return result;
}