if (type == PKCS5S1 || type == PKCS5S1_UTF8)
{
switch (hash)
{
case MD2:
generator = new PKCS5S1ParametersGenerator(new MD2Digest());
break;
case MD5:
generator = new PKCS5S1ParametersGenerator(new MD5Digest());
break;
case SHA1:
generator = new PKCS5S1ParametersGenerator(new SHA1Digest());
break;
default:
throw new IllegalStateException("PKCS5 scheme 1 only supports MD2, MD5 and SHA1.");
}
}