Java Code Examples for sun.security.krb5.EncryptionKey#findKey()
The following examples show how to use
sun.security.krb5.EncryptionKey#findKey() .
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: EType.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
/** * Retrieve the default etypes from the configuration file for * those etypes for which there are corresponding keys. * Used in scenario we have some keys from a keytab with etypes * different from those named in configName. Then, in order * to decrypt an AS-REP, we should only ask for etypes for which * we have keys. */ public static int[] getDefaults(String configName, EncryptionKey[] keys) throws KrbException { int[] answer = getDefaults(configName); List<Integer> list = new ArrayList<>(answer.length); for (int i = 0; i < answer.length; i++) { if (EncryptionKey.findKey(answer[i], keys) != null) { list.add(answer[i]); } } int len = list.size(); if (len <= 0) { StringBuffer keystr = new StringBuffer(); for (int i = 0; i < keys.length; i++) { keystr.append(toString(keys[i].getEType())); keystr.append(" "); } throw new KrbException( "Do not have keys of types listed in " + configName + " available; only have keys of following type: " + keystr.toString()); } else { answer = new int[len]; for (int i = 0; i < len; i++) { answer[i] = list.get(i); } return answer; } }
Example 2
Source File: EType.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Retrieve the default etypes from the configuration file for * those etypes for which there are corresponding keys. * Used in scenario we have some keys from a keytab with etypes * different from those named in configName. Then, in order * to decrypt an AS-REP, we should only ask for etypes for which * we have keys. */ public static int[] getDefaults(String configName, EncryptionKey[] keys) throws KrbException { int[] answer = getDefaults(configName); List<Integer> list = new ArrayList<>(answer.length); for (int i = 0; i < answer.length; i++) { if (EncryptionKey.findKey(answer[i], keys) != null) { list.add(answer[i]); } } int len = list.size(); if (len <= 0) { StringBuffer keystr = new StringBuffer(); for (int i = 0; i < keys.length; i++) { keystr.append(toString(keys[i].getEType())); keystr.append(" "); } throw new KrbException( "Do not have keys of types listed in " + configName + " available; only have keys of following type: " + keystr.toString()); } else { answer = new int[len]; for (int i = 0; i < len; i++) { answer[i] = list.get(i); } return answer; } }
Example 3
Source File: EType.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Retrieve the default etypes from the configuration file for * those etypes for which there are corresponding keys. * Used in scenario we have some keys from a keytab with etypes * different from those named in configName. Then, in order * to decrypt an AS-REP, we should only ask for etypes for which * we have keys. */ public static int[] getDefaults(String configName, EncryptionKey[] keys) throws KrbException { int[] answer = getDefaults(configName); List<Integer> list = new ArrayList<>(answer.length); for (int i = 0; i < answer.length; i++) { if (EncryptionKey.findKey(answer[i], keys) != null) { list.add(answer[i]); } } int len = list.size(); if (len <= 0) { StringBuffer keystr = new StringBuffer(); for (int i = 0; i < keys.length; i++) { keystr.append(toString(keys[i].getEType())); keystr.append(" "); } throw new KrbException( "Do not have keys of types listed in " + configName + " available; only have keys of following type: " + keystr.toString()); } else { answer = new int[len]; for (int i = 0; i < len; i++) { answer[i] = list.get(i); } return answer; } }
Example 4
Source File: EType.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Retrieve the default etypes from the configuration file for * those etypes for which there are corresponding keys. * Used in scenario we have some keys from a keytab with etypes * different from those named in configName. Then, in order * to decrypt an AS-REP, we should only ask for etypes for which * we have keys. */ public static int[] getDefaults(String configName, EncryptionKey[] keys) throws KrbException { int[] answer = getDefaults(configName); List<Integer> list = new ArrayList<>(answer.length); for (int i = 0; i < answer.length; i++) { if (EncryptionKey.findKey(answer[i], keys) != null) { list.add(answer[i]); } } int len = list.size(); if (len <= 0) { StringBuffer keystr = new StringBuffer(); for (int i = 0; i < keys.length; i++) { keystr.append(toString(keys[i].getEType())); keystr.append(" "); } throw new KrbException( "Do not have keys of types listed in " + configName + " available; only have keys of following type: " + keystr.toString()); } else { answer = new int[len]; for (int i = 0; i < len; i++) { answer[i] = list.get(i); } return answer; } }
Example 5
Source File: EType.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Retrieve the default etypes from the configuration file for * those etypes for which there are corresponding keys. * Used in scenario we have some keys from a keytab with etypes * different from those named in configName. Then, in order * to decrypt an AS-REP, we should only ask for etypes for which * we have keys. */ public static int[] getDefaults(String configName, EncryptionKey[] keys) throws KrbException { int[] answer = getDefaults(configName); List<Integer> list = new ArrayList<>(answer.length); for (int i = 0; i < answer.length; i++) { if (EncryptionKey.findKey(answer[i], keys) != null) { list.add(answer[i]); } } int len = list.size(); if (len <= 0) { StringBuffer keystr = new StringBuffer(); for (int i = 0; i < keys.length; i++) { keystr.append(toString(keys[i].getEType())); keystr.append(" "); } throw new KrbException( "Do not have keys of types listed in " + configName + " available; only have keys of following type: " + keystr.toString()); } else { answer = new int[len]; for (int i = 0; i < len; i++) { answer[i] = list.get(i); } return answer; } }
Example 6
Source File: EType.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Retrieve the default etypes from the configuration file for * those etypes for which there are corresponding keys. * Used in scenario we have some keys from a keytab with etypes * different from those named in configName. Then, in order * to decrypt an AS-REP, we should only ask for etypes for which * we have keys. */ public static int[] getDefaults(String configName, EncryptionKey[] keys) throws KrbException { int[] answer = getDefaults(configName); List<Integer> list = new ArrayList<>(answer.length); for (int i = 0; i < answer.length; i++) { if (EncryptionKey.findKey(answer[i], keys) != null) { list.add(answer[i]); } } int len = list.size(); if (len <= 0) { StringBuilder keystr = new StringBuilder(); for (int i = 0; i < keys.length; i++) { keystr.append(toString(keys[i].getEType())); keystr.append(" "); } throw new KrbException( "Do not have keys of types listed in " + configName + " available; only have keys of following type: " + keystr.toString()); } else { answer = new int[len]; for (int i = 0; i < len; i++) { answer[i] = list.get(i); } return answer; } }
Example 7
Source File: EType.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Retrieve the default etypes from the configuration file for * those etypes for which there are corresponding keys. * Used in scenario we have some keys from a keytab with etypes * different from those named in configName. Then, in order * to decrypt an AS-REP, we should only ask for etypes for which * we have keys. */ public static int[] getDefaults(String configName, EncryptionKey[] keys) throws KrbException { int[] answer = getDefaults(configName); List<Integer> list = new ArrayList<>(answer.length); for (int i = 0; i < answer.length; i++) { if (EncryptionKey.findKey(answer[i], keys) != null) { list.add(answer[i]); } } int len = list.size(); if (len <= 0) { StringBuffer keystr = new StringBuffer(); for (int i = 0; i < keys.length; i++) { keystr.append(toString(keys[i].getEType())); keystr.append(" "); } throw new KrbException( "Do not have keys of types listed in " + configName + " available; only have keys of following type: " + keystr.toString()); } else { answer = new int[len]; for (int i = 0; i < len; i++) { answer[i] = list.get(i); } return answer; } }
Example 8
Source File: EType.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Retrieve the default etypes from the configuration file for * those etypes for which there are corresponding keys. * Used in scenario we have some keys from a keytab with etypes * different from those named in configName. Then, in order * to decrypt an AS-REP, we should only ask for etypes for which * we have keys. */ public static int[] getDefaults(String configName, EncryptionKey[] keys) throws KrbException { int[] answer = getDefaults(configName); List<Integer> list = new ArrayList<>(answer.length); for (int i = 0; i < answer.length; i++) { if (EncryptionKey.findKey(answer[i], keys) != null) { list.add(answer[i]); } } int len = list.size(); if (len <= 0) { StringBuffer keystr = new StringBuffer(); for (int i = 0; i < keys.length; i++) { keystr.append(toString(keys[i].getEType())); keystr.append(" "); } throw new KrbException( "Do not have keys of types listed in " + configName + " available; only have keys of following type: " + keystr.toString()); } else { answer = new int[len]; for (int i = 0; i < len; i++) { answer[i] = list.get(i); } return answer; } }
Example 9
Source File: EType.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Retrieve the default etypes from the configuration file for * those etypes for which there are corresponding keys. * Used in scenario we have some keys from a keytab with etypes * different from those named in configName. Then, in order * to decrypt an AS-REP, we should only ask for etypes for which * we have keys. */ public static int[] getDefaults(String configName, EncryptionKey[] keys) throws KrbException { int[] answer = getDefaults(configName); List<Integer> list = new ArrayList<>(answer.length); for (int i = 0; i < answer.length; i++) { if (EncryptionKey.findKey(answer[i], keys) != null) { list.add(answer[i]); } } int len = list.size(); if (len <= 0) { StringBuffer keystr = new StringBuffer(); for (int i = 0; i < keys.length; i++) { keystr.append(toString(keys[i].getEType())); keystr.append(" "); } throw new KrbException( "Do not have keys of types listed in " + configName + " available; only have keys of following type: " + keystr.toString()); } else { answer = new int[len]; for (int i = 0; i < len; i++) { answer[i] = list.get(i); } return answer; } }
Example 10
Source File: EType.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Retrieve the default etypes from the configuration file for * those etypes for which there are corresponding keys. * Used in scenario we have some keys from a keytab with etypes * different from those named in configName. Then, in order * to decrypt an AS-REP, we should only ask for etypes for which * we have keys. */ public static int[] getDefaults(String configName, EncryptionKey[] keys) throws KrbException { int[] answer = getDefaults(configName); List<Integer> list = new ArrayList<>(answer.length); for (int i = 0; i < answer.length; i++) { if (EncryptionKey.findKey(answer[i], keys) != null) { list.add(answer[i]); } } int len = list.size(); if (len <= 0) { StringBuffer keystr = new StringBuffer(); for (int i = 0; i < keys.length; i++) { keystr.append(toString(keys[i].getEType())); keystr.append(" "); } throw new KrbException( "Do not have keys of types listed in " + configName + " available; only have keys of following type: " + keystr.toString()); } else { answer = new int[len]; for (int i = 0; i < len; i++) { answer[i] = list.get(i); } return answer; } }
Example 11
Source File: EType.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
/** * Retrieve the default etypes from the configuration file for * those etypes for which there are corresponding keys. * Used in scenario we have some keys from a keytab with etypes * different from those named in configName. Then, in order * to decrypt an AS-REP, we should only ask for etypes for which * we have keys. */ public static int[] getDefaults(String configName, EncryptionKey[] keys) throws KrbException { int[] answer = getDefaults(configName); List<Integer> list = new ArrayList<>(answer.length); for (int i = 0; i < answer.length; i++) { if (EncryptionKey.findKey(answer[i], keys) != null) { list.add(answer[i]); } } int len = list.size(); if (len <= 0) { StringBuffer keystr = new StringBuffer(); for (int i = 0; i < keys.length; i++) { keystr.append(toString(keys[i].getEType())); keystr.append(" "); } throw new KrbException( "Do not have keys of types listed in " + configName + " available; only have keys of following type: " + keystr.toString()); } else { answer = new int[len]; for (int i = 0; i < len; i++) { answer[i] = list.get(i); } return answer; } }
Example 12
Source File: EType.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Retrieve the default etypes from the configuration file for * those etypes for which there are corresponding keys. * Used in scenario we have some keys from a keytab with etypes * different from those named in configName. Then, in order * to decrypt an AS-REP, we should only ask for etypes for which * we have keys. */ public static int[] getDefaults(String configName, EncryptionKey[] keys) throws KrbException { int[] answer = getDefaults(configName); List<Integer> list = new ArrayList<>(answer.length); for (int i = 0; i < answer.length; i++) { if (EncryptionKey.findKey(answer[i], keys) != null) { list.add(answer[i]); } } int len = list.size(); if (len <= 0) { StringBuffer keystr = new StringBuffer(); for (int i = 0; i < keys.length; i++) { keystr.append(toString(keys[i].getEType())); keystr.append(" "); } throw new KrbException( "Do not have keys of types listed in " + configName + " available; only have keys of following type: " + keystr.toString()); } else { answer = new int[len]; for (int i = 0; i < len; i++) { answer[i] = list.get(i); } return answer; } }
Example 13
Source File: EType.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
/** * Retrieve the default etypes from the configuration file for * those etypes for which there are corresponding keys. * Used in scenario we have some keys from a keytab with etypes * different from those named in configName. Then, in order * to decrypt an AS-REP, we should only ask for etypes for which * we have keys. */ public static int[] getDefaults(String configName, EncryptionKey[] keys) throws KrbException { int[] answer = getDefaults(configName); List<Integer> list = new ArrayList<>(answer.length); for (int i = 0; i < answer.length; i++) { if (EncryptionKey.findKey(answer[i], keys) != null) { list.add(answer[i]); } } int len = list.size(); if (len <= 0) { StringBuffer keystr = new StringBuffer(); for (int i = 0; i < keys.length; i++) { keystr.append(toString(keys[i].getEType())); keystr.append(" "); } throw new KrbException( "Do not have keys of types listed in " + configName + " available; only have keys of following type: " + keystr.toString()); } else { answer = new int[len]; for (int i = 0; i < len; i++) { answer[i] = list.get(i); } return answer; } }