Calculates the minimum bytes required in the encrypted output buffer for the given number of plaintext source bytes.
Decodes the given list of protocols into {@link string}s. @param protocols the encoded protocol list @return the decoded protocols or {@link EmptyArray#BYTE} if {@code protocols} is empty. @throws NullPointerException if protocols is {@code null}.
Encodes a list of protocols into the wire-format (length-prefixed 8-bit strings). Requires that all strings be encoded with US-ASCII.
Return how much bytes can be read out of the encrypted data. Be aware that this method will not increase the readerIndex of the given {@link ByteBuffer}.
Returns key type constant suitable for calling X509KeyManager.chooseServerAlias or X509ExtendedKeyManager.chooseEngineServerAlias. Returns {@code null} for key exchanges that do not use X.509 for server authentication.
Wraps the given exception if it's not already a {@link SSLException}.
Wraps the given exception if it's not already a {@link SSLHandshakeException}.
Utility methods for SSL packet processing. Copied from the Netty project. <p> This is a public class to allow testing to occur on Android via CTS.