// SEQUENCE seq = new SEQUENCE();
// seq.addElement(new INTEGER(EcCore.fieldElemToBytes(r, params)));
// seq.addElement(new INTEGER(EcCore.fieldElemToBytes(s, params)));
// Sigh, another work around...
SEQUENCE seq = new SEQUENCE();
byte[] tmp = new byte[2 + (((ECFieldFp) params.getCurve().getField())
.getFieldSize() + 7) / 8];
tmp[0] = 0x02;
tmp[1] = (byte) EcCore.fieldElemToBytes(r, params, tmp, 2);
seq.addElement(new ANY(tmp));
tmp = new byte[2 + (((ECFieldFp) params.getCurve().getField())
.getFieldSize() + 7) / 8];
tmp[0] = 0x02;
tmp[1] = (byte) EcCore.fieldElemToBytes(s, params, tmp, 2);
seq.addElement(new ANY(tmp));
seq.encode(baos);
} catch (Exception ex) {
throw new SignatureException("Internal ASN.1 encoding error", ex);
}
return baos.toByteArray();