K - The type of Edwards-curve PublicKey represented by this JWK (e.g. XECPublicKey, EdECPublicKey, etc).public interface OctetPublicJwk<K extends PublicKey> extends PublicJwk<K>
PublicKey as defined by RFC 8037, Section 2:
Key Type "OKP".
Unlike the EcPublicJwk interface, which only supports
Weierstrass-form ECPublicKeys,
OctetPublicJwk allows for multiple parameterized PublicKey types
because the JDK supports two different types of Edwards Curve public keys:
As such, OctetPublicJwk is parameterized to support both key types.
Earlier JDK Versions
Even though XECPublicKey and EdECPublicKey were introduced in JDK 11 and JDK 15 respectively,
JJWT supports Octet public JWKs in earlier versions when BouncyCastle is enabled in the application classpath. When
using earlier JDK versions, the OctetPublicJwk instance will need be parameterized with the
generic PublicKey type since the latter key types would not be present. For example:
OctetPublicJwk<PublicKey> octetPublicJwk = getKey();
OKP-specific Properties
Note that the various OKP-specific properties are not available as separate dedicated getter methods, as most Java
applications should rarely, if ever, need to access these individual key properties since they typically represent
internal key material and/or serialization details. If you need to access these key properties, it is usually
recommended to obtain the corresponding PublicKey instance returned by Jwk.toKey() and
query that instead.
Even so, because these properties exist and are readable by nature of every JWK being a
Map, they are still accessible via the standard Map get method
using an appropriate JWK parameter id, for example:
jwk.get("x");
// ... etc ...getPublicKeyUsegetAlgorithm, getOperations, getType, thumbprint, thumbprint, toKeygetIdclear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, valuesgetX509Chain, getX509Sha1Thumbprint, getX509Sha256Thumbprint, getX509UrlCopyright © 2014–2025 jsonwebtoken.io. All rights reserved.