Interface JOSEHeaderConfigurator<A extends JOSEHeaderConfigurator<A>>

Type Parameters:
A - the JOSE header configurator type
All Known Subinterfaces:
JWEHeaderConfigurator<A>, JWSHeaderConfigurator<A>

public interface JOSEHeaderConfigurator<A extends JOSEHeaderConfigurator<A>>

A JOSE header configurator is used in JOSEObjectBuilder or JsonJOSEObjectBuilder to configure JOSE headers when building JOSE objects.

Since:
1.5
Author:
Jeremy Kuhn
  • Method Summary

    Modifier and Type
    Method
    Description
    Specifies a custom parameter to add to the header.
    specifies the cryptographic algorithm to use to secure the JOSE object.
    Specifies the media type of the JOSE object payload.
    critical(String... crit)
    Specifies the set of custom parameters that must be understood and processed.
    Specifies the JWK to use to secure the JOSE object.
    Specifies the JWK Set URL that contains the key to use to secure the JOSE object.
    Specifies the id of the key to use to secure the JOSE object.
    type(String typ)
    Specifies the media type of the complete JOSE object.
    Specifies the X.509 certificates chain that corresponds to the key to use to secure the JOSE object.
    Specifies the X.509 SHA1 thumbprint of the certificate that corresponds to the key to use to secure the JOSE object.
    Specifies the X.509 SHA256 thumbprint of the certificate that corresponds to the key to use to secure the JOSE object.
    Specifies the URL of the X.509 certificate or certificates chain that corresponds to the key to use to secure the JOSE object.
  • Method Details

    • algorithm

      A algorithm(String alg)

      specifies the cryptographic algorithm to use to secure the JOSE object.

      Depending on the type of JOSE object to build, it might designate a signature or a key management algorithm.

      Parameters:
      alg - a JWA algorithm
      Returns:
      this builder
    • jwkSetURL

      A jwkSetURL(URI jku)

      Specifies the JWK Set URL that contains the key to use to secure the JOSE object.

      The URL must points to a set of JSON-encoded public keys.

      Parameters:
      jku - the JWK Set URL
      Returns:
      this builder
    • jwk

      A jwk(Map<String,Object> jwk)

      Specifies the JWK to use to secure the JOSE object.

      It is represented as a map to comply with the JOSE object definition, the builder eventually tries to resolve an actual JWK based on these parameters.

      Parameters:
      jwk - a JWK as a map
      Returns:
      this builder
    • keyId

      A keyId(String kid)

      Specifies the id of the key to use to secure the JOSE object.

      Parameters:
      kid - a key id
      Returns:
      this builder
    • x509CertificateURL

      A x509CertificateURL(URI x5u)

      Specifies the URL of the X.509 certificate or certificates chain that corresponds to the key to use to secure the JOSE object.

      The certificates chain located at the URL must be in PEM format. The first certificate in the chain must correspond to the key to use to secure the JOSE object.

      Parameters:
      x5u - a URL
      Returns:
      this builder
    • x509CertificateChain

      A x509CertificateChain(String[] x5c)

      Specifies the X.509 certificates chain that corresponds to the key to use to secure the JOSE object.

      The certificates chain must be represented as an array of Base64URL encoded DER PKIX certificates. The first certificate in the chain must correspond to the key to use to secure the JOSE object.

      Parameters:
      x5c - a certificates chain
      Returns:
      this builder
    • x509CertificateSHA1Thumbprint

      A x509CertificateSHA1Thumbprint(String x5t)

      Specifies the X.509 SHA1 thumbprint of the certificate that corresponds to the key to use to secure the JOSE object.

      Parameters:
      x5t - an X.509 SHA1 thumbprint
      Returns:
      this builder
    • x509CertificateSHA256Thumbprint

      A x509CertificateSHA256Thumbprint(String x5t_S256)

      Specifies the X.509 SHA256 thumbprint of the certificate that corresponds to the key to use to secure the JOSE object.

      Parameters:
      x5t_S256 - an X.509 SHA256 thumbprint
      Returns:
      this builder
    • type

      A type(String typ)

      Specifies the media type of the complete JOSE object.

      To keep messages compact in common situations, the application/ prefix of a media type can be omitted when no other / appears in the value.

      Parameters:
      typ - a media type
      Returns:
      this builder
    • contentType

      A contentType(String cty)

      Specifies the media type of the JOSE object payload.

      To keep messages compact in common situations, the application/ prefix of a media type can be omitted when no other / appears in the value.

      The builder might use this media type to determine how to serialize/deserialize a JOSE object payload.

      Parameters:
      cty - a media type
      Returns:
      this builder
    • critical

      A critical(String... crit)

      Specifies the set of custom parameters that must be understood and processed.

      Critical parameters can not be registered JOSE header parameters and they must be present in header's custom parameters.

      Parameters:
      crit - a set of custom parameters
      Returns:
      this builder
    • addCustomParameter

      A addCustomParameter(String key, Object value)

      Specifies a custom parameter to add to the header.

      Parameters:
      key - the custom parameter name
      value - the custom parameter value
      Returns:
      this builder