接口 CertificateCompressionAlgo
-
public interface CertificateCompressionAlgoProvides compression/decompression implementations for TLS Certificate Compression (RFC 8879).
-
-
字段概要
字段 修饰符和类型 字段 说明 static intTLS_EXT_CERT_COMPRESSION_BROTLIstatic intTLS_EXT_CERT_COMPRESSION_ZLIBstatic intTLS_EXT_CERT_COMPRESSION_ZSTD
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 intalgorithmId()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.
-
-
-
方法详细资料
-
compress
byte[] compress(long ssl, byte[] input) throws ExceptionCompress the given input with the specified algorithm and return the compressed bytes.- 参数:
ssl- the SSL instanceinput- the uncompressed form of the certificate- 返回:
- the compressed form of the certificate
- 抛出:
Exception- thrown if an error occurs while compressing
-
decompress
byte[] decompress(long ssl, int uncompressedLen, byte[] input) throws ExceptionDecompress 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.- 参数:
ssl- the SSL instanceuncompressedLen- the expected length of the uncompressed certificateinput- the compressed form of the certificate- 返回:
- the decompressed form of the certificate
- 抛出:
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.- 返回:
- compression algorithm ID as specified by RFC8879
TLS_EXT_CERT_COMPRESSION_ZLIBTLS_EXT_CERT_COMPRESSION_BROTLITLS_EXT_CERT_COMPRESSION_ZSTD
-
-