|
|||||||||
Home >> All >> cryptix >> sasl >> [ srp overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |
cryptix.sasl.srp
Class SRP

java.lang.Objectcryptix.sasl.srp.SRP
- All Implemented Interfaces:
- cryptix.sasl.SaslParams, SRPParams
- public final class SRP
- extends java.lang.Object
- implements SRPParams, cryptix.sasl.SaslParams
- extends java.lang.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.
- Since:
- draft-burdis-cat-sasl-srp-04
- Version:
- $Revision: 1.5 $
Field Summary | |
private static java.util.HashMap |
algorithms
The map of already instantiated SRP algorithm instances. |
private static org.apache.log4j.Category |
cat
|
private SRPDigest |
mda
The underlying SRP message digest algorithm. |
private java.lang.String |
mdName
Canonical name of the message digest algorithm of this instance. |
private static java.util.Random |
prng
A source of strong randomness. |
private static int |
PUBLIC_KEY_SIZE
Size of the ephemeral public keys in bits. |
Fields inherited from interface cryptix.sasl.SaslParams |
AES_CALG, ANONYMOUS_MECHANISM, AUTH_INFO_PROVIDER_PKGS, BUFFER_LIMIT, CRAM_MD5_MECHANISM, FOUR_BYTE_HEADER_LIMIT, HMAC_MD5_IALG, HMAC_SHA_IALG, MD5_MDA, ONE_BYTE_HEADER_LIMIT, OTP_MECHANISM, PASSWORD, PLAIN_MECHANISM, RIJNDAEL_CALG, RIPEMD_160_MDA, SHA_MDA, SM2_MECHANISM, SRP_MECHANISM, TWO_BYTE_HEADER_LIMIT, TWOFISH_CALG, USERNAME |
Constructor Summary | |
private |
SRP(java.lang.String mdName,
SRPDigest mda)
Trivial private constructor to enforce Singleton pattern. |
Method Summary | |
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(java.lang.String src)
Convenience method to return the result of digesting the designated input with a new instance of the SRP message digest algorithm. |
byte[] |
generateClientEvidence(java.math.BigInteger N,
java.math.BigInteger g,
java.lang.String U,
byte[] s,
java.math.BigInteger A,
java.math.BigInteger B,
byte[] K,
java.lang.String L)
|
static java.security.KeyPair |
generateClientKeyPair(java.math.BigInteger N,
java.math.BigInteger g)
Generates the client-side private and public key-pair, given the shared public modulus n and the generator g. |
javax.crypto.SecretKey |
generateClientSecretKey(java.security.KeyPair cKP,
java.math.BigInteger B,
java.math.BigInteger x)
Used by the client-side in the SRP exchenage, this method generates a session key suitable for symmetric encryption of the exchange between the client and server after authentication is successfully concluded. |
byte[] |
generateServerEvidence(java.math.BigInteger A,
byte[] M,
byte[] K,
java.lang.String U,
java.lang.String I,
java.lang.String o)
|
static java.security.KeyPair |
generateServerKeyPair(java.math.BigInteger N,
java.math.BigInteger g,
java.math.BigInteger v)
Generates the server-side private and public key-pair, given the shared public modulus n and the generator g. |
javax.crypto.SecretKey |
generateServerSecretKey(java.security.KeyPair sKP,
java.math.BigInteger A,
java.math.BigInteger v)
Used by the server-side in the SRP exchenage, this method generates a session key suitable for symmetric encryption of the exchange between the client and server after authentication is successfully concluded. |
java.lang.String |
getAlgorithm()
|
java.lang.String |
getSRPName()
|
static SRP |
instance(java.lang.String mdName)
Returns an instance of this object that uses the designated message digest algorithm as its digest function. |
java.security.MessageDigest |
newDigest()
Returns a new instance of the SRP message digest algorithm --which is SHA-1 by default, but could be anything else provided the proper conditions as specified in the SRP specifications. |
byte[] |
userHash(java.lang.String U,
java.lang.String p)
|
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
cat
private static org.apache.log4j.Category cat
algorithms
private static final java.util.HashMap algorithms
- The map of already instantiated SRP algorithm instances.
prng
private static final java.util.Random prng
- A source of strong randomness.
PUBLIC_KEY_SIZE
private static final int PUBLIC_KEY_SIZE
- Size of the ephemeral public keys in bits.
- See Also:
- Constant Field Values
mda
private SRPDigest mda
- The underlying SRP message digest algorithm.
mdName
private java.lang.String mdName
- Canonical name of the message digest algorithm of this instance.
Constructor Detail |
SRP
private SRP(java.lang.String mdName, SRPDigest mda)
- Trivial private constructor to enforce Singleton pattern.
Method Detail |
instance
public static SRP instance(java.lang.String mdName)
- Returns an instance of this object that uses the designated message
digest algorithm as its digest function.
generateServerKeyPair
public static java.security.KeyPair generateServerKeyPair(java.math.BigInteger N, java.math.BigInteger g, java.math.BigInteger v)
- Generates the server-side private and public key-pair, given the shared
public modulus n and the generator g.
generateClientKeyPair
public static java.security.KeyPair generateClientKeyPair(java.math.BigInteger N, java.math.BigInteger g)
- Generates the client-side private and public key-pair, given the shared
public modulus n and the generator g.
getAlgorithm
public java.lang.String getAlgorithm()
getSRPName
public java.lang.String getSRPName()
generateServerSecretKey
public javax.crypto.SecretKey generateServerSecretKey(java.security.KeyPair sKP, java.math.BigInteger A, java.math.BigInteger v)
- Used by the server-side in the SRP exchenage, this method generates a
session key suitable for symmetric encryption of the exchange between the
client and server after authentication is successfully concluded.
generateClientSecretKey
public javax.crypto.SecretKey generateClientSecretKey(java.security.KeyPair cKP, java.math.BigInteger B, java.math.BigInteger x)
- Used by the client-side in the SRP exchenage, this method generates a
session key suitable for symmetric encryption of the exchange between the
client and server after authentication is successfully concluded.
newDigest
public java.security.MessageDigest newDigest()
- Returns a new instance of the SRP message digest algorithm --which is
SHA-1 by default, but could be anything else provided the proper
conditions as specified in the SRP specifications.
digest
public 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.
digest
public byte[] digest(java.lang.String src)
- Convenience method to return the result of digesting the designated input
with a new instance of the SRP message digest algorithm.
xor
public 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.
userHash
public byte[] userHash(java.lang.String U, java.lang.String p)
generateServerEvidence
public byte[] generateServerEvidence(java.math.BigInteger A, byte[] M, byte[] K, java.lang.String U, java.lang.String I, java.lang.String o)
generateClientEvidence
public byte[] generateClientEvidence(java.math.BigInteger N, java.math.BigInteger g, java.lang.String U, byte[] s, java.math.BigInteger A, java.math.BigInteger B, byte[] K, java.lang.String L)
|
|||||||||
Home >> All >> cryptix >> sasl >> [ srp overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |