output = new TypedIOPort(this, "output", false, true);
output.setTypeEquals(new ArrayType(BaseType.UNSIGNED_BYTE));
// Add the possible algorithm choices.
algorithm = new StringParameter(this, "algorithm");
Set algorithms = Security.getAlgorithms("Cipher");
Iterator algorithmsIterator = algorithms.iterator();
for (int i = 0; algorithmsIterator.hasNext(); i++) {
String algorithmName = (String) algorithmsIterator.next();
if (i == 0) {
algorithm.setExpression(algorithmName);
}
algorithm.addChoice(algorithmName);
}
// Add the possible provider choices.
provider = new StringParameter(this, "provider");
provider.setExpression("SystemDefault");
provider.addChoice("SystemDefault");
Provider[] providers = Security.getProviders();