本文整理了Java中java.security.Provider.getVersion()
方法的一些代码示例,展示了Provider.getVersion()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Provider.getVersion()
方法的具体详情如下:
包路径:java.security.Provider
类名称:Provider
方法名:getVersion
[英]Returns the version number for the services being provided.
[中]返回所提供服务的版本号。
代码示例来源:origin: stackoverflow.com
for (Provider provider : Security.getProviders())
{
System.out.println("Name: " + provider.getName() + " Version: " + provider.getVersion());
}
代码示例来源:origin: com.helger/ph-webctrls
@Override
protected int mainCompare (@Nonnull final Provider aElement1,
@Nonnull final Provider aElement2)
{
int ret = aElement1.getName ()
.compareTo (aElement2.getName ());
if (ret == 0)
ret = CompareUtils.compare (aElement1.getVersion (),
aElement2.getVersion ());
return ret;
}
});
代码示例来源:origin: org.jboss.ws.cxf/jbossws-cxf-client
private static Provider getBCProvider() {
Provider provider = null;
try {
Class<?> clazz = SecurityProviderConfig.class.getClassLoader().loadClass("org.bouncycastle.jce.provider.BouncyCastleProvider");
provider = (Provider)clazz.newInstance();
if (provider.getVersion() < 1.50) {
useIvParameterSpec();
}
} catch (Throwable t) {
Loggers.ROOT_LOGGER.cannotLoadBouncyCastleProvider(Constants.JBWS_CXF_NO_LOCAL_BC, t);
}
return provider;
}
}
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-common
public Boolean run() {
String bcProviderStr =
addJceProvider("BC", "org.bouncycastle.jce.provider.BouncyCastleProvider");
// If we have BouncyCastle v1.49 installed then use IvParameterSpec in
// Santuario. This can be removed when we pick up BouncyCastle 1.51+
if (bcProviderStr != null) {
Provider bcProvider = Security.getProvider(bcProviderStr);
if (bcProvider.getVersion() < 1.50) {
useIvParameterSpec();
}
}
return true;
}
});
代码示例来源:origin: stackoverflow.com
public static void main(final String[] args) {
final Provider[] providers = Security.getProviders();
for (int i = 0; i < providers.length; i++) {
final String name = providers[i].getName();
final double version = providers[i].getVersion();
System.out.println("Provider[" + i + "]:: " + name + " " + version);
if (args.length > 0) {
final Iterator it = providers[i].keySet().iterator();
while (it.hasNext()) {
final String element = (String) it.next();
if (element.toLowerCase().startsWith(args[0].toLowerCase())
|| args[0].equals("-all"))
System.out.println("\t" + element);
}
}
}
}
代码示例来源:origin: org.eclipse.equinox.security/ui
private void appendProvider(PrintWriter writer, Provider provider, int index) {
writer.println(" Provider: " + provider.getName() + ", Version: " + provider.getVersion() + ", Class: " + provider.getClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
writer.println(" Description: " + provider.getInfo()); //$NON-NLS-1$
ProviderService[] services = getServices(provider);
writer.println(" Services (" + services.length + "):"); //$NON-NLS-1$ //$NON-NLS-2$
for (int i = 0; i < services.length; i++) {
appendService(writer, services[i], i);
}
writer.println();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.security.ui
private void appendProvider(PrintWriter writer, Provider provider, int index) {
writer.println(" Provider: " + provider.getName() + ", Version: " + provider.getVersion() + ", Class: " + provider.getClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
writer.println(" Description: " + provider.getInfo()); //$NON-NLS-1$
ProviderService[] services = getServices(provider);
writer.println(" Services (" + services.length + "):"); //$NON-NLS-1$ //$NON-NLS-2$
for (int i = 0; i < services.length; i++) {
appendService(writer, services[i], i);
}
writer.println();
}
代码示例来源:origin: wildfly/wildfly-core
/**
* Populate the supplied response {@link ModelNode} with information about the supplied {@link Provider}
*
* @param response the response to populate.
* @param provider the {@link Provider} to use when populating the response.
*/
static void populateProvider(final ModelNode response, final Provider provider, final boolean includeServices) {
response.get(ElytronDescriptionConstants.NAME).set(provider.getName());
response.get(ElytronDescriptionConstants.INFO).set(provider.getInfo());
response.get(ElytronDescriptionConstants.VERSION).set(provider.getVersion());
if (includeServices) {
addServices(response, provider);
}
}
代码示例来源:origin: stackoverflow.com
for (Provider provider : Security.getProviders()) {
System.out.println("Provider: " + provider.getName() + " version: " + provider.getVersion());
for (Provider.Service service : provider.getServices()) {
System.out.printf(" Type : %-30s Algorithm: %-30s\n", service.getType(), service.getAlgorithm());
}
}
代码示例来源:origin: com.microsoft.azure/azure-data-lake-store-sdk
public SSLSocketFactoryEx(SSLChannelMode channelMode) throws IOException {
this.channelMode = channelMode;
try {
initSSLSocketFactoryEx(null, null, null);
} catch (NoSuchAlgorithmException e) {
throw new IOException(e);
} catch (KeyManagementException e) {
throw new IOException(e);
}
userAgent = m_ctx.getProvider().getName() + "-" + m_ctx.getProvider().getVersion();
}
代码示例来源:origin: stackoverflow.com
import java.security.Provider;
import java.security.Security;
import java.util.Arrays;
public class ShowCryptoProviders
{
private static final String EOL = System.getProperty("line.separator");
public static void main(final String[] args)
{
final Provider[] providers = Security.getProviders();
final Boolean verbose = Arrays.asList(args).contains("-v");
for (final Provider p : providers)
{
System.out.format("%s %s%s", p.getName(), p.getVersion(), EOL);
for (final Object o : p.keySet())
{
if (verbose)
{
System.out.format("\t%s : %s%s", o, p.getProperty((String)o), EOL);
}
}
}
}
}
代码示例来源:origin: org.eclipse.equinox.security/ui
public void handleEvent(Event event) {
Provider provider = Security.getProviders()[providerCombo.getSelectionIndex()];
providerViewer.setInput(getContent(provider));
versionText.setText(String.valueOf(provider.getVersion()));
descriptionText.setText(provider.getInfo());
}
});
代码示例来源:origin: RUB-NDS/TLS-Attacker
@Override
public void applyDelegate(Config config) {
Security.addProvider(new BouncyCastleProvider());
if (isDebug()) {
Configurator.setAllLevels("de.rub.nds.tlsattacker", Level.DEBUG);
} else if (quiet) {
Configurator.setAllLevels("de.rub.nds.tlsattacker", Level.OFF);
}
LOGGER.debug("Using the following security providers");
for (Provider p : Security.getProviders()) {
LOGGER.debug("Provider {}, version, {}", p.getName(), p.getVersion());
}
// remove stupid Oracle JDK security restriction (otherwise, it is not
// possible to use strong crypto with Oracle JDK)
UnlimitedStrengthEnabler.enable();
}
}
代码示例来源:origin: org.apache.hadoop/hadoop-azure
private SSLSocketFactoryEx(SSLChannelMode preferredChannelMode)
throws IOException {
try {
initializeSSLContext(preferredChannelMode);
} catch (NoSuchAlgorithmException e) {
throw new IOException(e);
} catch (KeyManagementException e) {
throw new IOException(e);
}
// Get list of supported cipher suits from the SSL factory.
SSLSocketFactory factory = ctx.getSocketFactory();
String[] defaultCiphers = factory.getSupportedCipherSuites();
String version = System.getProperty("java.version");
ciphers = (channelMode == SSLChannelMode.Default_JSSE
&& version.startsWith("1.8"))
? alterCipherList(defaultCiphers) : defaultCiphers;
providerName = ctx.getProvider().getName() + "-"
+ ctx.getProvider().getVersion();
}
代码示例来源:origin: stackoverflow.com
Provider[] providers = Security.getProviders();
for (Provider p : providers) {
String providerStr = String.format("%s/%s/%f\n", p.getName(),
p.getInfo(), p.getVersion());
Set<Service> services = p.getServices();
for (Service s : services) {
if ("MessageDigest".equals(s.getType())) {
System.out.printf("\t%s/%s/%s", s.getType(),
s.getAlgorithm(), s.getClassName());
}
}
}
代码示例来源:origin: stackoverflow.com
System.out.printf(" --- Provider %s, version %.2f --- %n", prov.getName(), prov.getVersion());
for (Service service : algos) {
String algo = service.getAlgorithm();
代码示例来源:origin: stackoverflow.com
static public void listAlgorithms( String algFilter ){
java.security.Provider[] providers = java.security.Security.getProviders();
for ( java.security.Provider p : providers ){
String providerStr = String.format( "%s/%s/%f\n", p.getName(), p.getInfo(),
p.getVersion() );
mLog.debug( providerStr );
Set< Service > services = p.getServices();
List< String > algs = new ArrayList<>();
for ( Service s : services ){
boolean match = true;
if ( algFilter != null ){
match = s.getAlgorithm().toLowerCase().contains( algFilter.toLowerCase() );
}
if ( match ){
String algStr = String.format( "\t%s/%s/%s", s.getType(),
s.getAlgorithm(), s.getClassName() );
algs.add( algStr );
}
}
Collections.sort( algs );
for ( String alg : algs ) mLog.debug( "\t" + alg );
mLog.debug( "" );
}
}//listAlgorithms
代码示例来源:origin: org.picketlink/picketlink-federation
logger.debug("The provider " + provider.getName() + " - " + provider.getVersion() + " was added at position: "
+ ret);
代码示例来源:origin: org.picketlink/picketlink-core
logger.debug("The provider " + provider.getName() + " - " + provider.getVersion() + " was added at position: "
+ ret);
代码示例来源:origin: org.picketlink/picketlink-common
logger.debug("The provider " + provider.getName() + " - " + provider.getVersion() + " was added at position: "
+ ret);
内容来源于网络,如有侵权,请联系作者删除!