Class UnprotectedHeader


  • @Immutable
    public final class UnprotectedHeader
    extends Object
    JSON Web Signature (JWS) or JSON Web Encryption (JWE) unprotected header (in a JSON serialisation). This class is immutable.
    Version:
    2021-10-05
    Author:
    Alexander Martynov, Vladimir Dzhuvinov
    • Method Detail

      • getKeyID

        public String getKeyID()
        Gets the key ID (kid) parameter.
        Returns:
        The key ID parameter, null if not specified.
      • getParam

        public Object getParam​(String name)
        Gets a parameter.
        Parameters:
        name - The name of the parameter. Must not be null.
        Returns:
        The parameter, null if not specified.
      • getIncludedParams

        public Set<StringgetIncludedParams()
        Gets the names of the included parameters in this unprotected header.
        Returns:
        The included parameters.
      • toJSONObject

        public Map<String,​ObjecttoJSONObject()
        Returns a JSON object representation of this unprotected header.
        Returns:
        The JSON object, empty if no parameters are specified.
      • parse

        public static UnprotectedHeader parse​(Map<String,​Object> jsonObject)
                                       throws ParseException
        Parses an unprotected header from the specified JSON object.
        Parameters:
        jsonObject - The JSON object, null if not specified.
        Returns:
        The unprotected header or null.
        Throws:
        ParseException - If the JSON object couldn't be parsed to a valid unprotected header.