Class SRP6Util
- java.lang.Object
-
- org.bouncycastle.crypto.agreement.srp.SRP6Util
-
public class SRP6Util extends Object
-
-
Constructor Summary
Constructors Constructor Description SRP6Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BigInteger
calculateK(Digest digest, BigInteger N, BigInteger g)
static BigInteger
calculateKey(Digest digest, BigInteger N, BigInteger S)
Computes the final Key according to the standard routine: Key = H(S)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 )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 )static BigInteger
calculateU(Digest digest, BigInteger N, BigInteger A, BigInteger B)
static BigInteger
calculateX(Digest digest, BigInteger N, byte[] salt, byte[] identity, byte[] password)
static BigInteger
generatePrivateValue(Digest digest, BigInteger N, BigInteger g, SecureRandom random)
static BigInteger
validatePublicValue(BigInteger N, BigInteger val)
-
-
-
Method Detail
-
calculateK
public static BigInteger calculateK(Digest digest, BigInteger N, BigInteger g)
-
calculateU
public static BigInteger calculateU(Digest digest, BigInteger N, BigInteger A, BigInteger B)
-
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
public static BigInteger validatePublicValue(BigInteger N, BigInteger val) throws CryptoException
- 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
public static BigInteger calculateKey(Digest digest, BigInteger N, BigInteger S)
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.
-
-