Index: modules/crypto/src/main/java/org/apache/harmony/crypto/utils/AlgNameMapper.java =================================================================== --- modules/crypto/src/main/java/org/apache/harmony/crypto/utils/AlgNameMapper.java (revision 412109) +++ modules/crypto/src/main/java/org/apache/harmony/crypto/utils/AlgNameMapper.java (working copy) @@ -28,6 +28,8 @@ import java.util.Map; import java.util.Set; +import org.apache.harmony.security.asn1.ObjectIdentifier; + /** * Provides Algorithm Name to OID * and OID to Algorithm Name mappings. @@ -70,6 +72,7 @@ private static final String[] serviceName = { "Cipher", "AlgorithmParameters", + "Signature" }; // These mappings CAN NOT be overridden @@ -194,7 +197,7 @@ algAliasesMap.put(algUC, alg); } // Do not allow known standard names as alias - } else if (!algAliasesMap.containsValue(alias)) { + } else if (!algAliasesMap.containsKey(alias.toUpperCase())) { algAliasesMap.put(alias.toUpperCase(), alg); } } @@ -209,7 +212,16 @@ * @return 'true' if parameter represents OID */ public static boolean isOID(String alias) { - return alias.indexOf('.') != -1; + try { + // The method makes all needed checks in it. + // If alias is not an OID, exception is thrown. + ObjectIdentifier.toIntArray(normalize(alias)); + + // will not come here if exception is thrown + return true; + } catch (IllegalArgumentException e) { + return false; + } } /**