本文整理汇总了Java中org.bouncycastle.jce.spec.ECParameterSpec.getCurve方法的典型用法代码示例。如果您正苦于以下问题:Java ECParameterSpec.getCurve方法的具体用法?Java ECParameterSpec.getCurve怎么用?Java ECParameterSpec.getCurve使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.jce.spec.ECParameterSpec
的用法示例。
在下文中一共展示了ECParameterSpec.getCurve方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generatePublicKeyParameter
import org.bouncycastle.jce.spec.ECParameterSpec; //导入方法依赖的package包/类
static public AsymmetricKeyParameter generatePublicKeyParameter(
PublicKey key)
throws InvalidKeyException
{
if (key instanceof ECPublicKey)
{
ECPublicKey k = (ECPublicKey)key;
ECParameterSpec s = k.getParams();
return new ECPublicKeyParameters(
k.getQ(),
new ECDomainParameters(s.getCurve(), s.getG(), s.getN()));
}
throw new InvalidKeyException("can't identify EC public key.");
}
示例2: generatePrivateKeyParameter
import org.bouncycastle.jce.spec.ECParameterSpec; //导入方法依赖的package包/类
static public AsymmetricKeyParameter generatePrivateKeyParameter(
PrivateKey key)
throws InvalidKeyException
{
if (key instanceof ECPrivateKey)
{
ECPrivateKey k = (ECPrivateKey)key;
ECParameterSpec s = k.getParams();
return new ECPrivateKeyParameters(
k.getD(),
new ECDomainParameters(s.getCurve(), s.getG(), s.getN()));
}
throw new InvalidKeyException("can't identify EC private key.");
}
示例3: generatePrivateKeyParameter
import org.bouncycastle.jce.spec.ECParameterSpec; //导入方法依赖的package包/类
public static AsymmetricKeyParameter generatePrivateKeyParameter(
PrivateKey key)
throws InvalidKeyException
{
if (key instanceof ECPrivateKey)
{
ECPrivateKey k = (ECPrivateKey)key;
ECParameterSpec s = k.getParameters();
if (s == null)
{
s = BouncyCastleProvider.CONFIGURATION.getEcImplicitlyCa();
}
return new ECPrivateKeyParameters(
k.getD(),
new ECDomainParameters(s.getCurve(), s.getG(), s.getN(), s.getH(), s.getSeed()));
}
throw new InvalidKeyException("can't identify EC private key.");
}
示例4: generatePublicKeyParameter
import org.bouncycastle.jce.spec.ECParameterSpec; //导入方法依赖的package包/类
public static AsymmetricKeyParameter generatePublicKeyParameter(
PublicKey key)
throws InvalidKeyException
{
if (key instanceof ECPublicKey)
{
ECPublicKey k = (ECPublicKey)key;
ECParameterSpec s = k.getParameters();
if (s == null)
{
s = BouncyCastleProvider.CONFIGURATION.getEcImplicitlyCa();
return new ECPublicKeyParameters(
((BCECPublicKey)k).engineGetQ(),
new ECDomainParameters(s.getCurve(), s.getG(), s.getN(), s.getH(), s.getSeed()));
}
else
{
return new ECPublicKeyParameters(
k.getQ(),
new ECDomainParameters(s.getCurve(), s.getG(), s.getN(), s.getH(), s.getSeed()));
}
}
throw new InvalidKeyException("cannot identify EC public key.");
}
示例5: createKeyGenParamsBC
import org.bouncycastle.jce.spec.ECParameterSpec; //导入方法依赖的package包/类
protected ECKeyGenerationParameters createKeyGenParamsBC(ECParameterSpec p, SecureRandom r)
{
return new ECKeyGenerationParameters(new ECDomainParameters(p.getCurve(), p.getG(), p.getN()), r);
}
示例6: PaceECDH
import org.bouncycastle.jce.spec.ECParameterSpec; //导入方法依赖的package包/类
public PaceECDH(ECParameterSpec ecParameterSpec) {
pointG = ecParameterSpec.getG();
logger.debug("Point G:\n"+HexString.bufferToHex(pointG.getEncoded(false)));
curve = (org.bouncycastle.math.ec.ECCurve.Fp) ecParameterSpec.getCurve();
Random rnd = new Random();
randomGenerator.setSeed(rnd.nextLong());
}
示例7: ChipAuthenticationECDH
import org.bouncycastle.jce.spec.ECParameterSpec; //导入方法依赖的package包/类
public ChipAuthenticationECDH(ECParameterSpec ecp) {
curve = (org.bouncycastle.math.ec.ECCurve.Fp) ecp.getCurve();
}