Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

cryptix.sasl.srp
Class SRPDigest  view SRPDigest download SRPDigest.java

java.lang.Object
  extended bycryptix.sasl.srp.SRPDigest

final class SRPDigest
extends java.lang.Object

The SRP protocol does not disallow the use of digest algorithms other than SHA. This object encapsulates the concrete implementation of the Message Digest Algorithm instance used by an incarnation of an SRP agreement.

Since:
draft-burdis-cat-sasl-srp-04
Version:
$Revision: 1.3 $

Field Summary
private static org.apache.log4j.Category cat
           
private  int digestLength
          The size of the output (in bytes) of the underlying SRP message digest algorithm.
private  java.security.MessageDigest md
          The root of all instances of the underlying SRP message digest algorithm.
 
Constructor Summary
private SRPDigest(java.security.MessageDigest md)
          Trivial private constructor to enforce Singleton pattern.
 
Method Summary
(package private)  byte[] digestInterleaved(byte[] ba)
          Performs an interleaved even-odd hash on the designated byte string.
(package private)  int getDigestLength()
          Returns the size of the output, in bytes, of the message digest algorithm.
(package private) static SRPDigest getInstance(java.lang.String mdName)
          Returns an instance of this object for the designated message digest algorithm.
(package private)  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.
 
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

digestLength

private int digestLength
The size of the output (in bytes) of the underlying SRP message digest algorithm.


md

private java.security.MessageDigest md
The root of all instances of the underlying SRP message digest algorithm.

In this code of the SRP protocol we use Sun's SHA implementation. In later version this will change to use any provider's implementation but we shall add some verification tests (known test vectors) to ensure it is reliable.

Constructor Detail

SRPDigest

private SRPDigest(java.security.MessageDigest md)
Trivial private constructor to enforce Singleton pattern.

Method Detail

getInstance

static SRPDigest getInstance(java.lang.String mdName)
Returns an instance of this object for the designated message digest algorithm.


getDigestLength

int getDigestLength()
Returns the size of the output, in bytes, of the message digest algorithm.


newDigest

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.


digestInterleaved

byte[] digestInterleaved(byte[] ba)
Performs an interleaved even-odd hash on the designated byte string.