com.sun.mdm.index.util
Class Sigger

java.lang.Object
  extended bycom.sun.mdm.index.util.Sigger
All Implemented Interfaces:
java.io.Serializable

public class Sigger
extends java.lang.Object
implements java.io.Serializable

Signature calculator calculates a signature for a given SystemObject. Signature can be calculated using either "MD5" or "SHA" algorithm. This implementation relys on Java 1.4 security features. And requires at least the default provider, or additional registered provider that supports "MD5" or "SHA" MAC algorithm

See Also:
Serialized Form

Constructor Summary
Sigger()
          Creates new Sigger
 
Method Summary
protected  byte[] calculateSignature(java.lang.String algo, ObjectNode omega)
          calculates the checksum for match fields.
 byte[] calculateSignatureMD5(ObjectNode omega)
          calculates the signature using MD5 MAC algorithm
 byte[] calculateSignatureSHA(ObjectNode omega)
          calculates the signature using SHA MAC algorithm
protected  void traverse(ObjectNode obj, java.security.MessageDigest md)
          Traverse the ObjectNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sigger

public Sigger()
Creates new Sigger

Method Detail

calculateSignature

protected byte[] calculateSignature(java.lang.String algo,
                                    ObjectNode omega)
                             throws SystemObjectException
calculates the checksum for match fields. concatenates each match field value in sorted order by field name

Parameters:
algo - MD5 or SHA
omega - SBR object
Returns:
a byte array containing the checksum
Throws:
SystemObjectException - if accessing the ObjectNode failed

calculateSignatureMD5

public byte[] calculateSignatureMD5(ObjectNode omega)
                             throws SystemObjectException
calculates the signature using MD5 MAC algorithm

Parameters:
omega - input object
Returns:
byte array containing the signature
Throws:
SystemObjectException - if accessing the ObjectNode failed

calculateSignatureSHA

public byte[] calculateSignatureSHA(ObjectNode omega)
                             throws SystemObjectException
calculates the signature using SHA MAC algorithm

Parameters:
omega - input object
Returns:
byte array containing the signature
Throws:
SystemObjectException - if accessing the ObjectNode failed

traverse

protected void traverse(ObjectNode obj,
                        java.security.MessageDigest md)
                 throws SystemObjectException
Traverse the ObjectNode

Parameters:
obj - the ObjectNode to traverse
md - the MessageDigest to use
Throws:
SystemObjectException - if traversing the ObjectNode failed


Sun Microsystems, Inc.