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


Java EC5Util.convertPoint方法代码示例

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

示例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);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:8,代码来源:BCDSTU4145PublicKey.java

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

示例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);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:8,代码来源:BCECGOST3410PublicKey.java

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

示例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);

}
 
开发者ID:pvendil,项目名称:c2c-common,代码行数:20,代码来源:DefaultCryptoManager.java

示例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);

}
 
开发者ID:pvendil,项目名称:c2c-common,代码行数:12,代码来源:DefaultCryptoManager.java

示例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());
}
 
开发者ID:mDL-ILP,项目名称:mDL-ILP,代码行数:28,代码来源:ECCUtils.java


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