Example usage for javax.net.ssl SSLSession getApplicationBufferSize

List of usage examples for javax.net.ssl SSLSession getApplicationBufferSize

Introduction

In this page you can find the example usage for javax.net.ssl SSLSession getApplicationBufferSize.

Prototype

public int getApplicationBufferSize();

Source Link

Document

Gets the current size of the largest application data that is expected when using this session.

Usage

From source file:org.apache.hc.client5.http.impl.auth.CredSspScheme.java

private ByteBuffer allocateOutBuffer() {
    final SSLEngine sslEngine = getSSLEngine();
    final SSLSession sslSession = sslEngine.getSession();
    return ByteBuffer.allocate(sslSession.getApplicationBufferSize());
}

From source file:org.apache.hc.client5.http.impl.auth.CredSspScheme.java

private void unwrapHandshake(final String inputString) throws MalformedChallengeException {
    final SSLEngine sslEngine = getSSLEngine();
    final SSLSession sslSession = sslEngine.getSession();
    final ByteBuffer src = decodeBase64(inputString);
    final ByteBuffer dst = ByteBuffer.allocate(sslSession.getApplicationBufferSize());
    while (sslEngine.getHandshakeStatus() == HandshakeStatus.NEED_UNWRAP) {
        unwrap(src, dst);//from  www .j  a v a 2s .c o  m
    }
}

From source file:org.apache.hc.client5.http.impl.auth.CredSspScheme.java

private ByteBuffer unwrap(final String inputString) throws MalformedChallengeException {
    final SSLEngine sslEngine = getSSLEngine();
    final SSLSession sslSession = sslEngine.getSession();
    final ByteBuffer src = decodeBase64(inputString);
    final ByteBuffer dst = ByteBuffer.allocate(sslSession.getApplicationBufferSize());
    unwrap(src, dst);//from w  ww . ja v a 2 s  .co  m
    dst.flip();
    return dst;
}