Interface CertificateCompressionAlgo


  • public interface CertificateCompressionAlgo
    Provides compression/decompression implementations for TLS Certificate Compression (RFC 8879).
    • Field Detail

      • 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 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 instance
        input - 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 instance
        uncompressedLen - the expected length of the uncompressed certificate
        input - 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 exceeds uncompressedLen