org.bouncycastle.jsse.provider.ProvSSLSessionResumed Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bctls-lts8on Show documentation
Show all versions of bctls-lts8on Show documentation
The Bouncy Castle Java APIs for the TLS, including a JSSE provider. The APIs are designed primarily to be used in conjunction with the BC LTS provider but may also be used with other providers providing cryptographic services.
package org.bouncycastle.jsse.provider;
import org.bouncycastle.tls.ProtocolVersion;
import org.bouncycastle.tls.SecurityParameters;
import org.bouncycastle.tls.SessionParameters;
import org.bouncycastle.tls.TlsSession;
class ProvSSLSessionResumed
extends ProvSSLSessionHandshake
{
protected final TlsSession tlsSession;
protected final SessionParameters sessionParameters;
protected final JsseSessionParameters jsseSessionParameters;
ProvSSLSessionResumed(ProvSSLSessionContext sslSessionContext, String peerHost, int peerPort,
SecurityParameters securityParameters, JsseSecurityParameters jsseSecurityParameters, TlsSession tlsSession,
JsseSessionParameters jsseSessionParameters)
{
super(sslSessionContext, peerHost, peerPort, securityParameters, jsseSecurityParameters);
this.tlsSession = tlsSession;
this.sessionParameters = tlsSession.exportSessionParameters();
this.jsseSessionParameters = jsseSessionParameters;
}
@Override
protected int getCipherSuiteTLS()
{
return sessionParameters.getCipherSuite();
}
@Override
protected byte[] getIDArray()
{
return tlsSession.getSessionID();
}
@Override
protected JsseSessionParameters getJsseSessionParameters()
{
return jsseSessionParameters;
}
@Override
protected org.bouncycastle.tls.Certificate getLocalCertificateTLS()
{
return sessionParameters.getLocalCertificate();
}
@Override
protected org.bouncycastle.tls.Certificate getPeerCertificateTLS()
{
return sessionParameters.getPeerCertificate();
}
@Override
protected ProtocolVersion getProtocolTLS()
{
return sessionParameters.getNegotiatedVersion();
}
@Override
protected void invalidateTLS()
{
tlsSession.invalidate();
}
public boolean isValid()
{
return super.isValid() && tlsSession.isResumable();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy