//
X962Parameters params = new X962Parameters(X9ObjectIdentifiers.prime192v1);
ASN1OctetString p = (ASN1OctetString)(new X9ECPoint(new ECPoint.Fp(ecP.getCurve(), new ECFieldElement.Fp(BigInteger.valueOf(2), BigInteger.valueOf(1)), new ECFieldElement.Fp(BigInteger.valueOf(4), BigInteger.valueOf(3)))).getDERObject());
PrivateKeyInfo info = new PrivateKeyInfo(new AlgorithmIdentifier(X9ObjectIdentifiers.id_ecPublicKey, params), new ECPrivateKeyStructure(BigInteger.valueOf(10)).getDERObject());
if (!isSameAs(info.getEncoded(), namedPriv))
{
return new SimpleTestResult(false, getName() + ": failed private named generation");
}
ASN1InputStream aIn = new ASN1InputStream(new ByteArrayInputStream(namedPriv));
DERObject o = aIn.readObject();
if (!info.equals(o))
{
return new SimpleTestResult(false, getName() + ": failed private named equality");
}
//
// explicit curve parameters
//
params = new X962Parameters(ecP);
info = new PrivateKeyInfo(new AlgorithmIdentifier(X9ObjectIdentifiers.id_ecPublicKey, params), new ECPrivateKeyStructure(BigInteger.valueOf(20)).toASN1Object());
if (!isSameAs(info.getEncoded(), expPriv))
{
return new SimpleTestResult(false, getName() + ": failed private explicit generation");
}