Class OctJWK


  • public class OctJWK
    extends JWK
    Creates an Octet JWK.
    • Constructor Detail

      • OctJWK

        @Deprecated
        public OctJWK​(String use,
                      String alg,
                      String kid,
                      String key,
                      String x5u,
                      String x5t,
                      List<String> x5c)
        Deprecated.
        Use the builder instead.
        Constructs a OctJWK.
        Parameters:
        use - the JWK use
        alg - the JWK algorithm
        kid - the JWK key id
        key - the symmetric key
        x5u - the x509 url for the key
        x5t - the x509 thumbnail for the key
        x5c - the x509 chain as a list of Base64 encoded strings
    • Method Detail

      • builder

        public static OctJWK.Builder builder​(String key)
        Get the Octet JWK builder.
        Parameters:
        key - the symmetric key
        Returns:
        the builder
      • getKey

        public String getKey()
        Gets the symmetric key.
        Returns:
        the symmetric key that is Base64url encoded
      • toSecretKey

        public SecretKey toSecretKey()
        Returns the key as a secret key.
        Returns:
        the secret key bytes.
      • parse

        public static OctJWK parse​(String json)
        Parses a OctJWK object from a string json object.
        Parameters:
        json - string json object
        Returns:
        a OctJWK
      • parse

        public static OctJWK parse​(JsonValue json)
        Parses a OctJWK object from a jsonValue object.
        Parameters:
        json - an JsonValue object
        Returns:
        a OctJWK
      • toJsonValue

        public JsonValue toJsonValue()
        Description copied from class: JWK
        Returns a json representation of the JWK.
        Overrides:
        toJsonValue in class JWK
        Returns:
        A JSON representation.
      • isPrivate

        public boolean isPrivate()
        Description copied from class: JWK
        Indicates if any private key attributes are present in the JWK.
        Overrides:
        isPrivate in class JWK
        Returns:
        true if this JWK contains any private key attributes.
      • getPublicJwkBuilder

        protected Optional<JWK.Builder<?>> getPublicJwkBuilder()
        Description copied from class: JWK
        Return a builder with all the values set for representing the public components of the JWK. Common JWK attributes will be added in JWK.toPublicJwk().
        Specified by:
        getPublicJwkBuilder in class JWK
        Returns:
        The builder.