Package org.bouncycastle.tls
Class SimulatedTlsSRPIdentityManager
java.lang.Object
org.bouncycastle.tls.SimulatedTlsSRPIdentityManager
- All Implemented Interfaces:
TlsSRPIdentityManager
An implementation of
TlsSRPIdentityManager that simulates the existence of "unknown" identities
to obscure the fact that there is no verifier for them.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SRP6Groupprotected TlsMACprotected TlsSRP6VerifierGenerator -
Constructor Summary
ConstructorsConstructorDescriptionSimulatedTlsSRPIdentityManager(SRP6Group group, TlsSRP6VerifierGenerator verifierGenerator, TlsMAC mac) -
Method Summary
Modifier and TypeMethodDescriptiongetLoginParameters(byte[] identity) Lookup theTlsSRPLoginParameterscorresponding to the specified identity.getRFC5054Default(TlsCrypto crypto, SRP6Group group, byte[] seedKey) Create aSimulatedTlsSRPIdentityManagerthat implements the algorithm from RFC 5054 2.5.1.3
-
Field Details
-
group
-
verifierGenerator
-
mac
-
-
Constructor Details
-
SimulatedTlsSRPIdentityManager
public SimulatedTlsSRPIdentityManager(SRP6Group group, TlsSRP6VerifierGenerator verifierGenerator, TlsMAC mac)
-
-
Method Details
-
getRFC5054Default
public static SimulatedTlsSRPIdentityManager getRFC5054Default(TlsCrypto crypto, SRP6Group group, byte[] seedKey) throws IOException Create aSimulatedTlsSRPIdentityManagerthat implements the algorithm from RFC 5054 2.5.1.3- Parameters:
group- theSRP6Groupdefining 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:
IOException
-
getLoginParameters
Description copied from interface:TlsSRPIdentityManagerLookup theTlsSRPLoginParameterscorresponding to the specified identity. NOTE: To avoid "identity probing", unknown identities SHOULD be handled as recommended in RFC 5054 2.5.1.3.SimulatedTlsSRPIdentityManageris provided for this purpose.- Specified by:
getLoginParametersin interfaceTlsSRPIdentityManager- Parameters:
identity- the SRP identity sent by the connecting client- Returns:
- the
TlsSRPLoginParametersfor the specified identity, or else 'simulated' parameters if the identity is not recognized. A null value is also allowed, but not recommended.
-