}
};
// Sign first: init DigitalSignature with md5 and sha1
// CipherSuite.KeyExchange_RSA_EXPORT == 2
DigitalSignature dsig = new DigitalSignature(2);
dsig.init(privateKey);
byte[] md5 = new byte[] {
0x00, // <=== this is a problem byte (see HARMONY-2125)
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a,
0x0b, 0x0c, 0x0d, 0x0e, 0x0f };
byte[] sha1 = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
0x11, 0x12, 0x13 };
dsig.setMD5(md5);
dsig.setSHA(sha1);
byte[] enc = dsig.sign();
// Now let's verify
dsig.init(cert);
assertTrue(dsig.verifySignature(enc));
}