Package io.netty.internal.tcnative
Interface CertificateCompressionAlgo
-
public interface CertificateCompressionAlgo
Provides compression/decompression implementations for TLS Certificate Compression (RFC 8879).
-
-
Field Summary
Fields Modifier and Type Field Description static int
TLS_EXT_CERT_COMPRESSION_BROTLI
static int
TLS_EXT_CERT_COMPRESSION_ZLIB
static int
TLS_EXT_CERT_COMPRESSION_ZSTD
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
algorithmId()
Return the ID for the compression algorithm provided for by a given implementation.byte[]
compress(long ssl, byte[] input)
Compress the given input with the specified algorithm and return the compressed bytes.byte[]
decompress(long ssl, int uncompressedLen, byte[] input)
Decompress the given input with the specified algorithm and return the decompressed bytes.
-
-
-
Method Detail
-
compress
byte[] compress(long ssl, byte[] input) throws java.lang.Exception
Compress the given input with the specified algorithm and return the compressed bytes.- Parameters:
ssl
- the SSL instanceinput
- the uncompressed form of the certificate- Returns:
- the compressed form of the certificate
- Throws:
java.lang.Exception
- thrown if an error occurs while compressing
-
decompress
byte[] decompress(long ssl, int uncompressedLen, byte[] input) throws java.lang.Exception
Decompress the given input with the specified algorithm and return the decompressed bytes.Implementation Security Considerations
Implementations SHOULD bound the memory usage when decompressing the CompressedCertificate message.
Implementations MUST limit the size of the resulting decompressed chain to the specified
uncompressedLen
, and they MUST abort the connection (throw an exception) if the size of the output of the decompression function exceeds that limit.- Parameters:
ssl
- the SSL instanceuncompressedLen
- the expected length of the uncompressed certificateinput
- the compressed form of the certificate- Returns:
- the decompressed form of the certificate
- Throws:
java.lang.Exception
- thrown if an error occurs while decompressing or output size exceedsuncompressedLen
-
algorithmId
int algorithmId()
Return the ID for the compression algorithm provided for by a given implementation.- Returns:
- compression algorithm ID as specified by RFC8879
TLS_EXT_CERT_COMPRESSION_ZLIB
TLS_EXT_CERT_COMPRESSION_BROTLI
TLS_EXT_CERT_COMPRESSION_ZSTD
-
-