Class PlainObject

    • Constructor Detail

      • PlainObject

        public PlainObject​(Payload payload)
        Creates a new unsecured JOSE object with a default PlainHeader and the specified payload.
        Parameters:
        payload - The payload. Must not be null.
      • PlainObject

        public PlainObject​(PlainHeader header,
                           Payload payload)
        Creates a new unsecured JOSE object with the specified header and payload.
        Parameters:
        header - The unsecured header. Must not be null.
        payload - The payload. Must not be null.
      • PlainObject

        public PlainObject​(Base64URL firstPart,
                           Base64URL secondPart)
                    throws ParseException
        Creates a new unsecured JOSE object with the specified Base64URL-encoded parts.
        Parameters:
        firstPart - The first part, corresponding to the unsecured header. Must not be null.
        secondPart - The second part, corresponding to the payload. Must not be null.
        Throws:
        ParseException - If parsing of the serialised parts failed.
    • Method Detail

      • serialize

        public String serialize()
        Serialises this unsecured JOSE object to its compact format consisting of Base64URL-encoded parts delimited by period ('.') characters.
         [header-base64url].[payload-base64url].[]
         
        Specified by:
        serialize in class JOSEObject
        Returns:
        The serialised unsecured JOSE object.
      • parse

        public static PlainObject parse​(String s)
                                 throws ParseException
        Parses an unsecured JOSE object from the specified string in compact format.
        Parameters:
        s - The string to parse. Must not be null.
        Returns:
        The unsecured JOSE object.
        Throws:
        ParseException - If the string couldn't be parsed to a valid unsecured JOSE object.