|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.nimbusds.srp6.SRP6VerifierGenerator
public class SRP6VerifierGenerator
Generator of password verifier 'v' values.
SRP6Routines.generateRandomSalt(int) may be used to create a random salt
's' of a specified byte size.
| Constructor Summary | |
|---|---|
SRP6VerifierGenerator(SRP6CryptoParams config)
Creates a new generator of password verifier 'v' values. |
|
| Method Summary | |
|---|---|
static byte[] |
generateRandomSalt()
Generates a random 16-byte salt 's'. |
static byte[] |
generateRandomSalt(int numBytes)
Generates a random salt 's'. |
java.math.BigInteger |
generateVerifier(java.math.BigInteger salt,
java.lang.String password)
Generates a new verifier 'v' from the specified parameters with the user identifier 'I' omitted. |
java.math.BigInteger |
generateVerifier(java.math.BigInteger salt,
java.lang.String userID,
java.lang.String password)
Generates a new verifier 'v' from the specified parameters. |
java.math.BigInteger |
generateVerifier(byte[] salt,
byte[] password)
Generates a new verifier 'v' from the specified parameters with the user identifier 'I' omitted. |
java.math.BigInteger |
generateVerifier(byte[] salt,
byte[] userID,
byte[] password)
Generates a new verifier 'v' from the specified parameters. |
XRoutine |
getXRoutine()
Gets the custom routine for the password key 'x' computation. |
void |
setXRoutine(XRoutine routine)
Sets a custom routine for the password key 'x' computation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SRP6VerifierGenerator(SRP6CryptoParams config)
config - The SRP-6a crypto parameters configuration. Must not
be null.| Method Detail |
|---|
public static byte[] generateRandomSalt(int numBytes)
This method is a shortcut to SRP6Routines.generateRandomSalt(int).
numBytes - The number of bytes the salt 's' must have.
public static byte[] generateRandomSalt()
This method is a shortcut to SRP6Routines.generateRandomSalt(int).
public void setXRoutine(XRoutine routine)
routine - The password key 'x' routine or null to use
the default one instead.public XRoutine getXRoutine()
null if the default
default one is used.
public java.math.BigInteger generateVerifier(byte[] salt,
byte[] userID,
byte[] password)
The verifier is computed as v = g^x (mod N). If a custom
'x' computation routine is set it will be used
instead of the default one.
Tip: To convert a string to a byte array you can use
String.getBytes() or
String.getBytes(java.nio.charset.Charset). To convert a big
integer to a byte array you can use BigInteger.toByteArray().
salt - The salt 's'. Must not be null.userID - The user identity 'I'. May be null if the
default 'x' routine is used or the custom one ignores
it.password - The user password 'P'. Must not be null.
public java.math.BigInteger generateVerifier(java.math.BigInteger salt,
java.lang.String userID,
java.lang.String password)
The verifier is computed as v = g^x (mod N). If a custom
'x' computation routine is set it will be used
instead of the default one.
salt - The salt 's'. Must not be null.userID - The user identity 'I', as an UTF-8 encoded string.
May be null if the default 'x' routine is
used or the custom one ignores it.password - The user password 'P', as an UTF-8 encoded string.
Must not be null.
public java.math.BigInteger generateVerifier(byte[] salt,
byte[] password)
The verifier is computed as v = g^x (mod N). If a custom
'x' computation routine is set it must omit the
user identity 'I' as well.
Tip: To convert a string to a byte array you can use
String.getBytes() or
String.getBytes(java.nio.charset.Charset). To convert a big
integer to a byte array you can use BigInteger.toByteArray().
salt - The salt 's'. Must not be null.password - The user password 'P'. Must not be null.
public java.math.BigInteger generateVerifier(java.math.BigInteger salt,
java.lang.String password)
The verifier is computed as v = g^x (mod N). If a custom
'x' computation routine is set it must omit the
user identity 'I' as well.
salt - The salt 's'. Must not be null.password - The user password 'P', as an UTF-8 encoded string.
Must not be null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||