public class

SRP6Server

extends Object
java.lang.Object
   ↳ org.bouncycastle.crypto.agreement.srp.SRP6Server

Class Overview

Implements the server side SRP-6a protocol. Note that this class is stateful, and therefore NOT threadsafe. This implementation of SRP is based on the optimized message sequence put forth by Thomas Wu in the paper "SRP-6: Improvements and Refinements to the Secure Remote Password Protocol, 2002"

Summary

Fields
protected BigInteger A
protected BigInteger B
protected BigInteger N
protected BigInteger S
protected BigInteger b
protected Digest digest
protected BigInteger g
protected SecureRandom random
protected BigInteger u
protected BigInteger v
Public Constructors
SRP6Server()
Public Methods
BigInteger calculateSecret(BigInteger clientA)
Processes the client's credentials.
BigInteger generateServerCredentials()
Generates the server's credentials that are to be sent to the client.
void init(BigInteger N, BigInteger g, BigInteger v, Digest digest, SecureRandom random)
Initialises the server to accept a new client authentication attempt
Protected Methods
BigInteger selectPrivateValue()
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected BigInteger A

protected BigInteger B

protected BigInteger N

protected BigInteger S

protected BigInteger b

protected Digest digest

protected BigInteger g

protected SecureRandom random

protected BigInteger u

protected BigInteger v

Public Constructors

public SRP6Server ()

Public Methods

public BigInteger calculateSecret (BigInteger clientA)

Processes the client's credentials. If valid the shared secret is generated and returned.

Parameters
clientA The client's credentials
Returns
  • A shared secret BigInteger
Throws
CryptoException If client's credentials are invalid

public BigInteger generateServerCredentials ()

Generates the server's credentials that are to be sent to the client.

Returns
  • The server's public value to the client

public void init (BigInteger N, BigInteger g, BigInteger v, Digest digest, SecureRandom random)

Initialises the server to accept a new client authentication attempt

Parameters
N The safe prime associated with the client's verifier
g The group parameter associated with the client's verifier
v The client's verifier
digest The digest algorithm associated with the client's verifier
random For key generation

Protected Methods

protected BigInteger selectPrivateValue ()