Class JOSEObjectJSON

    • Constructor Detail

      • JOSEObjectJSON

        protected JOSEObjectJSON​(Payload payload)
        Creates a new JOSE object with the specified payload.
        Parameters:
        payload - The payload, null if not available (e.g. for an encrypted JWE object).
    • Method Detail

      • setPayload

        protected void setPayload​(Payload payload)
        Sets the payload of this JOSE object.
        Parameters:
        payload - The payload, null if not available (e.g. for an encrypted JWE object).
      • getPayload

        public Payload getPayload()
        Returns the payload of this JOSE object.
        Returns:
        The payload, null if not available (for an encrypted JWE object that hasn't been decrypted).
      • parse

        public static JOSEObjectJSON parse​(Map<String,​Object> jsonObject)
                                    throws ParseException
        Parses a JOSE secured object from the specified JSON object representation.
        Parameters:
        jsonObject - The JSON object to parse. Must not be null.
        Returns:
        The corresponding JWSObjectJSON.
        Throws:
        ParseException - If the JSON object couldn't be parsed to a valid JWS or JWE secured object.
      • parse

        public static JOSEObjectJSON parse​(String json)
                                    throws ParseException
        Parses a JOSE secured object from the specified JSON string.
        Parameters:
        json - The JSON string to parse. Must not be null.
        Returns:
        The corresponding JWSObjectJSON.
        Throws:
        ParseException - If the string couldn't be parsed to a valid JWS or JWE secured object.