org.bouncycastle.tls.crypto.impl.bc.BcTlsSRP6Client 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
The newest version!
package org.bouncycastle.tls.crypto.impl.bc;
import java.math.BigInteger;
import org.bouncycastle.crypto.CryptoException;
import org.bouncycastle.crypto.agreement.srp.SRP6Client;
import org.bouncycastle.tls.AlertDescription;
import org.bouncycastle.tls.TlsFatalAlert;
import org.bouncycastle.tls.crypto.TlsSRP6Client;
final class BcTlsSRP6Client
implements TlsSRP6Client
{
private final SRP6Client srp6Client;
BcTlsSRP6Client(SRP6Client srpClient)
{
this.srp6Client = srpClient;
}
public BigInteger calculateSecret(BigInteger serverB)
throws TlsFatalAlert
{
try
{
return srp6Client.calculateSecret(serverB);
}
catch (CryptoException e)
{
throw new TlsFatalAlert(AlertDescription.illegal_parameter, e);
}
}
public BigInteger generateClientCredentials(byte[] srpSalt, byte[] identity, byte[] password)
{
return srp6Client.generateClientCredentials(srpSalt, identity, password);
}
}