webfunds.token.algorithm
Class AbstractPrivateTokenParameters

java.lang.Object
  |
  +--webfunds.token.algorithm.AbstractPrivateTokenParameters
Direct Known Subclasses:
ChaumPrivateTokenParameters, RandomPrivateTokenParameters

public abstract class AbstractPrivateTokenParameters
extends java.lang.Object
implements webfunds.token.algorithm.AbstractParamInterface

Abstraction for private (key) data.


Constructor Summary
AbstractPrivateTokenParameters()
           
 
Method Summary
 void decode(byte[] data, int start, int len)
           
protected abstract  void decodePrivateImpl(byte[] data, int start, int len)
           
protected abstract  void decodePublicImpl(byte[] data, int start, int len)
           
 byte[] encodePrivateData()
           
protected abstract  byte[] encodePrivateDataImpl()
           
 byte[] encodePublicData()
           
protected abstract  byte[] encodePublicDataImpl()
           
 void generate(java.security.SecureRandom sr, long[] denominations, byte[] currencyID, byte[] series, java.util.Date expiry)
           
protected abstract  void generateImpl(java.security.SecureRandom sr, long[] denominations)
           
 byte getAbstractMajorVersion()
           
 byte getAbstractMinorVersion()
           
 byte[] getCurrencyID()
           
 long[] getDenominations()
           
 java.util.Date getExpiryDate()
           
 byte getImplementationMajorVersion()
           
 byte getImplementationMinorVersion()
           
 byte[] getSeries()
           
 void setAbstractMajorVersion(byte x)
           
 void setAbstractMinorVersion(byte x)
           
 void setCurrencyID(byte[] x)
           
 void setDenominations(long[] x)
           
 void setExpiryDate(java.util.Date x)
           
 void setImplementationMajorVersion(byte x)
           
 void setImplementationMinorVersion(byte x)
           
 void setSeries(byte[] x)
           
 void sign(java.security.PrivateKey pk, java.lang.String alg, java.lang.String provider, java.security.SecureRandom sr)
           
 boolean verify(java.security.PublicKey pk, java.lang.String alg, java.lang.String provider)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPrivateTokenParameters

public AbstractPrivateTokenParameters()
Method Detail

generateImpl

protected abstract void generateImpl(java.security.SecureRandom sr,
                                     long[] denominations)

generate

public final void generate(java.security.SecureRandom sr,
                           long[] denominations,
                           byte[] currencyID,
                           byte[] series,
                           java.util.Date expiry)

decodePrivateImpl

protected abstract void decodePrivateImpl(byte[] data,
                                          int start,
                                          int len)
                                   throws DataFormatException,
                                          UnsupportedVersionException

decodePublicImpl

protected abstract void decodePublicImpl(byte[] data,
                                         int start,
                                         int len)
                                  throws DataFormatException,
                                         UnsupportedVersionException

encodePublicDataImpl

protected abstract byte[] encodePublicDataImpl()

encodePrivateDataImpl

protected abstract byte[] encodePrivateDataImpl()

sign

public final void sign(java.security.PrivateKey pk,
                       java.lang.String alg,
                       java.lang.String provider,
                       java.security.SecureRandom sr)
                throws java.security.NoSuchAlgorithmException,
                       java.security.NoSuchProviderException,
                       java.security.InvalidKeyException

verify

public final boolean verify(java.security.PublicKey pk,
                            java.lang.String alg,
                            java.lang.String provider)
                     throws java.security.NoSuchAlgorithmException,
                            java.security.NoSuchProviderException,
                            java.security.InvalidKeyException,
                            java.security.SignatureException

decode

public final void decode(byte[] data,
                         int start,
                         int len)
                  throws DataFormatException,
                         UnsupportedVersionException

encodePublicData

public final byte[] encodePublicData()

encodePrivateData

public final byte[] encodePrivateData()

getCurrencyID

public final byte[] getCurrencyID()
Specified by:
getCurrencyID in interface webfunds.token.algorithm.AbstractParamInterface

getSeries

public final byte[] getSeries()
Specified by:
getSeries in interface webfunds.token.algorithm.AbstractParamInterface

getExpiryDate

public final java.util.Date getExpiryDate()
Specified by:
getExpiryDate in interface webfunds.token.algorithm.AbstractParamInterface

getDenominations

public final long[] getDenominations()
Specified by:
getDenominations in interface webfunds.token.algorithm.AbstractParamInterface

getAbstractMajorVersion

public final byte getAbstractMajorVersion()
Specified by:
getAbstractMajorVersion in interface webfunds.token.algorithm.AbstractParamInterface

getAbstractMinorVersion

public final byte getAbstractMinorVersion()
Specified by:
getAbstractMinorVersion in interface webfunds.token.algorithm.AbstractParamInterface

getImplementationMajorVersion

public final byte getImplementationMajorVersion()
Specified by:
getImplementationMajorVersion in interface webfunds.token.algorithm.AbstractParamInterface

getImplementationMinorVersion

public final byte getImplementationMinorVersion()
Specified by:
getImplementationMinorVersion in interface webfunds.token.algorithm.AbstractParamInterface

setCurrencyID

public final void setCurrencyID(byte[] x)
Specified by:
setCurrencyID in interface webfunds.token.algorithm.AbstractParamInterface

setSeries

public final void setSeries(byte[] x)
Specified by:
setSeries in interface webfunds.token.algorithm.AbstractParamInterface

setExpiryDate

public final void setExpiryDate(java.util.Date x)
Specified by:
setExpiryDate in interface webfunds.token.algorithm.AbstractParamInterface

setDenominations

public final void setDenominations(long[] x)
Specified by:
setDenominations in interface webfunds.token.algorithm.AbstractParamInterface

setAbstractMajorVersion

public final void setAbstractMajorVersion(byte x)
Specified by:
setAbstractMajorVersion in interface webfunds.token.algorithm.AbstractParamInterface

setAbstractMinorVersion

public final void setAbstractMinorVersion(byte x)
Specified by:
setAbstractMinorVersion in interface webfunds.token.algorithm.AbstractParamInterface

setImplementationMajorVersion

public final void setImplementationMajorVersion(byte x)
Specified by:
setImplementationMajorVersion in interface webfunds.token.algorithm.AbstractParamInterface

setImplementationMinorVersion

public final void setImplementationMinorVersion(byte x)
Specified by:
setImplementationMinorVersion in interface webfunds.token.algorithm.AbstractParamInterface