Example usage for org.bouncycastle.asn1.sec SECNamedCurves getNames

List of usage examples for org.bouncycastle.asn1.sec SECNamedCurves getNames

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.sec SECNamedCurves getNames.

Prototype

public static Enumeration getNames() 

Source Link

Document

returns an enumeration containing the name strings for curves contained in this structure.

Usage

From source file:net.sf.keystore_explorer.crypto.ecc.CurveSet.java

License:Open Source License

/**
 * Return the list of all curve names for this set.
 *
 * @return The named curves that belong to this set
 *//* w w w .  ja  v  a2 s.c o  m*/
public List<String> getAllCurveNames() {
    Enumeration<String> en = null;

    switch (this) {
    case ANSI_X9_62:
        en = X962NamedCurves.getNames();
        break;
    case TELETRUST:
        en = TeleTrusTNamedCurves.getNames();
        break;
    case NIST:
        en = NISTNamedCurves.getNames();
        break;
    case SEC:
        en = SECNamedCurves.getNames();
        break;
    }

    if (en == null) {
        return new ArrayList<String>();
    }

    return Collections.list(en);
}

From source file:org.kse.crypto.ecc.CurveSet.java

License:Open Source License

/**
 * Return the list of all curve names for this set.
 *
 * @return The named curves that belong to this set
 *///from   w  ww .  j  av  a2  s  .  c o m
@SuppressWarnings("unchecked")
public List<String> getAllCurveNames() {
    Enumeration<String> en = null;

    switch (this) {
    case ANSI_X9_62:
        en = X962NamedCurves.getNames();
        break;
    case TELETRUST:
        en = TeleTrusTNamedCurves.getNames();
        break;
    case NIST:
        en = NISTNamedCurves.getNames();
        break;
    case SEC:
        en = SECNamedCurves.getNames();
        break;
    }

    if (en == null) {
        return new ArrayList<String>();
    }

    return Collections.list(en);
}

From source file:org.xipki.commons.console.karaf.completer.ECCurveNameCompleter.java

License:Open Source License

@Override
protected Set<String> getEnums() {
    Set<String> curveNames = new HashSet<>();
    Enumeration<?> names = X962NamedCurves.getNames();
    while (names.hasMoreElements()) {
        curveNames.add((String) names.nextElement());
    }/*from   w w  w  . j  a v a  2 s .  c om*/

    names = SECNamedCurves.getNames();
    while (names.hasMoreElements()) {
        curveNames.add((String) names.nextElement());
    }

    names = TeleTrusTNamedCurves.getNames();
    while (names.hasMoreElements()) {
        curveNames.add((String) names.nextElement());
    }

    names = NISTNamedCurves.getNames();
    while (names.hasMoreElements()) {
        curveNames.add((String) names.nextElement());
    }

    return curveNames;
}