Package com.nimbusds.jose.crypto.impl
Class DeflateHelper
- java.lang.Object
-
- com.nimbusds.jose.crypto.impl.DeflateHelper
-
@ThreadSafe public class DeflateHelper extends Object
Deflate (RFC 1951) helper methods, intended for use by JWE encrypters and decrypters. This class is thread-safe.- Version:
- 2014-07-08
- Author:
- Vladimir Dzhuvinov
-
-
Constructor Summary
Constructors Constructor Description DeflateHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
applyCompression(JWEHeader jweHeader, byte[] bytes)
Applies compression to the specified plain text if requested.static byte[]
applyDecompression(JWEHeader jweHeader, byte[] bytes)
Applies decompression to the specified plain text if requested.
-
-
-
Constructor Detail
-
DeflateHelper
public DeflateHelper()
-
-
Method Detail
-
applyCompression
public static byte[] applyCompression(JWEHeader jweHeader, byte[] bytes) throws JOSEException
Applies compression to the specified plain text if requested.- Parameters:
jweHeader
- The JWE header. Must not benull
.bytes
- The plain text bytes. Must not benull
.- Returns:
- The bytes to encrypt.
- Throws:
JOSEException
- If compression failed or the requested compression algorithm is not supported.
-
applyDecompression
public static byte[] applyDecompression(JWEHeader jweHeader, byte[] bytes) throws JOSEException
Applies decompression to the specified plain text if requested.- Parameters:
jweHeader
- The JWE header. Must not benull
.bytes
- The plain text bytes. Must not benull
.- Returns:
- The output bytes, decompressed if requested.
- Throws:
JOSEException
- If decompression failed or the requested compression algorithm is not supported.
-
-