Constructor and Description |
---|
EcJWK(ECPublicKey publicKey,
ECPrivateKey privateKey,
KeyUse use,
String kid)
Creates a public and private EcJWK.
|
EcJWK(ECPublicKey publicKey,
KeyUse use,
String kid)
Creates a public EcJWK.
|
EcJWK(KeyUse use,
String alg,
String kid,
String x,
String y,
String curve,
String x5u,
String x5t,
List<String> x5c)
Creates a public EcJWK.
|
EcJWK(KeyUse use,
String alg,
String kid,
String x,
String y,
String d,
String curve,
String x5u,
String x5t,
List<String> x5c)
Creates a public and private EcJWK.
|
Modifier and Type | Method and Description |
---|---|
static BigInteger |
decodeCoordinate(String encodedCoordinate)
Decode the unsigned big-endian base64 url encoding of an elliptical curve point.
|
static String |
encodeCoordinate(int fieldSize,
BigInteger coordinate)
Base64url encode the unsigned big-endian representation of an elliptical curve point.
|
String |
getCurve()
Gets the known curve to use.
|
String |
getD()
Gets the unsigned big-endian base64 url encoding of the d value for the elliptical curve private key.
|
String |
getX()
Gets the unsigned big-endian base64 url encoding of the elliptical curve point x coordinate.
|
String |
getY()
Gets the unsigned big-endian base64 url encoding of the elliptical curve point y coordinate.
|
static EcJWK |
parse(JsonValue json)
Parses a JWK from a JsonValue json object.
|
static EcJWK |
parse(String json)
Parses a JWK from a string json object.
|
ECPrivateKey |
toECPrivateKey()
Converts the JWK to a ECPrivateKey.
|
ECPublicKey |
toECPublicKey()
Converts the JWK to a ECPublicKey.
|
String |
toJsonString()
Prints the JWK as a String json object.
|
KeyPair |
toKeyPair()
Converts the JWK to a KeyPair.
|
getAlgorithm, getKeyId, getKeyType, getUse, getX509Chain, getX509Thumbnail, getX509URL, toJsonValue
checkListValuesAreOfType, checkValueIsOfType, get, isDefined, isValueOfType, keys, put, toJsonValue, toString
public EcJWK(ECPublicKey publicKey, KeyUse use, String kid)
publicKey
- The public key for the JWKuse
- The value of the use JWK parameterkid
- The key id of the JWKpublic EcJWK(ECPublicKey publicKey, ECPrivateKey privateKey, KeyUse use, String kid)
publicKey
- The public key for the JWKprivateKey
- The private key for the JWKuse
- The value of the use JWK parameterkid
- The key id of the JWKpublic EcJWK(KeyUse use, String alg, String kid, String x, String y, String curve, String x5u, String x5t, List<String> x5c)
use
- The value of the use JWK parameteralg
- The value of the alg JWK parameterkid
- The key id of the JWKx
- The unsigned big-endian base64 url encoding of the elliptical curve point x coordinatey
- The unsigned big-endian base64 url encoding of the elliptical curve point y coordinatecurve
- The known curve to use. For example "NIST P-256".x5u
- the x509 url for the keyx5t
- the x509 thumbnail for the keyx5c
- the x509 chain as a list of Base64 encoded stringspublic EcJWK(KeyUse use, String alg, String kid, String x, String y, String d, String curve, String x5u, String x5t, List<String> x5c)
use
- The value of the use JWK parameteralg
- The value of the alg JWK parameterkid
- The key id of the JWKx
- The unsigned big-endian base64 url encoding of the elliptical curve point x coordinatey
- The unsigned big-endian base64 url encoding of the elliptical curve point y coordinated
- The unsigned big-endian base64 url encoding of the d value for the elliptical curve private keycurve
- The known curve to use. For example "NIST P-256".x5u
- the x509 url for the keyx5t
- the x509 thumbnail for the keyx5c
- the x509 chain as a list of Base64 encoded stringspublic String getX()
public String getY()
public String getD()
public String getCurve()
public static EcJWK parse(String json)
json
- string json objectpublic static EcJWK parse(JsonValue json)
json
- JsonValue json objectpublic String toJsonString()
toJsonString
in class JWK
public ECPublicKey toECPublicKey()
public ECPrivateKey toECPrivateKey()
public static BigInteger decodeCoordinate(String encodedCoordinate)
encodedCoordinate
- the unsigned big-endian base64 url encoding of a the elliptical curve pointpublic static String encodeCoordinate(int fieldSize, BigInteger coordinate)
fieldSize
- the EC field size in bits.coordinate
- the elliptical curve pointCopyright 2011-2015 ForgeRock AS.