com.github.ncredinburgh.tomcat.command.ListKeyGeneratorsCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tomcat-external-propertysource Show documentation
Show all versions of tomcat-external-propertysource Show documentation
A Tomcat PropertySource class that reads provides property values from an external file.
The newest version!
package com.github.ncredinburgh.tomcat.command;
import java.security.Provider;
import java.security.Security;
import java.util.Queue;
class ListKeyGeneratorsCommand implements Command {
private static final String COMMAND_KEY = "listKeyGenerators";
private static final String COMMAND_USAGE= COMMAND_KEY;
@Override
public String getCommandKey() {
return COMMAND_KEY;
}
@Override
public void doCommand(Options options, Queue arguments) {
// No arguments to process
listKeyGenerators();
}
@Override
public String getUsage() {
return COMMAND_USAGE;
}
private void listKeyGenerators() {
for (Provider provider : Security.getProviders()) {
for (Provider.Service service : provider.getServices()) {
if (service.getType().equals("KeyGenerator")) {
System.out.println("Provider: " + provider.getName() + " Algorithm: " + service.getAlgorithm());
}
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy