Class JOSEHeader.PublicKeyBuilder

java.lang.Object
de.christofreichardt.json.websignature.JOSEHeader.PublicKeyBuilder
All Implemented Interfaces:
de.christofreichardt.diagnosis.Traceable
Enclosing class:
JOSEHeader

public static final class JOSEHeader.PublicKeyBuilder extends Object implements de.christofreichardt.diagnosis.Traceable
A builder for a JOSEHeader preconfigured with a JSON web (public) key.
Author:
Christof Reichardt
  • Constructor Details

    • PublicKeyBuilder

      public PublicKeyBuilder(JsonWebPublicKey jsonWebPublicKey)
      Creates the builder preconfigured with the given JsonWebPublicKey.
      Parameters:
      jsonWebPublicKey - the requested JsonWebPublicKey.
  • Method Details

    • withKid

      public JOSEHeader.PublicKeyBuilder withKid(String kid)
      Augments the builder instance with the "kid" parameter.
      Parameters:
      kid - denotes the key ID.
      Returns:
      this PublicKeyBuilder instance.
      See Also:
    • withTyp

      public JOSEHeader.PublicKeyBuilder withTyp(String typ)
      Augments the builder instance with the "typ" parameter.
      Parameters:
      typ - denotes the (media) type
      Returns:
      this PublicKeyBuilder instance
      See Also:
    • build

      public JOSEHeader build()
      Builds the JOSEHeader instance with the configured parameters.
      Returns:
      the appropriately configured JOSEHeader instance
    • getCurrentTracer

      public de.christofreichardt.diagnosis.AbstractTracer getCurrentTracer()
      Specified by:
      getCurrentTracer in interface de.christofreichardt.diagnosis.Traceable