Java Code Examples for sun.security.krb5.internal.ktab.KeyTab#readServiceKeys()

The following examples show how to use sun.security.krb5.internal.ktab.KeyTab#readServiceKeys() . 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: EncryptionKey.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains all versions of the secret key of the principal from a
 * keytab.
 *
 * @Param princ the principal whose secret key is desired
 * @param keytab the path to the keytab file. A value of null
 * will be accepted to indicate that the default path should be
 * searched.
 * @returns an array of secret keys or null if none were found.
 */
public static EncryptionKey[] acquireSecretKeys(PrincipalName princ,
                                                String keytab) {

    if (princ == null)
        throw new IllegalArgumentException(
            "Cannot have null pricipal name to look in keytab.");

    // KeyTab getInstance(keytab) will call KeyTab.getInstance()
    // if keytab is null
    KeyTab ktab = KeyTab.getInstance(keytab);
    return ktab.readServiceKeys(princ);
}
 
Example 2
Source File: EncryptionKey.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains all versions of the secret key of the principal from a
 * keytab.
 *
 * @Param princ the principal whose secret key is desired
 * @param keytab the path to the keytab file. A value of null
 * will be accepted to indicate that the default path should be
 * searched.
 * @returns an array of secret keys or null if none were found.
 */
public static EncryptionKey[] acquireSecretKeys(PrincipalName princ,
                                                String keytab) {

    if (princ == null)
        throw new IllegalArgumentException(
            "Cannot have null pricipal name to look in keytab.");

    // KeyTab getInstance(keytab) will call KeyTab.getInstance()
    // if keytab is null
    KeyTab ktab = KeyTab.getInstance(keytab);
    return ktab.readServiceKeys(princ);
}
 
Example 3
Source File: EncryptionKey.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains all versions of the secret key of the principal from a
 * keytab.
 *
 * @Param princ the principal whose secret key is desired
 * @param keytab the path to the keytab file. A value of null
 * will be accepted to indicate that the default path should be
 * searched.
 * @returns an array of secret keys or null if none were found.
 */
public static EncryptionKey[] acquireSecretKeys(PrincipalName princ,
                                                String keytab) {

    if (princ == null)
        throw new IllegalArgumentException(
            "Cannot have null pricipal name to look in keytab.");

    // KeyTab getInstance(keytab) will call KeyTab.getInstance()
    // if keytab is null
    KeyTab ktab = KeyTab.getInstance(keytab);
    return ktab.readServiceKeys(princ);
}
 
Example 4
Source File: EncryptionKey.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains all versions of the secret key of the principal from a
 * keytab.
 *
 * @param princ the principal whose secret key is desired
 * @param keytab the path to the keytab file. A value of null
 * will be accepted to indicate that the default path should be
 * searched.
 * @return an array of secret keys or null if none were found.
 */
public static EncryptionKey[] acquireSecretKeys(PrincipalName princ,
                                                String keytab) {

    if (princ == null)
        throw new IllegalArgumentException(
            "Cannot have null pricipal name to look in keytab.");

    // KeyTab getInstance(keytab) will call KeyTab.getInstance()
    // if keytab is null
    KeyTab ktab = KeyTab.getInstance(keytab);
    return ktab.readServiceKeys(princ);
}
 
Example 5
Source File: EncryptionKey.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains all versions of the secret key of the principal from a
 * keytab.
 *
 * @Param princ the principal whose secret key is desired
 * @param keytab the path to the keytab file. A value of null
 * will be accepted to indicate that the default path should be
 * searched.
 * @returns an array of secret keys or null if none were found.
 */
public static EncryptionKey[] acquireSecretKeys(PrincipalName princ,
                                                String keytab) {

    if (princ == null)
        throw new IllegalArgumentException(
            "Cannot have null pricipal name to look in keytab.");

    // KeyTab getInstance(keytab) will call KeyTab.getInstance()
    // if keytab is null
    KeyTab ktab = KeyTab.getInstance(keytab);
    return ktab.readServiceKeys(princ);
}
 
Example 6
Source File: EncryptionKey.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains all versions of the secret key of the principal from a
 * keytab.
 *
 * @param princ the principal whose secret key is desired
 * @param keytab the path to the keytab file. A value of null
 * will be accepted to indicate that the default path should be
 * searched.
 * @return an array of secret keys or null if none were found.
 */
public static EncryptionKey[] acquireSecretKeys(PrincipalName princ,
                                                String keytab) {

    if (princ == null)
        throw new IllegalArgumentException(
            "Cannot have null pricipal name to look in keytab.");

    // KeyTab getInstance(keytab) will call KeyTab.getInstance()
    // if keytab is null
    KeyTab ktab = KeyTab.getInstance(keytab);
    return ktab.readServiceKeys(princ);
}
 
Example 7
Source File: EncryptionKey.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains all versions of the secret key of the principal from a
 * keytab.
 *
 * @Param princ the principal whose secret key is desired
 * @param keytab the path to the keytab file. A value of null
 * will be accepted to indicate that the default path should be
 * searched.
 * @returns an array of secret keys or null if none were found.
 */
public static EncryptionKey[] acquireSecretKeys(PrincipalName princ,
                                                String keytab) {

    if (princ == null)
        throw new IllegalArgumentException(
            "Cannot have null pricipal name to look in keytab.");

    // KeyTab getInstance(keytab) will call KeyTab.getInstance()
    // if keytab is null
    KeyTab ktab = KeyTab.getInstance(keytab);
    return ktab.readServiceKeys(princ);
}
 
Example 8
Source File: EncryptionKey.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains all versions of the secret key of the principal from a
 * keytab.
 *
 * @Param princ the principal whose secret key is desired
 * @param keytab the path to the keytab file. A value of null
 * will be accepted to indicate that the default path should be
 * searched.
 * @returns an array of secret keys or null if none were found.
 */
public static EncryptionKey[] acquireSecretKeys(PrincipalName princ,
                                                String keytab) {

    if (princ == null)
        throw new IllegalArgumentException(
            "Cannot have null pricipal name to look in keytab.");

    // KeyTab getInstance(keytab) will call KeyTab.getInstance()
    // if keytab is null
    KeyTab ktab = KeyTab.getInstance(keytab);
    return ktab.readServiceKeys(princ);
}
 
Example 9
Source File: EncryptionKey.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains all versions of the secret key of the principal from a
 * keytab.
 *
 * @Param princ the principal whose secret key is desired
 * @param keytab the path to the keytab file. A value of null
 * will be accepted to indicate that the default path should be
 * searched.
 * @returns an array of secret keys or null if none were found.
 */
public static EncryptionKey[] acquireSecretKeys(PrincipalName princ,
                                                String keytab) {

    if (princ == null)
        throw new IllegalArgumentException(
            "Cannot have null pricipal name to look in keytab.");

    // KeyTab getInstance(keytab) will call KeyTab.getInstance()
    // if keytab is null
    KeyTab ktab = KeyTab.getInstance(keytab);
    return ktab.readServiceKeys(princ);
}
 
Example 10
Source File: EncryptionKey.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains all versions of the secret key of the principal from a
 * keytab.
 *
 * @Param princ the principal whose secret key is desired
 * @param keytab the path to the keytab file. A value of null
 * will be accepted to indicate that the default path should be
 * searched.
 * @returns an array of secret keys or null if none were found.
 */
public static EncryptionKey[] acquireSecretKeys(PrincipalName princ,
                                                String keytab) {

    if (princ == null)
        throw new IllegalArgumentException(
            "Cannot have null pricipal name to look in keytab.");

    // KeyTab getInstance(keytab) will call KeyTab.getInstance()
    // if keytab is null
    KeyTab ktab = KeyTab.getInstance(keytab);
    return ktab.readServiceKeys(princ);
}
 
Example 11
Source File: EncryptionKey.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains all versions of the secret key of the principal from a
 * keytab.
 *
 * @param princ the principal whose secret key is desired
 * @param keytab the path to the keytab file. A value of null
 * will be accepted to indicate that the default path should be
 * searched.
 * @return an array of secret keys or null if none were found.
 */
public static EncryptionKey[] acquireSecretKeys(PrincipalName princ,
                                                String keytab) {

    if (princ == null)
        throw new IllegalArgumentException(
            "Cannot have null pricipal name to look in keytab.");

    // KeyTab getInstance(keytab) will call KeyTab.getInstance()
    // if keytab is null
    KeyTab ktab = KeyTab.getInstance(keytab);
    return ktab.readServiceKeys(princ);
}
 
Example 12
Source File: EncryptionKey.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains all versions of the secret key of the principal from a
 * keytab.
 *
 * @Param princ the principal whose secret key is desired
 * @param keytab the path to the keytab file. A value of null
 * will be accepted to indicate that the default path should be
 * searched.
 * @returns an array of secret keys or null if none were found.
 */
public static EncryptionKey[] acquireSecretKeys(PrincipalName princ,
                                                String keytab) {

    if (princ == null)
        throw new IllegalArgumentException(
            "Cannot have null pricipal name to look in keytab.");

    // KeyTab getInstance(keytab) will call KeyTab.getInstance()
    // if keytab is null
    KeyTab ktab = KeyTab.getInstance(keytab);
    return ktab.readServiceKeys(princ);
}
 
Example 13
Source File: EncryptionKey.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains all versions of the secret key of the principal from a
 * keytab.
 *
 * @Param princ the principal whose secret key is desired
 * @param keytab the path to the keytab file. A value of null
 * will be accepted to indicate that the default path should be
 * searched.
 * @returns an array of secret keys or null if none were found.
 */
public static EncryptionKey[] acquireSecretKeys(PrincipalName princ,
                                                String keytab) {

    if (princ == null)
        throw new IllegalArgumentException(
            "Cannot have null pricipal name to look in keytab.");

    // KeyTab getInstance(keytab) will call KeyTab.getInstance()
    // if keytab is null
    KeyTab ktab = KeyTab.getInstance(keytab);
    return ktab.readServiceKeys(princ);
}