gnu.crypto.sasl.srp
public final class SRP extends Object
A Factory class that returns SRP Singletons that know all SRP-related mathematical computations and protocol-related operations for both the client- and server-sides.
Version: $Revision: 1.6 $
Method Summary | |
---|---|
byte[] | computeX(byte[] s, String user, String password) |
byte[] | computeX(byte[] s, String user, byte[] p) |
byte[] | digest(byte[] src) Convenience method to return the result of digesting the designated input with a new instance of the SRP message digest algorithm. |
byte[] | digest(String src) Convenience method to return the result of digesting the designated input with a new instance of the SRP message digest algorithm. |
byte[] | generateKn(byte[] K, byte[] cn, byte[] sn) |
byte[] | generateM1(BigInteger N, BigInteger g, String U, byte[] s, BigInteger A, BigInteger B, byte[] K, String I, String L, byte[] cn, byte[] cCB) |
byte[] | generateM2(BigInteger A, byte[] M1, byte[] K, String U, String I, String o, byte[] sid, int ttl, byte[] cIV, byte[] sIV, byte[] sCB) |
String | getAlgorithm() |
static SRP | instance(String mdName) Returns an instance of this object that uses the designated message digest algorithm as its digest function. |
IMessageDigest | newDigest() Returns a new instance of the SRP message digest algorithm --which is SHA-160 by default, but could be anything else provided the proper conditions as specified in the SRP specifications. |
byte[] | xor(byte[] a, byte[] b) Convenience method to XOR N bytes from two arrays; N being the output size of the SRP message digest algorithm. |
Convenience method to return the result of digesting the designated input with a new instance of the SRP message digest algorithm.
Parameters: src some bytes to digest.
Returns: the bytes constituting the result of digesting the designated input with a new instance of the SRP message digest algorithm.
Convenience method to return the result of digesting the designated input with a new instance of the SRP message digest algorithm.
Parameters: src a String whose bytes (using US-ASCII encoding) are to be digested.
Returns: the bytes constituting the result of digesting the designated input with a new instance of the SRP message digest algorithm.
Throws: UnsupportedEncodingException if US-ASCII charset is not found.
Returns: the message digest algorithm name used by this instance.
Returns an instance of this object that uses the designated message digest algorithm as its digest function.
Returns: an instance of this object for the designated digest name.
Returns a new instance of the SRP message digest algorithm --which is SHA-160 by default, but could be anything else provided the proper conditions as specified in the SRP specifications.
Returns: a new instance of the underlying SRP message digest algorithm.
Throws: RuntimeException if the implementation of the message digest algorithm does not support cloning.
Convenience method to XOR N bytes from two arrays; N being the output size of the SRP message digest algorithm.
Parameters: a the first byte array. b the second one.
Returns: N bytes which are the result of the XOR operations on the first N bytes from the designated arrays. N is the size of the SRP message digest algorithm; eg. 20 for SHA-160.