当前位置: 首页>>代码示例>>Java>>正文


Java ECNamedCurveTable.getByOID方法代码示例

本文整理汇总了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());
}
 
开发者ID:NoYouShutup,项目名称:CryptMeme,代码行数:18,代码来源:ECPublicBCPGKey.java

示例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;
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:11,代码来源:BcUtil.java

示例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);
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:29,代码来源:KeyPairGeneratorSpi.java


注:本文中的org.bouncycastle.asn1.x9.ECNamedCurveTable.getByOID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。