public CryptoAlgorithm getCryptoAlgorithm()

in src/java/org/apache/fulcrum/crypto/DefaultCryptoService.java [74:92]


	public CryptoAlgorithm getCryptoAlgorithm(String algo) throws NoSuchAlgorithmException 
	{
		String cryptoClass = (String) algos.get(algo);
		CryptoAlgorithm ca = null;
		if (cryptoClass == null) {
			cryptoClass = (String) algos.get(DEFAULT_KEY);
		}
		if (cryptoClass == null || cryptoClass.equalsIgnoreCase("none")) {
			throw new NoSuchAlgorithmException("TurbineCryptoService: No Algorithm for " + algo + " found");
		}
		try {
			ca = (CryptoAlgorithm) Class.forName(cryptoClass).newInstance();
		} catch (Exception e) {
			throw new NoSuchAlgorithmException(
					"TurbineCryptoService: Error instantiating " + cryptoClass + " for " + algo);
		}
		ca.setCipher(algo);
		return ca;
	}