Interface JOSEProcessor<C extends SecurityContext>

  • All Known Subinterfaces:
    ConfigurableJOSEProcessor<C>
    All Known Implementing Classes:
    DefaultJOSEProcessor

    public interface JOSEProcessor<C extends SecurityContext>
    Interface for parsing and processing unsecured (plain), JWS and JWE objects. An optional context parameter is available to facilitate passing of additional data between the caller and the underlying JOSE processor (in both directions).
    Version:
    2015-08-20
    Author:
    Vladimir Dzhuvinov
    • Method Detail

      • process

        Payload process​(String compactEncodedJOSE,
                        C context)
                 throws ParseException,
                        BadJOSEException,
                        JOSEException
        Parses and processes the specified JOSE object (unsecured, JWS or JWE).
        Parameters:
        compactEncodedJOSE - The JOSE object, compact-encoded to a URL-safe string. Must not be null.
        context - Optional context, null if not required.
        Returns:
        The payload on success.
        Throws:
        ParseException - If the string couldn't be parsed to a valid JOSE object.
        BadJOSEException - If the JOSE object is rejected.
        JOSEException - If an internal processing exception is encountered.
      • process

        Payload process​(JOSEObject joseObject,
                        C context)
                 throws BadJOSEException,
                        JOSEException
        Processes the specified JOSE object (unsecured, JWS or JWE).
        Parameters:
        joseObject - The JOSE object. Must not be null.
        context - Optional context, null if not required.
        Returns:
        The payload on success.
        Throws:
        BadJOSEException - If the JOSE object is rejected.
        JOSEException - If an internal processing exception is encountered.
      • process

        Payload process​(PlainObject plainObject,
                        C context)
                 throws BadJOSEException,
                        JOSEException
        Processes the specified unsecured (plain) JOSE object, typically by checking its context.
        Parameters:
        plainObject - The unsecured (plain) JOSE object. Not null.
        context - Optional context, null if not required.
        Returns:
        The payload on success.
        Throws:
        BadJOSEException - If the unsecured (plain) JOSE object is rejected.
        JOSEException - If an internal processing exception is encountered.
      • process

        Payload process​(JWSObject jwsObject,
                        C context)
                 throws BadJOSEException,
                        JOSEException
        Processes the specified JWS object by verifying its signature. The key candidate(s) are selected by examining the JWS header and / or the message context.
        Parameters:
        jwsObject - The JWS object. Not null.
        context - Optional context, null if not required.
        Returns:
        The payload on success.
        Throws:
        BadJOSEException - If the JWS object is rejected, typically due to a bad signature.
        JOSEException - If an internal processing exception is encountered.
      • process

        Payload process​(JWEObject jweObject,
                        C context)
                 throws BadJOSEException,
                        JOSEException
        Processes the specified JWE object by decrypting it. The key candidate(s) are selected by examining the JWS header and / or the message context.
        Parameters:
        jweObject - The JWE object. Not null.
        context - Optional context of the JWE object, null if not required.
        Returns:
        The payload on success.
        Throws:
        BadJOSEException - If the JWE object is rejected, typically due to failed decryption.
        JOSEException - If an internal processing exception is encountered.