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

Quick Search    Search Deep

cryptix.sasl.otp
Class OTPDigest  view OTPDigest download OTPDigest.java

java.lang.Object
  extended bycryptix.sasl.otp.OTPDigest

final class OTPDigest
extends java.lang.Object

This object encapsulates the concrete implementation of the Message Digest Algorithm instance used by an incarnation of an OTP session.

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 OTP message digest algorithm.
private  java.lang.String digestName
           
private  java.security.MessageDigest md
          The root of all instances of the underlying OTP message digest algorithm.
 
Constructor Summary
private OTPDigest(java.security.MessageDigest md, java.lang.String mdaName)
          Trivial private constructor to enforce Singleton pattern.
 
Method Summary
(package private)  int getDigestLength()
          Return the size of the output, in bytes, of the message digest algorithm.
(package private)  java.lang.String getDigestName()
           
(package private) static OTPDigest getInstance(java.lang.String mdaName)
           
(package private)  java.security.MessageDigest newDigest()
          Returns a new instance of the OTP message digest algorithm --which is SHA-1 by default, but could be anything else provided the proper conditions as specified in the OTP 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 OTP message digest algorithm.


md

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

In this code of the OTP 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.


digestName

private java.lang.String digestName
Constructor Detail

OTPDigest

private OTPDigest(java.security.MessageDigest md,
                  java.lang.String mdaName)
Trivial private constructor to enforce Singleton pattern.

Method Detail

getInstance

static OTPDigest getInstance(java.lang.String mdaName)

getDigestLength

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


getDigestName

java.lang.String getDigestName()

newDigest

java.security.MessageDigest newDigest()
Returns a new instance of the OTP message digest algorithm --which is SHA-1 by default, but could be anything else provided the proper conditions as specified in the OTP specifications.