return tw.getBytes();
}
public static byte[] encodeSSHDSASignature(DSASignature ds)
{
TypesWriter tw = new TypesWriter();
tw.writeString("ssh-dss");
byte[] r = ds.getR().toByteArray();
byte[] s = ds.getS().toByteArray();
byte[] a40 = new byte[40];
/* Patch (unsigned) r and s into the target array. */
int r_copylen = (r.length < 20) ? r.length : 20;
int s_copylen = (s.length < 20) ? s.length : 20;
System.arraycopy(r, r.length - r_copylen, a40, 20 - r_copylen, r_copylen);
System.arraycopy(s, s.length - s_copylen, a40, 40 - s_copylen, s_copylen);
tw.writeString(a40, 0, 40);
return tw.getBytes();
}