Package io.moov.sdk.models.components
Class JSONWebKey
- java.lang.Object
-
- io.moov.sdk.models.components.JSONWebKey
-
public class JSONWebKey extends java.lang.ObjectJSONWebKeyDescribes an [RFC7517](https://datatracker.ietf.org/doc/html/rfc7517) web key.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJSONWebKey.Builder
-
Constructor Summary
Constructors Constructor Description JSONWebKey(java.lang.String kty)JSONWebKey(java.lang.String kty, java.util.Optional<? extends Use> use, java.util.Optional<? extends java.util.List<java.lang.String>> keyOps, java.util.Optional<java.lang.String> alg, java.util.Optional<java.lang.String> kid, java.util.Optional<java.lang.String> crv, java.util.Optional<java.lang.String> x, java.util.Optional<java.lang.String> y, java.util.Optional<java.lang.String> n, java.util.Optional<java.lang.String> e)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.lang.String>alg()The algorithm intended for use with the key, e.g., 'RS256' or 'ES256'.static JSONWebKey.Builderbuilder()java.util.Optional<java.lang.String>crv()The curve for Elliptic Curve keys, e.g., 'P-256', 'P-384', or 'P-521'.java.util.Optional<java.lang.String>e()The exponent value for RSA keys.booleanequals(java.lang.Object o)inthashCode()java.util.Optional<java.util.List<java.lang.String>>keyOps()The permitted operations for the key, e.g., 'sign', 'verify', 'encrypt', 'decrypt'.java.util.Optional<java.lang.String>kid()A unique identifier for the key.java.lang.Stringkty()The cryptographic algorithm family used with the key (e.g., 'RSA', 'EC', 'oct').java.util.Optional<java.lang.String>n()The modulus value for RSA keys.java.lang.StringtoString()java.util.Optional<Use>use()The intended use of the key.JSONWebKeywithAlg(java.lang.String alg)The algorithm intended for use with the key, e.g., 'RS256' or 'ES256'.JSONWebKeywithAlg(java.util.Optional<java.lang.String> alg)The algorithm intended for use with the key, e.g., 'RS256' or 'ES256'.JSONWebKeywithCrv(java.lang.String crv)The curve for Elliptic Curve keys, e.g., 'P-256', 'P-384', or 'P-521'.JSONWebKeywithCrv(java.util.Optional<java.lang.String> crv)The curve for Elliptic Curve keys, e.g., 'P-256', 'P-384', or 'P-521'.JSONWebKeywithE(java.lang.String e)The exponent value for RSA keys.JSONWebKeywithE(java.util.Optional<java.lang.String> e)The exponent value for RSA keys.JSONWebKeywithKeyOps(java.util.List<java.lang.String> keyOps)The permitted operations for the key, e.g., 'sign', 'verify', 'encrypt', 'decrypt'.JSONWebKeywithKeyOps(java.util.Optional<? extends java.util.List<java.lang.String>> keyOps)The permitted operations for the key, e.g., 'sign', 'verify', 'encrypt', 'decrypt'.JSONWebKeywithKid(java.lang.String kid)A unique identifier for the key.JSONWebKeywithKid(java.util.Optional<java.lang.String> kid)A unique identifier for the key.JSONWebKeywithKty(java.lang.String kty)The cryptographic algorithm family used with the key (e.g., 'RSA', 'EC', 'oct').JSONWebKeywithN(java.lang.String n)The modulus value for RSA keys.JSONWebKeywithN(java.util.Optional<java.lang.String> n)The modulus value for RSA keys.JSONWebKeywithUse(Use use)The intended use of the key.JSONWebKeywithUse(java.util.Optional<? extends Use> use)The intended use of the key.JSONWebKeywithX(java.lang.String x)The x coordinate for Elliptic Curve keys.JSONWebKeywithX(java.util.Optional<java.lang.String> x)The x coordinate for Elliptic Curve keys.JSONWebKeywithY(java.lang.String y)The y coordinate for Elliptic Curve keys.JSONWebKeywithY(java.util.Optional<java.lang.String> y)The y coordinate for Elliptic Curve keys.java.util.Optional<java.lang.String>x()The x coordinate for Elliptic Curve keys.java.util.Optional<java.lang.String>y()The y coordinate for Elliptic Curve keys.
-
-
-
Constructor Detail
-
JSONWebKey
public JSONWebKey(java.lang.String kty, java.util.Optional<? extends Use> use, java.util.Optional<? extends java.util.List<java.lang.String>> keyOps, java.util.Optional<java.lang.String> alg, java.util.Optional<java.lang.String> kid, java.util.Optional<java.lang.String> crv, java.util.Optional<java.lang.String> x, java.util.Optional<java.lang.String> y, java.util.Optional<java.lang.String> n, java.util.Optional<java.lang.String> e)
-
JSONWebKey
public JSONWebKey(java.lang.String kty)
-
-
Method Detail
-
kty
public java.lang.String kty()
The cryptographic algorithm family used with the key (e.g., 'RSA', 'EC', 'oct').
-
use
public java.util.Optional<Use> use()
The intended use of the key. 'sig' for signature, 'enc' for encryption.
-
keyOps
public java.util.Optional<java.util.List<java.lang.String>> keyOps()
The permitted operations for the key, e.g., 'sign', 'verify', 'encrypt', 'decrypt'.
-
alg
public java.util.Optional<java.lang.String> alg()
The algorithm intended for use with the key, e.g., 'RS256' or 'ES256'.
-
kid
public java.util.Optional<java.lang.String> kid()
A unique identifier for the key.
-
crv
public java.util.Optional<java.lang.String> crv()
The curve for Elliptic Curve keys, e.g., 'P-256', 'P-384', or 'P-521'.This field is required when `kty` is 'EC'.
-
x
public java.util.Optional<java.lang.String> x()
The x coordinate for Elliptic Curve keys.This field is required when `kty` is 'EC'.
-
y
public java.util.Optional<java.lang.String> y()
The y coordinate for Elliptic Curve keys.This field is required when `kty` is 'EC'.
-
n
public java.util.Optional<java.lang.String> n()
The modulus value for RSA keys.This field is required when `kty` is 'RSA'.
-
e
public java.util.Optional<java.lang.String> e()
The exponent value for RSA keys.This field is required when `kty` is 'RSA'.
-
builder
public static JSONWebKey.Builder builder()
-
withKty
public JSONWebKey withKty(java.lang.String kty)
The cryptographic algorithm family used with the key (e.g., 'RSA', 'EC', 'oct').
-
withUse
public JSONWebKey withUse(Use use)
The intended use of the key. 'sig' for signature, 'enc' for encryption.
-
withUse
public JSONWebKey withUse(java.util.Optional<? extends Use> use)
The intended use of the key. 'sig' for signature, 'enc' for encryption.
-
withKeyOps
public JSONWebKey withKeyOps(java.util.List<java.lang.String> keyOps)
The permitted operations for the key, e.g., 'sign', 'verify', 'encrypt', 'decrypt'.
-
withKeyOps
public JSONWebKey withKeyOps(java.util.Optional<? extends java.util.List<java.lang.String>> keyOps)
The permitted operations for the key, e.g., 'sign', 'verify', 'encrypt', 'decrypt'.
-
withAlg
public JSONWebKey withAlg(java.lang.String alg)
The algorithm intended for use with the key, e.g., 'RS256' or 'ES256'.
-
withAlg
public JSONWebKey withAlg(java.util.Optional<java.lang.String> alg)
The algorithm intended for use with the key, e.g., 'RS256' or 'ES256'.
-
withKid
public JSONWebKey withKid(java.lang.String kid)
A unique identifier for the key.
-
withKid
public JSONWebKey withKid(java.util.Optional<java.lang.String> kid)
A unique identifier for the key.
-
withCrv
public JSONWebKey withCrv(java.lang.String crv)
The curve for Elliptic Curve keys, e.g., 'P-256', 'P-384', or 'P-521'.This field is required when `kty` is 'EC'.
-
withCrv
public JSONWebKey withCrv(java.util.Optional<java.lang.String> crv)
The curve for Elliptic Curve keys, e.g., 'P-256', 'P-384', or 'P-521'.This field is required when `kty` is 'EC'.
-
withX
public JSONWebKey withX(java.lang.String x)
The x coordinate for Elliptic Curve keys.This field is required when `kty` is 'EC'.
-
withX
public JSONWebKey withX(java.util.Optional<java.lang.String> x)
The x coordinate for Elliptic Curve keys.This field is required when `kty` is 'EC'.
-
withY
public JSONWebKey withY(java.lang.String y)
The y coordinate for Elliptic Curve keys.This field is required when `kty` is 'EC'.
-
withY
public JSONWebKey withY(java.util.Optional<java.lang.String> y)
The y coordinate for Elliptic Curve keys.This field is required when `kty` is 'EC'.
-
withN
public JSONWebKey withN(java.lang.String n)
The modulus value for RSA keys.This field is required when `kty` is 'RSA'.
-
withN
public JSONWebKey withN(java.util.Optional<java.lang.String> n)
The modulus value for RSA keys.This field is required when `kty` is 'RSA'.
-
withE
public JSONWebKey withE(java.lang.String e)
The exponent value for RSA keys.This field is required when `kty` is 'RSA'.
-
withE
public JSONWebKey withE(java.util.Optional<java.lang.String> e)
The exponent value for RSA keys.This field is required when `kty` is 'RSA'.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-