/** * Returns value for the specified algorithm with the specified name. * * @param algName * the name of the algorithm. * @param propName * the name of the property. * @return value of the property. * @deprecated Use {@link AlgorithmParameters} and {@link KeyFactory} instead. */ @Deprecated public static String getAlgorithmProperty(String algName, String propName) { if (algName == null || propName == null) { return null; } String prop = "Alg." + propName + "." + algName; Provider[] providers = getProviders(); for (Provider provider : providers) { for (Enumeration e = provider.propertyNames(); e.hasMoreElements(); ) { String propertyName = (String) e.nextElement(); if (propertyName.equalsIgnoreCase(prop)) { return provider.getProperty(propertyName); } } } return null; }
/** * Returns the property with the specified key in the provider properties. * The name is not case-sensitive. */ private String getPropertyIgnoreCase(String key) { String res = getProperty(key); if (res != null) { return res; } for (Enumeration<?> e = propertyNames(); e.hasMoreElements(); ) { String propertyName = (String) e.nextElement(); if (key.equalsIgnoreCase(propertyName)) { return getProperty(propertyName); } } return null; }
private String[] getServiceAlgorithms(String serviceType, Provider provider) { /* * Match provider property names that start "<service type>." and do not * contain a space. What follows the '.' is the algorithm name */ String match = serviceType + "."; ArrayList<String> algorithmList = new ArrayList<String>(); for (Enumeration<?> names = provider.propertyNames(); names.hasMoreElements();) { String key = (String) names.nextElement(); if (key.startsWith(match) && key.indexOf(' ') == -1) { String algorithm = key.substring(key.indexOf('.') + 1); algorithmList.add(algorithm); } } String[] algorithms = algorithmList.toArray(new String[algorithmList.size()]); Arrays.sort(algorithms); return algorithms; }
private String getAlgorithmClass(String algorithm, String serviceType, Provider provider) { /* * Looking for the property name that matches * "<service type>.<algorithm>". The value of the property is the class * name */ String match = serviceType + "." + algorithm; for (Enumeration<?> names = provider.propertyNames(); names.hasMoreElements();) { String key = (String) names.nextElement(); if (key.equals(match)) { return provider.getProperty(key); } } return null; }
private String[] getAlgorithmAttributes(String algorithm, String serviceType, Provider provider) { /* * Looking for property names matching "<service type>.<algorithm> ". * The attribute name if the text following the ' ' while the attribute * value is the value of the property. Return in alpha order by name. * Returned value is 'name=value' */ String matchAttr = serviceType + "." + algorithm + " "; TreeMap<String, String> attributeMap = new TreeMap<String, String>(); for (Enumeration<?> names = provider.propertyNames(); names.hasMoreElements();) { String key = (String) names.nextElement(); if (key.startsWith(matchAttr)) { String attrName = key.substring(key.indexOf(' ') + 1); String attributeDisplay = MessageFormat.format(res.getString("DProviderInfo.AttributeNode.text"), attrName, provider.getProperty(key)); attributeMap.put(attrName, attributeDisplay); } } ArrayList<String> attributes = new ArrayList<String>(); for (String key : attributeMap.keySet()) { attributes.add(attributeMap.get(key)); } return attributes.toArray(new String[attributes.size()]); }
private String[] getAlgorithmAliases(String algorithm, String serviceType, Provider provider) { /* * Looking to match property names with key "Alg.Alias.<service type>." * and value of algorithm. The alias is the text following the '.' in * the property name. Return in alpha order */ String matchAlias = "Alg.Alias." + serviceType + "."; ArrayList<String> aliasList = new ArrayList<String>(); for (Enumeration<?> names = provider.propertyNames(); names.hasMoreElements();) { String key = (String) names.nextElement(); if (provider.getProperty(key).equals(algorithm)) { if (key.startsWith(matchAlias)) { String alias = key.substring(matchAlias.length()); aliasList.add(alias); } } } String[] aliases = aliasList.toArray(new String[aliasList.size()]); Arrays.sort(aliases); return aliases; }
/** * Returns the property with the specified key in the provider properties. * The name is not case-sensitive. */ private String getPropertyIgnoreCase(String key) { String res = getProperty(key); if (res != null) { return res; } for (Enumeration<?> e = propertyNames(); e.hasMoreElements(); ) { String propertyName = (String) e.nextElement(); if (key.equalsIgnoreCase(propertyName)) { return getProperty(propertyName); } } return null; }
/** * Returns value for the specified algorithm with the specified name. * * @param algName * the name of the algorithm. * @param propName * the name of the property. * @return value of the property. * @deprecated Use {@link AlgorithmParameters} and {@link KeyFactory} instead. */ @Deprecated public static String getAlgorithmProperty(String algName, String propName) { if (algName == null || propName == null) { return null; } String prop = "Alg." + propName + "." + algName; Provider[] providers = getProviders(); for (Provider provider : providers) { for (Enumeration e = provider.propertyNames(); e.hasMoreElements(); ) { String propertyName = (String) e.nextElement(); if (propertyName.equalsIgnoreCase(prop)) { return provider.getProperty(propertyName); } } } return null; }
/** * Returns value for the specified algorithm with the specified name. * * @param algName * the name of the algorithm. * @param propName * the name of the property. * @return value of the property. * @deprecated Use {@link AlgorithmParameters} and {@link KeyFactory} instead. */ @Deprecated public static String getAlgorithmProperty(String algName, String propName) { if (algName == null || propName == null) { return null; } String prop = "Alg." + propName + "." + algName; Provider[] providers = getProviders(); for (Provider provider : providers) { for (Enumeration e = provider.propertyNames(); e.hasMoreElements(); ) { String propertyName = (String) e.nextElement(); if (propertyName.equalsIgnoreCase(prop)) { return provider.getProperty(propertyName); } } } return null; }
/** * Returns value for the specified algorithm with the specified name. * * @param algName * the name of the algorithm. * @param propName * the name of the property. * @return value of the property. * @deprecated Use {@link AlgorithmParameters} and {@link KeyFactory} instead. */ @Deprecated public static String getAlgorithmProperty(String algName, String propName) { if (algName == null || propName == null) { return null; } String prop = "Alg." + propName + "." + algName; Provider[] providers = getProviders(); for (Provider provider : providers) { for (Enumeration e = provider.propertyNames(); e.hasMoreElements(); ) { String propertyName = (String) e.nextElement(); if (propertyName.equalsIgnoreCase(prop)) { return provider.getProperty(propertyName); } } } return null; }
/** * Returns the property with the specified key in the provider properties. * The name is not case-sensitive. */ private String getPropertyIgnoreCase(String key) { String res = getProperty(key); if (res != null) { return res; } for (Enumeration<?> e = propertyNames(); e.hasMoreElements(); ) { String propertyName = (String) e.nextElement(); if (key.equalsIgnoreCase(propertyName)) { return getProperty(propertyName); } } return null; }
/** * Returns value for the specified algorithm with the specified name. * * @param algName * the name of the algorithm. * @param propName * the name of the property. * @return value of the property. * @deprecated Use {@link AlgorithmParameters} and {@link KeyFactory} instead. */ @Deprecated public static String getAlgorithmProperty(String algName, String propName) { if (algName == null || propName == null) { return null; } String prop = "Alg." + propName + "." + algName; Provider[] providers = getProviders(); for (Provider provider : providers) { for (Enumeration e = provider.propertyNames(); e.hasMoreElements(); ) { String propertyName = (String) e.nextElement(); if (propertyName.equalsIgnoreCase(prop)) { return provider.getProperty(propertyName); } } } return null; }
/** * Returns the property with the specified key in the provider properties. * The name is not case-sensitive. */ private String getPropertyIgnoreCase(String key) { String res = getProperty(key); if (res != null) { return res; } for (Enumeration<?> e = propertyNames(); e.hasMoreElements(); ) { String propertyName = (String) e.nextElement(); if (key.equalsIgnoreCase(propertyName)) { return getProperty(propertyName); } } return null; }
/** * Returns value for the specified algorithm with the specified name. * * @param algName * the name of the algorithm. * @param propName * the name of the property. * @return value of the property. * @deprecated Use {@link AlgorithmParameters} and {@link KeyFactory} instead. */ @Deprecated public static String getAlgorithmProperty(String algName, String propName) { if (algName == null || propName == null) { return null; } String prop = "Alg." + propName + "." + algName; Provider[] providers = getProviders(); for (Provider provider : providers) { for (Enumeration e = provider.propertyNames(); e.hasMoreElements(); ) { String propertyName = (String) e.nextElement(); if (propertyName.equalsIgnoreCase(prop)) { return provider.getProperty(propertyName); } } } return null; }
/** * Returns the property with the specified key in the provider properties. * The name is not case-sensitive. */ private String getPropertyIgnoreCase(String key) { String res = getProperty(key); if (res != null) { return res; } for (Enumeration<?> e = propertyNames(); e.hasMoreElements(); ) { String propertyName = (String) e.nextElement(); if (key.equalsIgnoreCase(propertyName)) { return getProperty(propertyName); } } return null; }
/** * Returns the property with the specified key in the provider properties. * The name is not case-sensitive. */ private String getPropertyIgnoreCase(String key) { String res = getProperty(key); if (res != null) { return res; } for (Enumeration<?> e = propertyNames(); e.hasMoreElements(); ) { String propertyName = (String) e.nextElement(); if (key.equalsIgnoreCase(propertyName)) { return getProperty(propertyName); } } return null; }
/** * Returns the property with the specified key in the provider properties. * The name is not case-sensitive. */ private String getPropertyIgnoreCase(String key) { String res = getProperty(key); if (res != null) { return res; } for (Enumeration<?> e = propertyNames(); e.hasMoreElements(); ) { String propertyName = (String) e.nextElement(); if (key.equalsIgnoreCase(propertyName)) { return getProperty(propertyName); } } return null; }
/** * Returns value for the specified algorithm with the specified name. * * @param algName * the name of the algorithm. * @param propName * the name of the property. * @return value of the property. * @deprecated Use {@link AlgorithmParameters} and {@link KeyFactory} instead. */ @Deprecated public static String getAlgorithmProperty(String algName, String propName) { if (algName == null || propName == null) { return null; } String prop = "Alg." + propName + "." + algName; Provider[] providers = getProviders(); for (Provider provider : providers) { for (Enumeration e = provider.propertyNames(); e.hasMoreElements(); ) { String propertyName = (String) e.nextElement(); if (propertyName.equalsIgnoreCase(prop)) { return provider.getProperty(propertyName); } } } return null; }