public enum ECCurves extends Enum<ECCurves> implements NamedResource, OptionalFeature
| Modifier and Type | Class and Description |
|---|---|
static class |
ECCurves.Constants |
NamedResource.Utils| Modifier and Type | Field and Description |
|---|---|
static Set<String> |
KEY_TYPES
A
Set of all the known curves key types |
static Set<String> |
NAMES
A
Set of all the known curves names |
static Set<ECCurves> |
VALUES
A
Set of all the known curves |
BY_NAME_COMPARATOR, NAME_EXTRACTOR| Modifier and Type | Method and Description |
|---|---|
static byte[] |
encodeECPoint(ECPoint group,
ECParameterSpec params) |
static byte[] |
encodeECPoint(ECPoint group,
EllipticCurve curve) |
static ECCurves |
fromCurveName(String name) |
static ECCurves |
fromCurveParameters(ECParameterSpec params) |
static ECCurves |
fromCurveSize(int keySize) |
static ECCurves |
fromKeyType(String type) |
static int |
getCurveSize(ECParameterSpec params) |
abstract Digest |
getDigestForParams() |
int |
getKeySize() |
String |
getKeyType() |
String |
getName() |
int |
getNumPointOctets() |
ECParameterSpec |
getParameters() |
boolean |
isSupported() |
static ECCurves |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ECCurves[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ECCurves nistp256
public static final ECCurves nistp384
public static final ECCurves nistp521
public static ECCurves[] values()
for (ECCurves c : ECCurves.values()) System.out.println(c);
public static ECCurves valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic final String getName()
getName in interface NamedResourcepublic final String getKeyType()
public final boolean isSupported()
isSupported in interface OptionalFeaturepublic final ECParameterSpec getParameters()
public final int getKeySize()
public final int getNumPointOctets()
public abstract Digest getDigestForParams()
Digest to use when hashing the curve's parameterspublic static ECCurves fromKeyType(String type)
type - The key type value - ignored if null/emptyECCurves constant - null if
no match found case insensitivepublic static ECCurves fromCurveName(String name)
name - The curve name (case insensitive - ignored if
null/emptyECCurves instance - null if no
match foundpublic static ECCurves fromCurveParameters(ECParameterSpec params)
params - The curve's ECParameterSpec - ignored if nullECCurves value - null if no match foundgetCurveSize(ECParameterSpec),
fromCurveSize(int)public static ECCurves fromCurveSize(int keySize)
keySize - The key size (in bits)ECCurves value - null if no
match foundpublic static int getCurveSize(ECParameterSpec params)
params - The curve's ECParameterSpecIllegalArgumentException - if invalid parameters providedpublic static byte[] encodeECPoint(ECPoint group, ECParameterSpec params)
public static byte[] encodeECPoint(ECPoint group, EllipticCurve curve)
Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.