Package org.bouncycastle.tls
Class SimulatedTlsSRPIdentityManager
- java.lang.Object
-
- org.bouncycastle.tls.SimulatedTlsSRPIdentityManager
-
- All Implemented Interfaces:
TlsSRPIdentityManager
public class SimulatedTlsSRPIdentityManager extends java.lang.Object implements TlsSRPIdentityManager
An implementation ofTlsSRPIdentityManager
that simulates the existence of "unknown" identities to obscure the fact that there is no verifier for them.
-
-
Field Summary
Fields Modifier and Type Field Description protected SRP6Group
group
protected TlsMAC
mac
protected TlsSRP6VerifierGenerator
verifierGenerator
-
Constructor Summary
Constructors Constructor Description SimulatedTlsSRPIdentityManager(SRP6Group group, TlsSRP6VerifierGenerator verifierGenerator, TlsMAC mac)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TlsSRPLoginParameters
getLoginParameters(byte[] identity)
Lookup theTlsSRPLoginParameters
corresponding to the specified identity.static SimulatedTlsSRPIdentityManager
getRFC5054Default(TlsCrypto crypto, SRP6Group group, byte[] seedKey)
Create aSimulatedTlsSRPIdentityManager
that implements the algorithm from RFC 5054 2.5.1.3
-
-
-
Field Detail
-
group
protected SRP6Group group
-
verifierGenerator
protected TlsSRP6VerifierGenerator verifierGenerator
-
mac
protected TlsMAC mac
-
-
Constructor Detail
-
SimulatedTlsSRPIdentityManager
public SimulatedTlsSRPIdentityManager(SRP6Group group, TlsSRP6VerifierGenerator verifierGenerator, TlsMAC mac)
-
-
Method Detail
-
getRFC5054Default
public static SimulatedTlsSRPIdentityManager getRFC5054Default(TlsCrypto crypto, SRP6Group group, byte[] seedKey) throws java.io.IOException
Create aSimulatedTlsSRPIdentityManager
that implements the algorithm from RFC 5054 2.5.1.3- Parameters:
group
- theSRP6Group
defining the group that SRP is operating inseedKey
- the secret "seed key" referred to in RFC 5054 2.5.1.3- Returns:
- an instance of
SimulatedTlsSRPIdentityManager
- Throws:
java.io.IOException
-
getLoginParameters
public TlsSRPLoginParameters getLoginParameters(byte[] identity)
Description copied from interface:TlsSRPIdentityManager
Lookup theTlsSRPLoginParameters
corresponding to the specified identity. NOTE: To avoid "identity probing", unknown identities SHOULD be handled as recommended in RFC 5054 2.5.1.3.SimulatedTlsSRPIdentityManager
is provided for this purpose.- Specified by:
getLoginParameters
in interfaceTlsSRPIdentityManager
- Parameters:
identity
- the SRP identity sent by the connecting client- Returns:
- the
TlsSRPLoginParameters
for the specified identity, or else 'simulated' parameters if the identity is not recognized. A null value is also allowed, but not recommended.
-
-