public byte[] generateSignature() throws CryptoException, DataLengthException {
  contentDigest.doFinal(mDash,mDash.length - hLen - sLen);
  if (sLen != 0) {
    random.nextBytes(salt);
    System.arraycopy(salt,0,mDash,mDash.length - sLen,sLen);
  }
  byte[] h=new byte[hLen];
  contentDigest.update(mDash,0,mDash.length);
  contentDigest.doFinal(h,0);
  block[block.length - sLen - 1- hLen- 1]=0x01;
  System.arraycopy(salt,0,block,block.length - sLen - hLen- 1,sLen);
  byte[] dbMask=maskGeneratorFunction1(h,0,h.length,block.length - hLen - 1);
  for (int i=0; i != dbMask.length; i++) {
    block[i]^=dbMask[i];
  }
  block[0]&=(0xff >> ((block.length * 8) - emBits));
  System.arraycopy(h,0,block,block.length - hLen - 1,hLen);
  block[block.length - 1]=trailer;
  byte[] b=cipher.processBlock(block,0,block.length);
  clearBlock(block);
  return b;
}

public byte [ ] generateSignature ( ) throws CryptoException , DataLengthException { contentDigest . doFinal ( mDash , mDash . length - hLen - sLen ) ; if ( sLen != 0 ) { random . nextBytes ( salt ) ; System . arraycopy ( salt , 0 , mDash , mDash . length - sLen , sLen ) ; } byte [ ] h = new byte [ hLen ] ; contentDigest . update ( mDash , 0 , mDash . length ) ; contentDigest . doFinal ( h , 0 ) ; block [ block . length - sLen - 1 - hLen - 1 ] = 0x01 ; System . arraycopy ( salt , 0 , block , block . length - sLen - hLen - 1 , sLen ) ; byte [ ] dbMask = maskGeneratorFunction1 ( h , 0 , h . length , block . length - hLen - 1 ) ; for ( int i = 0 ; i != dbMask . length ; i ++ ) { block [ i ] ^= dbMask [ i ] ; } block [ 0 ] &= ( 0xff > > ( ( block . length * 8 ) - emBits ) ) ; System . arraycopy ( h , 0 , block , block . length - hLen - 1 , hLen ) ; block [ block . length - 1 ] = trailer ; byte [ ] b = cipher . processBlock ( block , 0 , block . length ) ; clearBlock ( block ) ; return b ; }
generate a signature for the message we ' ve been loaded with using the key we were initialised with .
