public class OkpJWK extends JWK implements EllipticCurveJwk
Modifier and Type | Class and Description |
---|---|
static class |
OkpJWK.Builder
Builder object for Octet Key-Pair (OKP) JWKs.
|
static interface |
OkpJWK.OctetECKey
Super interface of keys represented as raw octet sequences.
|
static class |
OkpJWK.OctetECPrivateKey
An EC private key represented by a scalar octet value.
|
static class |
OkpJWK.OctetECPublicKey
An EC public key represented by a compressed x-coordinate.
|
JSON_KEY_ALG, JSON_KEY_KID, JSON_KEY_KTY, JSON_KEY_OPERATIONS, JSON_KEY_USE, JSON_KEY_X5C, JSON_KEY_X5T, JSON_KEY_X5U
Modifier and Type | Method and Description |
---|---|
static OkpJWK.Builder |
builder()
Creates a new builder object for an OKP key.
|
static OkpJWK |
generateKeyPair(SupportedEllipticCurve curve)
Generates a fresh OKP JWK with both public and private claims on the given curve.
|
String |
getD()
Returns the private key d value.
|
SupportedEllipticCurve |
getEllipticCurve()
The supported elliptic curve that this key is on.
|
protected Optional<JWK.Builder<?>> |
getPublicJwkBuilder()
Return a builder with all the values set for representing the public components of the JWK.
|
String |
getX()
Returns the x-coordinate that forms the public key.
|
boolean |
isPrivate()
Indicates if any private key attributes are present in the JWK.
|
boolean |
isPublicKeyValid()
Determines whether the public key is valid.
|
static OkpJWK |
parse(JsonValue json)
Parses a JWK from a JsonValue json object.
|
ECPublicKey |
toECPublicKey()
Converts the JWK to a public key object.
|
JsonValue |
toJsonValue()
Returns a json representation of the JWK.
|
KeyPair |
toKeyPair()
Converts the JWK to a key-pair.
|
PrivateKey |
toPrivateKey()
Converts the JWK to a private key object.
|
PublicKey |
toPublicKey()
Converts the public claims in the JWK into a public key.
|
String |
toString() |
KeyPair |
toXECKeyPair()
Returns a KeyPair object containing the XECPrivateKey and XECPublicKey for this JWK.
|
PublicKey |
toXECPublicKey()
Converts the JWK to a Java 11 XECPublicKey instance.
|
getAlgorithm, getAlgorithm, getJwaAlgorithm, getKeyId, getKeyOperations, getKeyType, getUse, getX509Chain, getX509Thumbnail, getX509URL, loadJWKFromJson, parse, putField, toJsonString, toJsonValue, toPublicJwk
public static OkpJWK.Builder builder()
public SupportedEllipticCurve getEllipticCurve()
getEllipticCurve
in interface EllipticCurveJwk
public String getX()
public String getD()
public static OkpJWK parse(JsonValue json)
json
- JsonValue json objectpublic JsonValue toJsonValue()
JWK
toJsonValue
in class JWK
public boolean isPrivate()
JWK
protected Optional<JWK.Builder<?>> getPublicJwkBuilder()
JWK
JWK.toPublicJwk()
.getPublicJwkBuilder
in class JWK
public PrivateKey toPrivateKey()
public PublicKey toXECPublicKey()
public KeyPair toXECKeyPair()
public ECPublicKey toECPublicKey()
toECPublicKey
in interface EllipticCurveJwk
public PublicKey toPublicKey()
EllipticCurveJwk
toPublicKey
in interface EllipticCurveJwk
public boolean isPublicKeyValid()
isPublicKeyValid
in interface EllipticCurveJwk
public KeyPair toKeyPair()
toKeyPair
in interface EllipticCurveJwk
public static OkpJWK generateKeyPair(SupportedEllipticCurve curve)
curve
- The curve to generate the key pair on.Copyright © 2010-2018, ForgeRock All Rights Reserved.