Class ZlibCertificateCompressionAlgorithm

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int algorithmId()
      Return the ID for the compression algorithm provided for by a given implementation.
      byte[] compress​(javax.net.ssl.SSLEngine engine, byte[] uncompressedCertificate)
      Compress the given input with the specified algorithm and return the compressed bytes.
      byte[] decompress​(javax.net.ssl.SSLEngine engine, int uncompressedLen, byte[] compressedCertificate)
      Decompress the given input with the specified algorithm and return the decompressed bytes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ZlibCertificateCompressionAlgorithm

        private ZlibCertificateCompressionAlgorithm()
    • Method Detail

      • compress

        public byte[] compress​(javax.net.ssl.SSLEngine engine,
                               byte[] uncompressedCertificate)
        Description copied from interface: OpenSslCertificateCompressionAlgorithm
        Compress the given input with the specified algorithm and return the compressed bytes.
        Specified by:
        compress in interface OpenSslCertificateCompressionAlgorithm
        Parameters:
        engine - the SSLEngine
        uncompressedCertificate - the uncompressed certificate
        Returns:
        the compressed form of the certificate
      • decompress

        public byte[] decompress​(javax.net.ssl.SSLEngine engine,
                                 int uncompressedLen,
                                 byte[] compressedCertificate)
                          throws java.util.zip.DataFormatException
        Description copied from interface: OpenSslCertificateCompressionAlgorithm
        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.

        Specified by:
        decompress in interface OpenSslCertificateCompressionAlgorithm
        Parameters:
        engine - the SSLEngine
        uncompressedLen - the expected length of the decompressed certificate that will be returned.
        compressedCertificate - the compressed form of the certificate
        Returns:
        the decompressed form of the certificate
        Throws:
        java.util.zip.DataFormatException