Class JWSBase

java.lang.Object
de.christofreichardt.json.websignature.JWSBase
Direct Known Subclasses:
JWSSigner, JWSValidator

public abstract class JWSBase extends Object
This class provides some core functionality related to creating and validating signatures.
Author:
Christof Reichardt
  • Method Details

    • encode

      public static String encode(String input)
      Encodes the given input by first taking its UTF-8 encoded bytes and next using the base64-url-encoding scheme.
      Parameters:
      input - the to be encoded String
      Returns:
      the resulting base64-url-encoded String
    • encode

      public static String encode(byte[] input)
      Encodes the given input using the base64-url-encoding scheme.
      Parameters:
      input - the to be encoded bytes
      Returns:
      the resulting base64-url-encoded String
    • decodeToBytes

      public static byte[] decodeToBytes(String input)
      Decodes a Base64-URL-encoded string into bytes.
      Parameters:
      input - the Base64-URL-encoded string
      Returns:
      the decoded bytes
    • getStrJoseHeader

      public String getStrJoseHeader()
      Returns the string representation of the JOSE header. The raw bytes used for creating the signature will be derived from this string.
      Returns:
      the string representation of the JOSE header.
    • getJoseHeader

      public jakarta.json.JsonObject getJoseHeader()
      Returns the JOSE Header as JsonObject.
      Returns:
      the JOSE Header as JsonObject.
    • getStrPayload

      public String getStrPayload()
      Returns the string representation of the actual payload. The raw bytes used for creating the signature will be derived from this string.
      Returns:
      the string representation of the actual payload.
    • getPayload

      public jakarta.json.JsonStructure getPayload()
      Returns the payload as JsonObject.
      Returns:
      the payload as JsonObject.