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 impersonator Show documentation
Show all versions of impersonator Show documentation
Spoof TLS/JA3/JA4 and HTTP/2 fingerprints in Java
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();
}
}