public interface JWEZip

A JWE zip implements a JWE compression algorithm used to compress or decompress a JWE object payload based on the compression algorithm JWE JOSE header parameter.

Since:
1.5
Author:
Jeremy Kuhn
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    DEFLATE ZIP algorithm as defined by RFC7516 Section 4.1.3.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    compress(byte[] data)
    Compresses the specified data.
    byte[]
    decompress(byte[] data)
    Decompresses the specified data.
    boolean
    Determines whether the JWE zip supports the specified compression algorithm.
  • Field Details

  • Method Details

    • supports

      boolean supports(String zip)

      Determines whether the JWE zip supports the specified compression algorithm.

      Parameters:
      zip - a compression algorithm
      Returns:
      true if the JWE zip supports the compression algorithm, false otherwise
    • compress

      byte[] compress(byte[] data) throws JWEZipException

      Compresses the specified data.

      Parameters:
      data - the data to compress
      Returns:
      compressed data
      Throws:
      JWEZipException - if these was an error compressing the data
    • decompress

      byte[] decompress(byte[] data) throws JWEZipException

      Decompresses the specified data.

      Parameters:
      data - the data to decompress
      Returns:
      decompressed data
      Throws:
      JWEZipException - if these was an error decompressing the data