Package org.forgerock.json.jose.jwk
Interface EllipticCurveJwk
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SupportedEllipticCurve
getEllipticCurve()
The elliptic curve this JWK is on.boolean
isPublicKeyValid()
Determines whether the public key is a valid point on the underlying elliptic curve.ECPublicKey
toECPublicKey()
Converts the public claims in the JWK into a public key object.KeyPair
toKeyPair()
Converts the JWK to a key pair.PublicKey
toPublicKey()
Converts the public claims in the JWK into a public key.
-
-
-
Method Detail
-
isPublicKeyValid
boolean isPublicKeyValid()
Determines whether the public key is a valid point on the underlying elliptic curve. This eliminates points of small-order and potentially other anomalous points. The caller should still check whether the point is on the curve it expected.- Returns:
- true if the public key is a valid point on the curve.
-
toECPublicKey
ECPublicKey toECPublicKey()
Converts the public claims in the JWK into a public key object. This method is only compatible with EcJWKs and will throw an exception if called on an OkpJWK.- Returns:
- the public key.
-
toPublicKey
PublicKey toPublicKey()
Converts the public claims in the JWK into a public key. Note that the public key returned may not be an ECPublicKey. For instance, on Java 11 an OkpJWK may return a XECPrivateKey.- Returns:
- the public key.
-
toKeyPair
KeyPair toKeyPair()
Converts the JWK to a key pair.- Returns:
- the key pair.
-
getEllipticCurve
SupportedEllipticCurve getEllipticCurve()
The elliptic curve this JWK is on.- Returns:
- the elliptic curve.
-
-