com.pcbsys.nirvana.client.nPassphraseValidator Class Reference

This class implements a message digest Validator. More...

Inheritance diagram for com.pcbsys.nirvana.client.nPassphraseValidator:
com.pcbsys.nirvana.client.nMessageValidator

Public Member Functions

Object check (byte[] original) throws Exception
 Checks the original digest with the digest created with the update method. More...
 
Provider getProvider ()
 Return the Provider used to vend the Digest class. More...
 
 nPassphraseValidator (String passphrase) throws NoSuchAlgorithmException, nIllegalArgumentException
 Creates a nPassphraseValidator with the supplied passphrase. More...
 
 nPassphraseValidator (String passphrase, String algorithm) throws NoSuchAlgorithmException, nIllegalArgumentException
 Creates a nPassphraseValidator with the supplied passphrase. More...
 
void start (byte[] sig)
 This method does nothing. More...
 
void stop ()
 This method does nothing. More...
 
void update (byte[] data) throws Exception
 Adds the data to the digest. More...
 

Static Public Member Functions

static String getDefaultAlgorithm ()
 Get the default algorithm that will be used if no algorithm is supplied. More...
 

Detailed Description

This class implements a message digest Validator.

The digest is created by

  1. Digesting the PassPhrase
  1. Digesting the data
  1. Producing the initial digest
  1. Reseting the digest
  1. Digesting the PassPhrase
  1. Digesting the initial digest from step
  1. Producing the final digest
  1. Comparing the supplied digest with the one created

Constructor & Destructor Documentation

com.pcbsys.nirvana.client.nPassphraseValidator.nPassphraseValidator ( String  passphrase) throws NoSuchAlgorithmException, nIllegalArgumentException

Creates a nPassphraseValidator with the supplied passphrase.

Parameters
passphraseString representation of the passphrase. The larger the better
Exceptions
NoSuchAlgorithmExceptionIf the current provider does not support the Algorithm
nIllegalArgumentExceptionIf any of the arguments are invalid
com.pcbsys.nirvana.client.nPassphraseValidator.nPassphraseValidator ( String  passphrase,
String  algorithm 
) throws NoSuchAlgorithmException, nIllegalArgumentException

Creates a nPassphraseValidator with the supplied passphrase.

Parameters
passphraseString representation of the passphrase. The larger the better
algorithmAlgorithm name to use
Exceptions
NoSuchAlgorithmExceptionIf the current provider does not support the Algorithm
nIllegalArgumentExceptionIf any of the arguments are invalid

Member Function Documentation

Object com.pcbsys.nirvana.client.nPassphraseValidator.check ( byte[]  original) throws Exception

Checks the original digest with the digest created with the update method.

Parameters
originalOriginal digest to compare with
Returns
The message digest
Exceptions
ExceptionIf the digests do not match

Implements com.pcbsys.nirvana.client.nMessageValidator.

static String com.pcbsys.nirvana.client.nPassphraseValidator.getDefaultAlgorithm ( )
static

Get the default algorithm that will be used if no algorithm is supplied.

Currently this is SHA1 with RSA.

Returns
The Algorithm name that will be used by default
Provider com.pcbsys.nirvana.client.nPassphraseValidator.getProvider ( )

Return the Provider used to vend the Digest class.

Returns
a java.security.Provider class

Implements com.pcbsys.nirvana.client.nMessageValidator.

void com.pcbsys.nirvana.client.nPassphraseValidator.start ( byte[]  sig)

This method does nothing.

Is required by the interface

Implements com.pcbsys.nirvana.client.nMessageValidator.

void com.pcbsys.nirvana.client.nPassphraseValidator.stop ( )

This method does nothing.

Is required by the interface

Implements com.pcbsys.nirvana.client.nMessageValidator.

void com.pcbsys.nirvana.client.nPassphraseValidator.update ( byte[]  data) throws Exception

Adds the data to the digest.

Parameters
dataData to add to the digest
Exceptions
ExceptionIf unable to add the data to the digest

Implements com.pcbsys.nirvana.client.nMessageValidator.