Package org.forgerock.json.jose.jwe
Class CompressionManager
java.lang.Object
org.forgerock.json.jose.jwe.CompressionManager
A service to get the appropriate CompressionHandler for a specified Compression algorithm.
For details of all supported algorithms see CompressionAlgorithm
.
- Since:
- 2.0.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncompress
(CompressionAlgorithm compressionAlgorithm, String data) Convenience method equivalent toBase64url.encode(getCompressionHandler(compressionAlgorithm).compress(data.getBytes(Utils.CHARSET)))
.byte[]
decompress
(CompressionAlgorithm compressionAlgorithm, String data) Convenience method equivalent togetCompressionHandler(compressionAlgorithm).decompress(Base64url.decode(data))
.getCompressionHandler
(CompressionAlgorithm algorithm) Gets the appropriate CompressionHandler that can perform the required compression using the given compression algorithm.
-
Constructor Details
-
CompressionManager
public CompressionManager()
-
-
Method Details
-
getCompressionHandler
Gets the appropriate CompressionHandler that can perform the required compression using the given compression algorithm.- Parameters:
algorithm
- The Compression algorithm.- Returns:
- The CompressionHandler.
-
compress
Convenience method equivalent toBase64url.encode(getCompressionHandler(compressionAlgorithm).compress(data.getBytes(Utils.CHARSET)))
.- Parameters:
compressionAlgorithm
- the compression algorithm to use.data
- the data to compress.- Returns:
- the base64url-encoded compressed data.
-
decompress
Convenience method equivalent togetCompressionHandler(compressionAlgorithm).decompress(Base64url.decode(data))
.- Parameters:
compressionAlgorithm
- the compression algorithm to use.data
- the base64url-encoded data to decompress.- Returns:
- the decompressed data.
-