本文整理汇总了Java中org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util.convertPoint方法的典型用法代码示例。如果您正苦于以下问题:Java EC5Util.convertPoint方法的具体用法?Java EC5Util.convertPoint怎么用?Java EC5Util.convertPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util
的用法示例。
在下文中一共展示了EC5Util.convertPoint方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JCEECPublicKey
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入方法依赖的package包/类
public JCEECPublicKey(
String algorithm,
ECPublicKeySpec spec)
{
this.algorithm = algorithm;
this.ecSpec = spec.getParams();
this.q = EC5Util.convertPoint(ecSpec, spec.getW(), false);
}
示例2: BCDSTU4145PublicKey
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入方法依赖的package包/类
public BCDSTU4145PublicKey(
ECPublicKey key)
{
this.algorithm = key.getAlgorithm();
this.ecSpec = key.getParams();
this.q = EC5Util.convertPoint(this.ecSpec, key.getW(), false);
}
示例3: BCECPublicKey
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入方法依赖的package包/类
public BCECPublicKey(
String algorithm,
ECPublicKeySpec spec,
ProviderConfiguration configuration)
{
this.algorithm = algorithm;
this.ecSpec = spec.getParams();
this.q = EC5Util.convertPoint(ecSpec, spec.getW(), false);
this.configuration = configuration;
}
示例4: BCECGOST3410PublicKey
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入方法依赖的package包/类
public BCECGOST3410PublicKey(
ECPublicKey key)
{
this.algorithm = key.getAlgorithm();
this.ecSpec = key.getParams();
this.q = EC5Util.convertPoint(this.ecSpec, key.getW(), false);
}
示例5: createKeyGenParamsJCE
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入方法依赖的package包/类
protected ECKeyGenerationParameters createKeyGenParamsJCE(java.security.spec.ECParameterSpec p, SecureRandom r)
{
ECCurve curve = EC5Util.convertCurve(p.getCurve());
ECPoint g = EC5Util.convertPoint(curve, p.getGenerator(), false);
BigInteger n = p.getOrder();
BigInteger h = BigInteger.valueOf(p.getCofactor());
ECDomainParameters dp = new ECDomainParameters(curve, g, n, h);
return new ECKeyGenerationParameters(dp, r);
}
示例6: toBCECPublicKey
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入方法依赖的package包/类
/**
* Method to convert a EC public key to a BCECPublicKey
* @param alg specifying the related curve used.
* @param ecPublicKey key to convert
* @return a BCECPublicKey
* @throws InvalidKeySpecException if supplied key was invalid.
*/
@Override
public BCECPublicKey toBCECPublicKey(AlgorithmIndicator alg, java.security.interfaces.ECPublicKey ecPublicKey) throws InvalidKeySpecException{
if(ecPublicKey instanceof BCECPublicKey){
return (BCECPublicKey) ecPublicKey;
}
org.bouncycastle.math.ec.ECPoint ecPoint = EC5Util.convertPoint(getECCurve(alg), ecPublicKey.getW(), false);
ECPublicKeySpec keySpec = new ECPublicKeySpec(ecPoint, getECParameterSpec(alg));
return (BCECPublicKey) keyFact.generatePublic(keySpec);
}
示例7: convertECPublicKeyToBCECPublicKey
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入方法依赖的package包/类
protected BCECPublicKey convertECPublicKeyToBCECPublicKey(AlgorithmIndicator alg, java.security.interfaces.ECPublicKey ecPublicKey) throws InvalidKeySpecException{
if(ecPublicKey instanceof BCECPublicKey){
return (BCECPublicKey) ecPublicKey;
}
org.bouncycastle.math.ec.ECPoint ecPoint = EC5Util.convertPoint(getECCurve(alg), ecPublicKey.getW(), false);
ECPublicKeySpec keySpec = new ECPublicKeySpec(ecPoint, getECParameterSpec(alg));
return (BCECPublicKey) keyFact.generatePublic(keySpec);
}
示例8: calculateECDHGenericMapping
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入方法依赖的package包/类
/**
* Performs a G-Circumflex mapping of a nonce and a shared secret to a curve reference
*
* @param nonce the random nonce to use
* @param sharedSecret the shared secret point
* @param curveReference the curve to map against
* @return the mapped point on the curve
*/
public static byte[] calculateECDHGenericMapping(byte[] nonce, byte[] sharedSecret, EllipticCurveParameters curveReference) {
final ECParameterSpec curveParams = EllipticCurveParameters.encodeECParameterSpec(curveReference);
org.bouncycastle.math.ec.ECCurve curve = EC5Util.convertCurve(curveParams.getCurve());
org.bouncycastle.math.ec.ECPoint generator = EC5Util.convertPoint(curveParams, curveParams.getGenerator(), false);
org.bouncycastle.math.ec.ECPoint secretPoint = curve.decodePoint(sharedSecret);
//interpret nonce as positive number
BigInteger nonceInteger = new BigInteger(1, nonce);
org.bouncycastle.math.ec.ECPoint G = generator.multiply(nonceInteger).add(secretPoint);
// first byte 04 that represents 'uncompressed format'?
return G.getEncoded();
//return new ECPoint(generator.getAffineXCoord().toBigInteger(), generator.getAffineYCoord().toBigInteger());
}