java.security.Provider.entrySet()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(183)

本文整理了Java中java.security.Provider.entrySet()方法的一些代码示例,展示了Provider.entrySet()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Provider.entrySet()方法的具体详情如下:
包路径:java.security.Provider
类名称:Provider
方法名:entrySet

Provider.entrySet介绍

[英]Returns an unmodifiable Set view of the property entries contained in this Provider.
[中]返回此提供程序中包含的属性项的不可修改的集合视图。

代码示例

代码示例来源:origin: robovm/robovm

private static void selectEntries(Provider p) {
  Set<Map.Entry<Object, Object>> entrySet = p.entrySet();
  for (String service : serviceName) {
    String keyPrfix2find = "Alg.Alias." + service + ".";

代码示例来源:origin: stackoverflow.com

public static void main(String[] args) throws Exception {
  for (Provider provider : Security.getProviders()) {
    for (Map.Entry<Object, Object> entry : provider.entrySet()) {
      if (((String) entry.getValue()).contains("GCM")) {
        System.out.printf("key: [%s]  value: [%s]%n",
          entry.getKey(),
          entry.getValue());
      }
    }
  }
}

代码示例来源:origin: stackoverflow.com

for(Provider p : Security.getProviders()) {
  System.out.println("Provider " + p.getName());
  for(Map.Entry e : p.entrySet()) {
    System.out.println("    " + e.getKey() + " : " + e.getValue());
  }
}

代码示例来源:origin: org.glassfish.main.common/amx-core

public String
  stringify( Object object )
  {
    final Provider	provider	= (Provider)object;
    
    final StringBuffer	buf	= new StringBuffer();

    buf.append( provider.getInfo() );
    
    java.util.Iterator    iter    = provider.entrySet().iterator();
    while ( iter.hasNext() )
    {
      buf.append( iter.next().toString() + "\n" );
    }

    return( buf.toString() );
  }
}

代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-common

public Set<Map.Entry<Object, Object>> entrySet() {
  Provider p = getProvider();
  if (p != null) {
    return p.entrySet();
  } else {
    return Collections.emptySet();
  }
}

代码示例来源:origin: org.glassfish.common/amx-core

public String
  stringify( Object object )
  {
    final Provider	provider	= (Provider)object;
    
    final StringBuffer	buf	= new StringBuffer();

    buf.append( provider.getInfo() );
    
    java.util.Iterator    iter    = provider.entrySet().iterator();
    while ( iter.hasNext() )
    {
      buf.append( iter.next().toString() + "\n" );
    }

    return( buf.toString() );
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.security

private Set<String> findProviders(String prefix) {
  Provider[] providers = Security.getProviders();
  Set<String> algorithms = new HashSet<>();
  int prefixLength = prefix.length();
  for (int i = 0; i < providers.length; i++) {
    for (Iterator<Entry<Object, Object>> j = providers[i].entrySet().iterator(); j.hasNext();) {
      Entry<Object, Object> entry = j.next();
      Object key = entry.getKey();
      if (key == null)
        continue;
      if (!(key instanceof String))
        continue;
      String value = (String) key;
      if (value.indexOf(' ') != -1) // skips properties like "[Cipher.ABC SupportedPaddings]"
        continue;
      if (value.startsWith(prefix)) {
        String keyFactory = value.substring(prefixLength);
        algorithms.add(keyFactory);
      }
    }
  }
  return algorithms;
}

代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.security

private Set findProviders(String prefix) {
  Provider[] providers = Security.getProviders();
  Set algorithms = new HashSet();
  int prefixLength = prefix.length();
  for (int i = 0; i < providers.length; i++) {
    for (Iterator j = providers[i].entrySet().iterator(); j.hasNext();) {
      Map.Entry entry = (Map.Entry) j.next();
      Object key = entry.getKey();
      if (key == null)
        continue;
      if (!(key instanceof String))
        continue;
      String value = (String) key;
      if (value.indexOf(' ') != -1) // skips properties like "[Cipher.ABC SupportedPaddings]"
        continue;
      if (value.startsWith(prefix)) {
        String keyFactory = value.substring(prefixLength);
        algorithms.add(keyFactory);
      }
    }
  }
  return algorithms;
}

代码示例来源:origin: com.gluonhq/robovm-rt

private static void selectEntries(Provider p) {
  Set<Map.Entry<Object, Object>> entrySet = p.entrySet();
  for (String service : serviceName) {
    String keyPrfix2find = "Alg.Alias." + service + ".";

代码示例来源:origin: ibinti/bugvm

private static void selectEntries(Provider p) {
  Set<Map.Entry<Object, Object>> entrySet = p.entrySet();
  for (String service : serviceName) {
    String keyPrfix2find = "Alg.Alias." + service + ".";

代码示例来源:origin: MobiVM/robovm

private static void selectEntries(Provider p) {
  Set<Map.Entry<Object, Object>> entrySet = p.entrySet();
  for (String service : serviceName) {
    String keyPrfix2find = "Alg.Alias." + service + ".";

代码示例来源:origin: FlexoVM/flexovm

private static void selectEntries(Provider p) {
  Set<Map.Entry<Object, Object>> entrySet = p.entrySet();
  for (String service : serviceName) {
    String keyPrfix2find = "Alg.Alias." + service + ".";

代码示例来源:origin: com.bugvm/bugvm-rt

private static void selectEntries(Provider p) {
  Set<Map.Entry<Object, Object>> entrySet = p.entrySet();
  for (String service : serviceName) {
    String keyPrfix2find = "Alg.Alias." + service + ".";

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

private static void selectEntries(Provider p) {
  Set<Map.Entry<Object, Object>> entrySet = p.entrySet();
  for (String service : serviceName) {
    String keyPrfix2find = "Alg.Alias." + service + ".";

代码示例来源:origin: org.nhind/direct-jce-providers

/**
 * Constructor
 */
public ProtectServerWrapperProvider()
{
  super("SAFENETPROTECTWRAPPER", 1.0, "SAFENET ProtectServer Security Provider Wrapper");
  
  try
  {
    final Class<?> providerClazz = getClass().getClassLoader().loadClass(SAFENET_PROV_CLAZZ_NAME);
    
    Provider safeNetProvider = Provider.class.cast(providerClazz.newInstance());
    
    for (Map.Entry<Object,Object> entry : safeNetProvider.entrySet())				
      this.put(entry.getKey(), entry.getValue());
    
    
    /*
     * Override the internal wrapper properties
     */
    this.put("Cipher.AES", AES.class.getName());
    this.put("Cipher.RSA", RSA.class.getName());
    this.put("KeyStore.CRYPTOKIWRAPPER", KeyS.class.getName());
  }
  catch (Exception e)
  {
    throw new IllegalStateException("Failed to override provider properties.");
  }
  
}

代码示例来源:origin: DirectProject/nhin-d

/**
 * Constructor
 */
public ProtectServerWrapperProvider()
{
  super("SAFENETPROTECTWRAPPER", 1.0, "SAFENET ProtectServer Security Provider Wrapper");
  
  try
  {
    final Class<?> providerClazz = getClass().getClassLoader().loadClass(SAFENET_PROV_CLAZZ_NAME);
    
    Provider safeNetProvider = Provider.class.cast(providerClazz.newInstance());
    
    for (Map.Entry<Object,Object> entry : safeNetProvider.entrySet())				
      this.put(entry.getKey(), entry.getValue());
    
    
    /*
     * Override the internal wrapper properties
     */
    this.put("Cipher.AES", AES.class.getName());
    this.put("Cipher.RSA", RSA.class.getName());
    this.put("KeyStore.CRYPTOKIWRAPPER", KeyS.class.getName());
  }
  catch (Exception e)
  {
    throw new IllegalStateException("Failed to override provider properties.");
  }
  
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.security.ui

Hashtable<String, Hashtable<String, String>> attributeMap = new Hashtable<>(); // "type" => "Hashtable of (attribute,value) pairs"
Hashtable<String, List<String>> aliasMap = new Hashtable<>(); // "type" => "Arraylist of aliases"
for (Iterator<Entry<Object, Object>> it = provider.entrySet().iterator(); it.hasNext();) {
  Entry<Object, Object> entry = it.next();
  String key = (String) entry.getKey();

相关文章