{
fail("public parameters not decoded properly");
}
PKCS8EncodedKeySpec pkcs8 = new PKCS8EncodedKeySpec(sKey.getEncoded());
GOST3410PrivateKey k2 = (GOST3410PrivateKey)f.generatePrivate(pkcs8);
if (!k2.getX().equals(((GOST3410PrivateKey)sKey).getX()))
{
fail("private number not decoded properly");
}
if (!k2.getParameters().equals(((GOST3410PrivateKey)sKey).getParameters()))
{
fail("private number not decoded properly");
}
k2 = (GOST3410PrivateKey)serializeDeserialize(sKey);
if (!k2.getX().equals(((GOST3410PrivateKey)sKey).getX()))
{
fail("private number not deserialised properly");
}
if (!k2.getParameters().equals(((GOST3410PrivateKey)sKey).getParameters()))
{
fail("private number not deserialised properly");
}
checkEquals(k2, sKey);