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);
}