- java.lang.Object
-
- org.apache.xml.security.algorithms.JCEMapper
-
public class JCEMapper extends Object
This class maps algorithm identifier URIs to JAVA JCE class names.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJCEMapper.AlgorithmRepresents the Algorithm xml element
-
Constructor Summary
Constructors Constructor Description JCEMapper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetAlgorithmClassFromURI(String algorithmURI)Method getAlgorithmClassFromURIstatic intgetIVLengthFromURI(String algorithmURI)static StringgetJCEKeyAlgorithmFromURI(String algorithmURI)Method getJCEKeyAlgorithmFromURIstatic StringgetJCEProviderFromURI(String algorithmURI)Method getJCEProviderFromURIstatic intgetKeyLengthFromURI(String algorithmURI)Returns the keylength in bits for a particular algorithm.static StringgetProviderId()Gets the default Provider for obtaining the security algorithmsstatic voidregister(String id, JCEMapper.Algorithm algorithm)Method registerstatic voidregisterDefaultAlgorithms()This method registers the default algorithms.static voidsetProviderId(String provider)Sets the default Provider for obtaining the security algorithmsstatic voidsetThreadSpecificProviderName(String threadSpecificProviderName)Sets the default Provider for this thread to obtain the security algorithmsstatic StringtranslateURItoJCEID(String algorithmURI)Method translateURItoJCEID
-
-
-
Method Detail
-
register
public static void register(String id, JCEMapper.Algorithm algorithm)
Method register- Parameters:
id-algorithm-- Throws:
SecurityException- if a security manager is installed and the caller does not have permission to register the JCE algorithm
-
registerDefaultAlgorithms
public static void registerDefaultAlgorithms()
This method registers the default algorithms.
-
translateURItoJCEID
public static String translateURItoJCEID(String algorithmURI)
Method translateURItoJCEID- Parameters:
algorithmURI-- Returns:
- the JCE standard name corresponding to the given URI
-
getAlgorithmClassFromURI
public static String getAlgorithmClassFromURI(String algorithmURI)
Method getAlgorithmClassFromURI- Parameters:
algorithmURI-- Returns:
- the class name that implements this algorithm
-
getKeyLengthFromURI
public static int getKeyLengthFromURI(String algorithmURI)
Returns the keylength in bits for a particular algorithm.- Parameters:
algorithmURI-- Returns:
- The length of the key used in the algorithm
-
getIVLengthFromURI
public static int getIVLengthFromURI(String algorithmURI)
-
getJCEKeyAlgorithmFromURI
public static String getJCEKeyAlgorithmFromURI(String algorithmURI)
Method getJCEKeyAlgorithmFromURI- Parameters:
algorithmURI-- Returns:
- The KeyAlgorithm for the given URI.
-
getJCEProviderFromURI
public static String getJCEProviderFromURI(String algorithmURI)
Method getJCEProviderFromURI- Parameters:
algorithmURI-- Returns:
- The JCEProvider for the given URI.
-
getProviderId
public static String getProviderId()
Gets the default Provider for obtaining the security algorithms- Returns:
- the default providerId.
-
setProviderId
public static void setProviderId(String provider)
Sets the default Provider for obtaining the security algorithms- Parameters:
provider- the default providerId.- Throws:
SecurityException- if a security manager is installed and the caller does not have permission to register the JCE algorithm
-
setThreadSpecificProviderName
public static void setThreadSpecificProviderName(String threadSpecificProviderName)
Sets the default Provider for this thread to obtain the security algorithms- Parameters:
threadSpecificProviderName- the default providerId.- Throws:
SecurityException- if a security manager is installed and the caller does not have permission to register the JCE algorithm
-
-