com.nimbusds.jose.jwk
Class ECKey.Curve

java.lang.Object
  extended by com.nimbusds.jose.jwk.ECKey.Curve
Enclosing class:
ECKey

@Immutable
public static class ECKey.Curve
extends Object

Cryptographic curve. This class is immutable.

Includes constants for the following standard cryptographic curves:

See "Digital Signature Standard (DSS)", FIPS PUB 186-3, June 2009, National Institute of Standards and Technology (NIST).


Field Summary
static ECKey.Curve P_256
          P-256 curve (secp256r1).
static ECKey.Curve P_384
          P-384 curve (secp384r1).
static ECKey.Curve P_521
          P-521 curve (secp521r1).
 
Constructor Summary
ECKey.Curve(String name)
          Creates a new cryptographic curve with the specified name.
ECKey.Curve(String name, String stdName)
          Creates a new cryptographic curve with the specified name.
 
Method Summary
 boolean equals(Object object)
          Overrides Object.equals().
static ECKey.Curve forStdName(String stdName)
          Gets the cryptographic curve for the specified standard (JCA) name.
 String getName()
          Gets the name of this cryptographic curve.
 String getStdName()
          Gets the standard (JCA) name of this cryptographic curve.
static ECKey.Curve parse(String s)
          Parses a cryptographic curve from the specified string.
 ECParameterSpec toECParameterSpec()
          Gets the Elliptic Curve parameter specification for this cryptographic curve.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

P_256

public static final ECKey.Curve P_256
P-256 curve (secp256r1).


P_384

public static final ECKey.Curve P_384
P-384 curve (secp384r1).


P_521

public static final ECKey.Curve P_521
P-521 curve (secp521r1).

Constructor Detail

ECKey.Curve

public ECKey.Curve(String name)
Creates a new cryptographic curve with the specified name. The standard (JCA) curve name is not unspecified.

Parameters:
name - The name of the cryptographic curve. Must not be null.

ECKey.Curve

public ECKey.Curve(String name,
                   String stdName)
Creates a new cryptographic curve with the specified name.

Parameters:
name - The JOSE name of the cryptographic curve. Must not be null.
stdName - The standard (JCA) name of the cryptographic curve, null if not specified.
Method Detail

getName

public String getName()
Gets the name of this cryptographic curve.

Returns:
The name.

getStdName

public String getStdName()
Gets the standard (JCA) name of this cryptographic curve.

Returns:
The standard (JCA) name.

toECParameterSpec

public ECParameterSpec toECParameterSpec()
Gets the Elliptic Curve parameter specification for this cryptographic curve.

Returns:
The EC parameter specification, null if this cryptographic curve has no standard (JCA) name specified or if lookup of the EC parameters failed.

toString

public String toString()
Overrides:
toString in class Object
See Also:
getName()

equals

public boolean equals(Object object)
Overrides Object.equals().

Overrides:
equals in class Object
Parameters:
object - The object to compare to.
Returns:
true if the objects have the same value, otherwise false.

parse

public static ECKey.Curve parse(String s)
                         throws ParseException
Parses a cryptographic curve from the specified string.

Parameters:
s - The string to parse. Must not be null.
Returns:
The cryptographic curve.
Throws:
ParseException - If the string couldn't be parsed.

forStdName

public static ECKey.Curve forStdName(String stdName)
Gets the cryptographic curve for the specified standard (JCA) name.

Parameters:
stdName - The standard (JCA) name. Must not be null.
Throws:
IllegalArgumentException - If no matching JOSE curve constant could be found.


Copyright © 2013 NimbusDS. All Rights Reserved.