Class JSONWebKey.Builder

  • Enclosing class:
    JSONWebKey

    public static final class JSONWebKey.Builder
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      JSONWebKey.Builder alg​(java.lang.String alg)
      The algorithm intended for use with the key, e.g., 'RS256' or 'ES256'.
      JSONWebKey.Builder alg​(java.util.Optional<java.lang.String> alg)
      The algorithm intended for use with the key, e.g., 'RS256' or 'ES256'.
      JSONWebKey build()  
      JSONWebKey.Builder crv​(java.lang.String crv)
      The curve for Elliptic Curve keys, e.g., 'P-256', 'P-384', or 'P-521'.
      JSONWebKey.Builder crv​(java.util.Optional<java.lang.String> crv)
      The curve for Elliptic Curve keys, e.g., 'P-256', 'P-384', or 'P-521'.
      JSONWebKey.Builder e​(java.lang.String e)
      The exponent value for RSA keys.
      JSONWebKey.Builder e​(java.util.Optional<java.lang.String> e)
      The exponent value for RSA keys.
      JSONWebKey.Builder keyOps​(java.util.List<java.lang.String> keyOps)
      The permitted operations for the key, e.g., 'sign', 'verify', 'encrypt', 'decrypt'.
      JSONWebKey.Builder keyOps​(java.util.Optional<? extends java.util.List<java.lang.String>> keyOps)
      The permitted operations for the key, e.g., 'sign', 'verify', 'encrypt', 'decrypt'.
      JSONWebKey.Builder kid​(java.lang.String kid)
      A unique identifier for the key.
      JSONWebKey.Builder kid​(java.util.Optional<java.lang.String> kid)
      A unique identifier for the key.
      JSONWebKey.Builder kty​(java.lang.String kty)
      The cryptographic algorithm family used with the key (e.g., 'RSA', 'EC', 'oct').
      JSONWebKey.Builder n​(java.lang.String n)
      The modulus value for RSA keys.
      JSONWebKey.Builder n​(java.util.Optional<java.lang.String> n)
      The modulus value for RSA keys.
      JSONWebKey.Builder use​(Use use)
      The intended use of the key.
      JSONWebKey.Builder use​(java.util.Optional<? extends Use> use)
      The intended use of the key.
      JSONWebKey.Builder x​(java.lang.String x)
      The x coordinate for Elliptic Curve keys.
      JSONWebKey.Builder x​(java.util.Optional<java.lang.String> x)
      The x coordinate for Elliptic Curve keys.
      JSONWebKey.Builder y​(java.lang.String y)
      The y coordinate for Elliptic Curve keys.
      JSONWebKey.Builder y​(java.util.Optional<java.lang.String> y)
      The y coordinate for Elliptic Curve keys.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • kty

        public JSONWebKey.Builder kty​(java.lang.String kty)
        The cryptographic algorithm family used with the key (e.g., 'RSA', 'EC', 'oct').
      • use

        public JSONWebKey.Builder use​(Use use)
        The intended use of the key. 'sig' for signature, 'enc' for encryption.
      • use

        public JSONWebKey.Builder use​(java.util.Optional<? extends Use> use)
        The intended use of the key. 'sig' for signature, 'enc' for encryption.
      • keyOps

        public JSONWebKey.Builder keyOps​(java.util.List<java.lang.String> keyOps)
        The permitted operations for the key, e.g., 'sign', 'verify', 'encrypt', 'decrypt'.
      • keyOps

        public JSONWebKey.Builder keyOps​(java.util.Optional<? extends java.util.List<java.lang.String>> keyOps)
        The permitted operations for the key, e.g., 'sign', 'verify', 'encrypt', 'decrypt'.
      • alg

        public JSONWebKey.Builder alg​(java.lang.String alg)
        The algorithm intended for use with the key, e.g., 'RS256' or 'ES256'.
      • alg

        public JSONWebKey.Builder alg​(java.util.Optional<java.lang.String> alg)
        The algorithm intended for use with the key, e.g., 'RS256' or 'ES256'.
      • kid

        public JSONWebKey.Builder kid​(java.lang.String kid)
        A unique identifier for the key.
      • kid

        public JSONWebKey.Builder kid​(java.util.Optional<java.lang.String> kid)
        A unique identifier for the key.
      • crv

        public JSONWebKey.Builder crv​(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'.

      • crv

        public JSONWebKey.Builder crv​(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 JSONWebKey.Builder x​(java.lang.String x)
        The x coordinate for Elliptic Curve keys.

        This field is required when `kty` is 'EC'.

      • x

        public JSONWebKey.Builder x​(java.util.Optional<java.lang.String> x)
        The x coordinate for Elliptic Curve keys.

        This field is required when `kty` is 'EC'.

      • y

        public JSONWebKey.Builder y​(java.lang.String y)
        The y coordinate for Elliptic Curve keys.

        This field is required when `kty` is 'EC'.

      • y

        public JSONWebKey.Builder y​(java.util.Optional<java.lang.String> y)
        The y coordinate for Elliptic Curve keys.

        This field is required when `kty` is 'EC'.

      • n

        public JSONWebKey.Builder n​(java.lang.String n)
        The modulus value for RSA keys.

        This field is required when `kty` is 'RSA'.

      • n

        public JSONWebKey.Builder n​(java.util.Optional<java.lang.String> n)
        The modulus value for RSA keys.

        This field is required when `kty` is 'RSA'.

      • e

        public JSONWebKey.Builder e​(java.lang.String e)
        The exponent value for RSA keys.

        This field is required when `kty` is 'RSA'.

      • e

        public JSONWebKey.Builder e​(java.util.Optional<java.lang.String> e)
        The exponent value for RSA keys.

        This field is required when `kty` is 'RSA'.