//
// named curve
//
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());
SubjectPublicKeyInfo info = new SubjectPublicKeyInfo(new AlgorithmIdentifier(X9ObjectIdentifiers.id_ecPublicKey, params), p.getOctets());
if (!isSameAs(info.getEncoded(), namedPub))
{
return new SimpleTestResult(false, getName() + ": failed public named generation");
}
ASN1InputStream aIn = new ASN1InputStream(new ByteArrayInputStream(namedPub));
DERObject o = aIn.readObject();
if (!info.equals(o))
{
return new SimpleTestResult(false, getName() + ": failed public named equality");
}
//
// explicit curve parameters
//
params = new X962Parameters(ecP);
info = new SubjectPublicKeyInfo(new AlgorithmIdentifier(X9ObjectIdentifiers.id_ecPublicKey, params), p.getOctets());
if (!isSameAs(info.getEncoded(), expPub))
{
return new SimpleTestResult(false, getName() + ": failed public explicit generation");
}