protected static synchronized void init(JCEAlgorithmMappingsType jceAlgorithmMappingsType) throws Exception {
List<AlgorithmType> algorithms = jceAlgorithmMappingsType.getAlgorithm();
for (int i = 0; i < algorithms.size(); i++) {
AlgorithmType algorithmType = algorithms.get(i);
int keyLength = 0;
if (algorithmType.getKeyLength() != null) {
keyLength = algorithmType.getKeyLength();
}
int ivLength = 0;
if (algorithmType.getIVLength() != null) {
ivLength = algorithmType.getIVLength();
}
Algorithm algorithm =
new Algorithm(algorithmType.getRequiredKey(), algorithmType.getJCEName(),
algorithmType.getAlgorithmClass(), keyLength,
ivLength, algorithmType.getJCEProvider());
register(algorithmType.getURI(), algorithm);
}
}