org.apache.sshd.common.digest
Class BaseDigest

java.lang.Object
  extended by org.apache.sshd.common.digest.BaseDigest
All Implemented Interfaces:
Digest
Direct Known Subclasses:
MD5, SHA1

public class BaseDigest
extends Object
implements Digest

Base class for Digest algorithms based on the JCE provider.

Author:
Apache MINA SSHD Project

Constructor Summary
BaseDigest(String algorithm, int bsize)
          Create a new digest using the given algorithm and block size.
 
Method Summary
 byte[] digest()
           
 int getBlockSize()
           
 void init()
           
 void update(byte[] foo, int start, int len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseDigest

public BaseDigest(String algorithm,
                  int bsize)
Create a new digest using the given algorithm and block size. The initialization and creation of the underlying MessageDigest object will be done in the init() method.

Parameters:
algorithm - the JCE algorithm to use for this digest
bsize - the block size of this digest
Method Detail

getBlockSize

public int getBlockSize()
Specified by:
getBlockSize in interface Digest

init

public void init()
          throws Exception
Specified by:
init in interface Digest
Throws:
Exception

update

public void update(byte[] foo,
                   int start,
                   int len)
            throws Exception
Specified by:
update in interface Digest
Throws:
Exception

digest

public byte[] digest()
              throws Exception
Specified by:
digest in interface Digest
Throws:
Exception


Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.