Top Description Fields Methods
io.netty.internal.tcnative

public Interface CertificateCompressionAlgo


Provides compression/decompression implementations for TLS Certificate Compression (RFC 8879).

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int

Method Summary

Modifier and TypeMethod and Description
public int
algorithmId()

Return the ID for the compression algorithm provided for by a given implementation.

public byte[]

Returns:

the compressed form of the certificate
compress
(long
the SSL instance
ssl
,
byte[]
the uncompressed form of the certificate
input
)

Compress the given input with the specified algorithm and return the compressed bytes.

public byte[]

Returns:

the decompressed form of the certificate
decompress
(long
the SSL instance
ssl
,
int
the expected length of the uncompressed certificate
uncompressedLen
,
byte[]
the compressed form of the certificate
input
)

Decompress the given input with the specified algorithm and return the decompressed bytes.

Field Detail

TLS_EXT_CERT_COMPRESSION_BROTLIback to summary
public static final int TLS_EXT_CERT_COMPRESSION_BROTLI
TLS_EXT_CERT_COMPRESSION_ZLIBback to summary
public static final int TLS_EXT_CERT_COMPRESSION_ZLIB
TLS_EXT_CERT_COMPRESSION_ZSTDback to summary
public static final int TLS_EXT_CERT_COMPRESSION_ZSTD

Method Detail

algorithmIdback to summary
public int algorithmId()

Return the ID for the compression algorithm provided for by a given implementation.

Returns:int

compression algorithm ID as specified by RFC8879

CertificateCompressionAlgo#TLS_EXT_CERT_COMPRESSION_ZLIB
CertificateCompressionAlgo#TLS_EXT_CERT_COMPRESSION_BROTLI
CertificateCompressionAlgo#TLS_EXT_CERT_COMPRESSION_ZSTD
compressback to summary
public byte[] compress(long ssl, byte[] input) throws Exception

Compress the given input with the specified algorithm and return the compressed bytes.

Parameters
ssl:long

the SSL instance

input:byte[]

the uncompressed form of the certificate

Returns:byte[]

the compressed form of the certificate

Exceptions
Exception:
thrown if an error occurs while compressing
decompressback to summary
public byte[] decompress(long ssl, int uncompressedLen, byte[] input) throws 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:long

the SSL instance

uncompressedLen:int

the expected length of the uncompressed certificate

input:byte[]

the compressed form of the certificate

Returns:byte[]

the decompressed form of the certificate

Exceptions
Exception:
thrown if an error occurs while decompressing or output size exceeds uncompressedLen