Class AlgNameMapper
- java.lang.Object
-
- org.apache.harmony.security.utils.AlgNameMapper
-
public class AlgNameMapper extends Object
Provides Algorithm Name to OID and OID to Algorithm Name mappings. Some known mappings are hardcoded. Tries to obtain additional mappings from installed providers during initialization.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddMapping(String oid, String name)Adds a mapping to the internal table.static StringgetStandardName(String algName)Returns Algorithm name for given algorithm aliasstatic booleanisOID(String alias)Checks if parameter represents OIDstatic Stringmap2AlgName(String oid)Returns algName for OIDstatic Stringmap2OID(String algName)Returns OID for algNamestatic Stringnormalize(String oid)Removes leading "OID." from oid String passedstatic voidremoveMapping(String oid, String name)Removes a mapping from the internal table.static voidsetSource(AlgNameMapperSource source)
-
-
-
Method Detail
-
addMapping
public static void addMapping(String oid, String name)
Adds a mapping to the internal table. Will overwrite any entry already present. Visible for testing.
-
removeMapping
public static void removeMapping(String oid, String name)
Removes a mapping from the internal table. Visible for testing.
-
map2OID
public static String map2OID(String algName)
Returns OID for algName- Parameters:
algName- algorithm name to be mapped- Returns:
- OID as String
-
map2AlgName
public static String map2AlgName(String oid)
Returns algName for OID- Parameters:
oid- OID to be mapped- Returns:
- algorithm name or
nullif not found.
-
getStandardName
public static String getStandardName(String algName)
Returns Algorithm name for given algorithm alias- Parameters:
algName- - alias- Returns:
- algorithm name
-
isOID
public static boolean isOID(String alias)
Checks if parameter represents OID- Parameters:
alias- alias to be checked- Returns:
- 'true' if parameter represents OID
-
normalize
public static String normalize(String oid)
Removes leading "OID." from oid String passed- Parameters:
oid- string that may contain leading "OID."- Returns:
- string passed without leading "OID."
-
setSource
public static void setSource(AlgNameMapperSource source)
-
-