本文整理汇总了Java中org.bouncycastle.asn1.x9.ECNamedCurveTable.getByOID方法的典型用法代码示例。如果您正苦于以下问题:Java ECNamedCurveTable.getByOID方法的具体用法?Java ECNamedCurveTable.getByOID怎么用?Java ECNamedCurveTable.getByOID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.asn1.x9.ECNamedCurveTable
的用法示例。
在下文中一共展示了ECNamedCurveTable.getByOID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decodePoint
import org.bouncycastle.asn1.x9.ECNamedCurveTable; //导入方法依赖的package包/类
private static ECPoint decodePoint(
BigInteger encodedPoint,
ASN1ObjectIdentifier oid)
throws IOException
{
X9ECParameters curve = ECNamedCurveTable.getByOID(oid);
if (curve == null)
{
throw new IOException(oid.getId() + " does not match any known curve.");
}
if (!(curve.getCurve() instanceof ECCurve.Fp))
{
throw new IOException("Only FPCurves are supported.");
}
return curve.getCurve().decodePoint(encodedPoint.toByteArray());
}
示例2: getX9Parameters
import org.bouncycastle.asn1.x9.ECNamedCurveTable; //导入方法依赖的package包/类
static X9ECParameters getX9Parameters(ASN1ObjectIdentifier curveOID)
{
X9ECParameters x9 = CustomNamedCurves.getByOID(curveOID);
if (x9 == null)
{
x9 = ECNamedCurveTable.getByOID(curveOID);
}
return x9;
}
示例3: createNamedCurveSpec
import org.bouncycastle.asn1.x9.ECNamedCurveTable; //导入方法依赖的package包/类
protected ECNamedCurveSpec createNamedCurveSpec(String curveName)
throws InvalidAlgorithmParameterException
{
// NOTE: Don't bother with custom curves here as the curve will be converted to JCE type shortly
X9ECParameters p = ECUtils.getDomainParametersFromName(curveName);
if (p == null)
{
try
{
// Check whether it's actually an OID string (SunJSSE ServerHandshaker setupEphemeralECDHKeys bug)
p = ECNamedCurveTable.getByOID(new ASN1ObjectIdentifier(curveName));
if (p == null)
{
throw new InvalidAlgorithmParameterException("unknown curve OID: " + curveName);
}
}
catch (IllegalArgumentException ex)
{
throw new InvalidAlgorithmParameterException("unknown curve name: " + curveName);
}
}
// Work-around for JDK bug -- it won't look up named curves properly if seed is present
byte[] seed = null; //p.getSeed();
return new ECNamedCurveSpec(curveName, p.getCurve(), p.getG(), p.getN(), p.getH(), seed);
}