Example usage for java.security Provider getProperty

List of usage examples for java.security Provider getProperty

Introduction

In this page you can find the example usage for java.security Provider getProperty.

Prototype

public String getProperty(String key) 

Source Link

Usage

From source file:com.zacwolf.commons.crypto._CRYPTOfactory.java

public static void dumpCiphers() {
    for (Provider provider : Security.getProviders()) {
        System.out.println(provider.getName());
        for (String key : provider.stringPropertyNames())
            System.out.println("\t" + key + "\t" + provider.getProperty(key));
    }//  w ww  .j  a v a  2  s  . c  o  m
}

From source file:net.sf.jsignpdf.Signer.java

/**
 * Writes info about security providers to the {@link Logger} instance. The
 * log-level for messages is TRACE.//  w  w  w .  ja  va  2s  . c  o m
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
private static void traceInfo() {
    if (LOGGER.isTraceEnabled()) {
        try {
            Provider[] aProvider = Security.getProviders();
            for (int i = 0; i < aProvider.length; i++) {
                Provider provider = aProvider[i];
                LOGGER.trace(
                        "Provider " + (i + 1) + " : " + provider.getName() + " " + provider.getInfo() + " :");
                List keyList = new ArrayList(provider.keySet());
                try {
                    Collections.sort(keyList);
                } catch (Exception e) {
                    LOGGER.trace("Provider's properties keys can't be sorted", e);
                }
                Iterator keyIterator = keyList.iterator();
                while (keyIterator.hasNext()) {
                    String key = (String) keyIterator.next();
                    LOGGER.trace(key + ": " + provider.getProperty(key));
                }
                LOGGER.trace("------------------------------------------------");
            }
        } catch (Exception e) {
            LOGGER.trace("Listing security providers failed", e);
        }
    }
}