org.polyglotted.crypto.AlgoConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of crypto-recipes Show documentation
Show all versions of crypto-recipes Show documentation
A library of standard cryptographic recipes for application usage
package org.polyglotted.crypto;
import com.beust.jcommander.IStringConverter;
import com.beust.jcommander.ParameterException;
public class AlgoConverter implements IStringConverter {
@Override
public Algo convert(String value) {
try {
return Algo.valueOf(value);
}
catch (Exception ex) {
throw new ParameterException("illegal algorithm name");
}
}
}