com.pcbsys.nirvana.client.nPassphraseSigner Class Reference

This class signs an event with a digest of the event and the passphrase. More...

Inheritance diagram for com.pcbsys.nirvana.client.nPassphraseSigner:
com.pcbsys.nirvana.client.nMessageSigner

Public Member Functions

Provider getProvider ()
 Return the Provider used to vend the Digest class. More...
 
 nPassphraseSigner (String passphrase) throws NoSuchAlgorithmException, nIllegalArgumentException
 Constructs a message signer with the supplied passphrase. More...
 
 nPassphraseSigner (String passphrase, String algorithm) throws NoSuchAlgorithmException, nIllegalArgumentException
 Constructs a message signer with the supplied passphrase. More...
 
byte[] sign () throws Exception
 Return the message digest and reset the digest. 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 signs an event with a digest of the event and the passphrase.

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 3
  1. Producing the final digest

Constructor & Destructor Documentation

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

Constructs a message signer with the supplied passphrase.

Parameters
passphraseString representation of the passphrase to use
Exceptions
NoSuchAlgorithmExceptionIf the algorithm can not be found
nIllegalArgumentExceptionIf any of the arguments are invalid
com.pcbsys.nirvana.client.nPassphraseSigner.nPassphraseSigner ( String  passphrase,
String  algorithm 
) throws NoSuchAlgorithmException, nIllegalArgumentException

Constructs a message signer with the supplied passphrase.

Parameters
passphraseString representation of the passphrase to use
algorithmAlgorithm of a digest to use
Exceptions
NoSuchAlgorithmExceptionIf the algorithm can not be found
nIllegalArgumentExceptionIf any of the arguments are invalid

Member Function Documentation

static String com.pcbsys.nirvana.client.nPassphraseSigner.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.nPassphraseSigner.getProvider ( )

Return the Provider used to vend the Digest class.

Returns
a java.security.Provider class

Implements com.pcbsys.nirvana.client.nMessageSigner.

byte [] com.pcbsys.nirvana.client.nPassphraseSigner.sign ( ) throws Exception

Return the message digest and reset the digest.

Returns
byte[] representing the message digest
Exceptions
ExceptionIf unable to produce the digest

Implements com.pcbsys.nirvana.client.nMessageSigner.

void com.pcbsys.nirvana.client.nPassphraseSigner.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.nMessageSigner.