Package io.netty.internal.tcnative
Interface CertificateCompressionAlgo
public interface CertificateCompressionAlgo
Provides compression/decompression implementations for TLS Certificate Compression
(RFC 8879).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionint
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.
-
Field Details
-
TLS_EXT_CERT_COMPRESSION_ZLIB
static final int TLS_EXT_CERT_COMPRESSION_ZLIB -
TLS_EXT_CERT_COMPRESSION_BROTLI
static final int TLS_EXT_CERT_COMPRESSION_BROTLI -
TLS_EXT_CERT_COMPRESSION_ZSTD
static final int TLS_EXT_CERT_COMPRESSION_ZSTD
-
-
Method Details
-
compress
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:
Exception
- thrown if an error occurs while compressing
-
decompress
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:
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
-