Class SRP6Util
java.lang.Object
org.bouncycastle.crypto.agreement.srp.SRP6Util
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BigIntegercalculateK(Digest digest, BigInteger N, BigInteger g) static BigIntegercalculateKey(Digest digest, BigInteger N, BigInteger S) Computes the final Key according to the standard routine: Key = H(S)static BigIntegercalculateM1(Digest digest, BigInteger N, BigInteger A, BigInteger B, BigInteger S) Computes the client evidence message (M1) according to the standard routine: M1 = H( A | B | S )static BigIntegercalculateM2(Digest digest, BigInteger N, BigInteger A, BigInteger M1, BigInteger S) Computes the server evidence message (M2) according to the standard routine: M2 = H( A | M1 | S )static BigIntegercalculateU(Digest digest, BigInteger N, BigInteger A, BigInteger B) static BigIntegercalculateX(Digest digest, BigInteger N, byte[] salt, byte[] identity, byte[] password) static BigIntegergeneratePrivateValue(Digest digest, BigInteger N, BigInteger g, SecureRandom random) static BigIntegervalidatePublicValue(BigInteger N, BigInteger val)
-
Constructor Details
-
SRP6Util
public SRP6Util()
-
-
Method Details
-
calculateK
-
calculateU
-
calculateX
public static BigInteger calculateX(Digest digest, BigInteger N, byte[] salt, byte[] identity, byte[] password) -
generatePrivateValue
public static BigInteger generatePrivateValue(Digest digest, BigInteger N, BigInteger g, SecureRandom random) -
validatePublicValue
- Throws:
CryptoException
-
calculateM1
public static BigInteger calculateM1(Digest digest, BigInteger N, BigInteger A, BigInteger B, BigInteger S) Computes the client evidence message (M1) according to the standard routine: M1 = H( A | B | S )- Parameters:
digest- The Digest used as the hashing function HN- Modulus used to get the pad lengthA- The public client valueB- The public server valueS- The secret calculated by both sides- Returns:
- M1 The calculated client evidence message
-
calculateM2
public static BigInteger calculateM2(Digest digest, BigInteger N, BigInteger A, BigInteger M1, BigInteger S) Computes the server evidence message (M2) according to the standard routine: M2 = H( A | M1 | S )- Parameters:
digest- The Digest used as the hashing function HN- Modulus used to get the pad lengthA- The public client valueM1- The client evidence messageS- The secret calculated by both sides- Returns:
- M2 The calculated server evidence message
-
calculateKey
Computes the final Key according to the standard routine: Key = H(S)- Parameters:
digest- The Digest used as the hashing function HN- Modulus used to get the pad lengthS- The secret calculated by both sides- Returns:
- the final Key value.
-