protected byte[] engineSign() throws SignatureException {
  BigInteger k=generateK(presetQ);
  BigInteger r=generateR(presetP,presetQ,presetG,k);
  BigInteger s=generateS(presetX,presetQ,r,k);
  try {
    DerOutputStream outseq=new DerOutputStream(100);
    outseq.putInteger(r);
    outseq.putInteger(s);
    DerValue result=new DerValue(DerValue.tag_Sequence,outseq.toByteArray());
    return result.toByteArray();
  }
 catch (  IOException e) {
    throw new SignatureException("error encoding signature");
  }
}

protected byte [ ] engineSign ( ) throws SignatureException { BigInteger k = generateK ( presetQ ) ; BigInteger r = generateR ( presetP , presetQ , presetG , k ) ; BigInteger s = generateS ( presetX , presetQ , r , k ) ; try { DerOutputStream outseq = new DerOutputStream ( 100 ) ; outseq . putInteger ( r ) ; outseq . putInteger ( s ) ; DerValue result = new DerValue ( DerValue . tag_Sequence , outseq . toByteArray ( ) ) ; return result . toByteArray ( ) ; } catch ( IOException e ) { throw new SignatureException ( "error encoding signature" ) ; } }
sign all the data thus far updated . the signature is formatted according to the canonical encoding rules , returned as a der sequence of integer , r and s .
