|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.nimbusds.jose.JWK com.nimbusds.jose.ECKey
@Immutable public final class ECKey
Public Elliptic Curve
JSON Web Key (JWK). This class is
immutable.
Example JSON:
{ "kty" : "EC", "crv" : "P-256", "x" : "MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4", "y" : "4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM", "use" : "enc", "kid" : "1" }
See http://en.wikipedia.org/wiki/Elliptic_curve_cryptography
Nested Class Summary | |
---|---|
static class |
ECKey.Curve
Cryptographic curve. |
Constructor Summary | |
---|---|
ECKey(ECKey.Curve crv,
Base64URL x,
Base64URL y,
Use use,
Algorithm alg,
java.lang.String kid)
Creates a new public Elliptic Curve JSON Web Key (JWK) with the specified parameters. |
Method Summary | |
---|---|
ECKey.Curve |
getCurve()
Gets the cryptographic curve. |
Base64URL |
getX()
Gets the 'x' coordinate for the elliptic curve point. |
Base64URL |
getY()
Gets the 'y' coordinate for the elliptic curve point. |
static ECKey |
parse(net.minidev.json.JSONObject jsonObject)
Parses an Elliptic Curve JWK from the specified JSON object representation. |
net.minidev.json.JSONObject |
toJSONObject()
Returns a JSON object representation of this JWK. |
Methods inherited from class com.nimbusds.jose.JWK |
---|
getAlgorithm, getKeyID, getKeyType, getKeyUse, parse, parseAlgorithm, parseKeyID, parseKeyUse, toJSONString, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ECKey(ECKey.Curve crv, Base64URL x, Base64URL y, Use use, Algorithm alg, java.lang.String kid)
crv
- The cryptographic curve. Must not be null
.x
- The 'x' coordinate for the elliptic curve point. It is
represented as the Base64URL encoding of the coordinate's
big endian representation. Must not be null
.y
- The 'y' coordinate for the elliptic curve point. It is
represented as the Base64URL encoding of the coordinate's
big endian representation. Must not be null
.use
- The key use, null
if not specified.alg
- The intended JOSE algorithm for the key, null
if
not specified.kid
- The key ID, null
if not specified.Method Detail |
---|
public ECKey.Curve getCurve()
public Base64URL getX()
public Base64URL getY()
public net.minidev.json.JSONObject toJSONObject()
JWK
Example:
{ "kty" : "RSA", "use" : "sig", "kid" : "fd28e025-8d24-48bc-a51a-e2ffc8bc274b" }
toJSONObject
in class JWK
public static ECKey parse(net.minidev.json.JSONObject jsonObject) throws java.text.ParseException
jsonObject
- The JSON object to parse. Must not be
null
.
java.text.ParseException
- If the JSON object couldn't be parsed to a
valid Elliptic Curve JWK.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |