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


Java ECPrivateKeyParameters.getD方法代码示例

本文整理汇总了Java中org.bouncycastle.crypto.params.ECPrivateKeyParameters.getD方法的典型用法代码示例。如果您正苦于以下问题:Java ECPrivateKeyParameters.getD方法的具体用法?Java ECPrivateKeyParameters.getD怎么用?Java ECPrivateKeyParameters.getD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bouncycastle.crypto.params.ECPrivateKeyParameters的用法示例。


在下文中一共展示了ECPrivateKeyParameters.getD方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: JCEECPrivateKey

import org.bouncycastle.crypto.params.ECPrivateKeyParameters; //导入方法依赖的package包/类
JCEECPrivateKey(
    String                  algorithm,
    ECPrivateKeyParameters  params,
    ECParameterSpec         spec)
{
    ECDomainParameters      dp = params.getParameters();

    this.algorithm = algorithm;
    this.d = params.getD();

    if (spec == null)
    {
        this.ecSpec = new ECParameterSpec(
                        dp.getCurve(),
                        dp.getG(),
                        dp.getN(),
                        dp.getH(),
                        dp.getSeed());
    }
    else
    {
        this.ecSpec = spec;
    }
}
 
开发者ID:thangbn,项目名称:Direct-File-Downloader,代码行数:25,代码来源:JCEECPrivateKey.java

示例2: JCEECPrivateKey

import org.bouncycastle.crypto.params.ECPrivateKeyParameters; //导入方法依赖的package包/类
public JCEECPrivateKey(
    String                  algorithm,
    ECPrivateKeyParameters  params,
    JCEECPublicKey          pubKey,
    ECParameterSpec         spec)
{
    ECDomainParameters      dp = params.getParameters();

    this.algorithm = algorithm;
    this.d = params.getD();

    if (spec == null)
    {
        EllipticCurve ellipticCurve = EC5Util.convertCurve(dp.getCurve(), dp.getSeed());

        this.ecSpec = new ECParameterSpec(
                        ellipticCurve,
                        new ECPoint(
                                dp.getG().getX().toBigInteger(),
                                dp.getG().getY().toBigInteger()),
                        dp.getN(),
                        dp.getH().intValue());
    }
    else
    {
        this.ecSpec = spec;
    }

    publicKey = getPublicKeyDetails(pubKey);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:31,代码来源:JCEECPrivateKey.java

示例3: BCDSTU4145PrivateKey

import org.bouncycastle.crypto.params.ECPrivateKeyParameters; //导入方法依赖的package包/类
public BCDSTU4145PrivateKey(
    String algorithm,
    ECPrivateKeyParameters params,
    BCDSTU4145PublicKey pubKey,
    ECParameterSpec spec)
{
    ECDomainParameters dp = params.getParameters();

    this.algorithm = algorithm;
    this.d = params.getD();

    if (spec == null)
    {
        EllipticCurve ellipticCurve = EC5Util.convertCurve(dp.getCurve(), dp.getSeed());

        this.ecSpec = new ECParameterSpec(
            ellipticCurve,
            new ECPoint(
                dp.getG().getX().toBigInteger(),
                dp.getG().getY().toBigInteger()),
            dp.getN(),
            dp.getH().intValue());
    }
    else
    {
        this.ecSpec = spec;
    }

    publicKey = getPublicKeyDetails(pubKey);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:31,代码来源:BCDSTU4145PrivateKey.java

示例4: BCECPrivateKey

import org.bouncycastle.crypto.params.ECPrivateKeyParameters; //导入方法依赖的package包/类
public BCECPrivateKey(
    String algorithm,
    ECPrivateKeyParameters params,
    BCECPublicKey pubKey,
    ECParameterSpec spec,
    ProviderConfiguration configuration)
{
    ECDomainParameters      dp = params.getParameters();

    this.algorithm = algorithm;
    this.d = params.getD();
    this.configuration = configuration;

    if (spec == null)
    {
        EllipticCurve ellipticCurve = EC5Util.convertCurve(dp.getCurve(), dp.getSeed());

        this.ecSpec = new ECParameterSpec(
                        ellipticCurve,
                        new ECPoint(
                                dp.getG().getX().toBigInteger(),
                                dp.getG().getY().toBigInteger()),
                        dp.getN(),
                        dp.getH().intValue());
    }
    else
    {
        this.ecSpec = spec;
    }

    publicKey = getPublicKeyDetails(pubKey);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:33,代码来源:BCECPrivateKey.java

示例5: BCECGOST3410PrivateKey

import org.bouncycastle.crypto.params.ECPrivateKeyParameters; //导入方法依赖的package包/类
public BCECGOST3410PrivateKey(
    String algorithm,
    ECPrivateKeyParameters params,
    BCECGOST3410PublicKey pubKey,
    ECParameterSpec spec)
{
    ECDomainParameters      dp = params.getParameters();

    this.algorithm = algorithm;
    this.d = params.getD();

    if (spec == null)
    {
        EllipticCurve ellipticCurve = EC5Util.convertCurve(dp.getCurve(), dp.getSeed());

        this.ecSpec = new ECParameterSpec(
                        ellipticCurve,
                        new ECPoint(
                                dp.getG().getX().toBigInteger(),
                                dp.getG().getY().toBigInteger()),
                        dp.getN(),
                        dp.getH().intValue());
    }
    else
    {
        this.ecSpec = spec;
    }

    publicKey = getPublicKeyDetails(pubKey);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:31,代码来源:BCECGOST3410PrivateKey.java

示例6: initEnc

import org.bouncycastle.crypto.params.ECPrivateKeyParameters; //导入方法依赖的package包/类
public ECPoint initEnc(SM2 sm2, ECPoint userKey) {
    AsymmetricCipherKeyPair key = sm2.ecc_key_pair_generator.generateKeyPair();
    ECPrivateKeyParameters ecpriv = (ECPrivateKeyParameters) key.getPrivate();
    ECPublicKeyParameters ecpub = (ECPublicKeyParameters) key.getPublic();
    BigInteger k = ecpriv.getD();
    ECPoint c1 = ecpub.getQ();
    this.p2 = userKey.multiply(k);
    reset();
    return c1;
}
 
开发者ID:nuls-io,项目名称:nuls,代码行数:11,代码来源:Cipher.java

示例7: createNew

import org.bouncycastle.crypto.params.ECPrivateKeyParameters; //导入方法依赖的package包/类
/**
 * Create a new PrivateKey using the platform provided secure random source.
 *
 * @param compressed set to false if you relly want legacy format
 * @return new PrivateKey
 */
public static PrivateKey createNew(boolean compressed) {
    ECKeyPairGenerator generator = new ECKeyPairGenerator();
    ECKeyGenerationParameters keygenParams = new ECKeyGenerationParameters(domain, secureRandom);
    generator.init(keygenParams);
    AsymmetricCipherKeyPair keypair = generator.generateKeyPair();
    ECPrivateKeyParameters privParams = (ECPrivateKeyParameters) keypair.getPrivate();
    ECPublicKeyParameters pubParams = (ECPublicKeyParameters) keypair.getPublic();
    return new PrivateKey(privParams.getD(), compressed, pubParams.getQ().getEncoded(compressed));
}
 
开发者ID:DigitalAssetCom,项目名称:-deprecated-hlp-candidate,代码行数:16,代码来源:PrivateKey.java

示例8: JCEECPrivateKey

import org.bouncycastle.crypto.params.ECPrivateKeyParameters; //导入方法依赖的package包/类
public JCEECPrivateKey(
    String                  algorithm,
    ECPrivateKeyParameters  params,
    JCEECPublicKey          pubKey,
    ECParameterSpec         spec)
{
    ECDomainParameters      dp = params.getParameters();

    this.algorithm = algorithm;
    this.d = params.getD();

    if (spec == null)
    {
        EllipticCurve ellipticCurve = EC5Util.convertCurve(dp.getCurve(), dp.getSeed());

        this.ecSpec = new ECParameterSpec(
                        ellipticCurve,
                        new ECPoint(
                                dp.getG().getAffineXCoord().toBigInteger(),
                                dp.getG().getAffineYCoord().toBigInteger()),
                        dp.getN(),
                        dp.getH().intValue());
    }
    else
    {
        this.ecSpec = spec;
    }

    publicKey = getPublicKeyDetails(pubKey);
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:31,代码来源:JCEECPrivateKey.java

示例9: BCDSTU4145PrivateKey

import org.bouncycastle.crypto.params.ECPrivateKeyParameters; //导入方法依赖的package包/类
public BCDSTU4145PrivateKey(
    String algorithm,
    ECPrivateKeyParameters params,
    BCDSTU4145PublicKey pubKey,
    ECParameterSpec spec)
{
    ECDomainParameters dp = params.getParameters();

    this.algorithm = algorithm;
    this.d = params.getD();

    if (spec == null)
    {
        EllipticCurve ellipticCurve = EC5Util.convertCurve(dp.getCurve(), dp.getSeed());

        this.ecSpec = new ECParameterSpec(
            ellipticCurve,
            new ECPoint(
                dp.getG().getAffineXCoord().toBigInteger(),
                dp.getG().getAffineYCoord().toBigInteger()),
            dp.getN(),
            dp.getH().intValue());
    }
    else
    {
        this.ecSpec = spec;
    }

    publicKey = getPublicKeyDetails(pubKey);
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:31,代码来源:BCDSTU4145PrivateKey.java

示例10: BCECPrivateKey

import org.bouncycastle.crypto.params.ECPrivateKeyParameters; //导入方法依赖的package包/类
public BCECPrivateKey(
    String algorithm,
    ECPrivateKeyParameters params,
    BCECPublicKey pubKey,
    ECParameterSpec spec,
    ProviderConfiguration configuration)
{
    ECDomainParameters      dp = params.getParameters();

    this.algorithm = algorithm;
    this.d = params.getD();
    this.configuration = configuration;

    if (spec == null)
    {
        EllipticCurve ellipticCurve = EC5Util.convertCurve(dp.getCurve(), dp.getSeed());

        this.ecSpec = new ECParameterSpec(
                        ellipticCurve,
                        new ECPoint(
                                dp.getG().getAffineXCoord().toBigInteger(),
                                dp.getG().getAffineYCoord().toBigInteger()),
                        dp.getN(),
                        dp.getH().intValue());
    }
    else
    {
        this.ecSpec = spec;
    }

    publicKey = getPublicKeyDetails(pubKey);
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:33,代码来源:BCECPrivateKey.java

示例11: BCECGOST3410PrivateKey

import org.bouncycastle.crypto.params.ECPrivateKeyParameters; //导入方法依赖的package包/类
public BCECGOST3410PrivateKey(
    String algorithm,
    ECPrivateKeyParameters params,
    BCECGOST3410PublicKey pubKey,
    ECParameterSpec spec)
{
    ECDomainParameters dp = params.getParameters();

    this.algorithm = algorithm;
    this.d = params.getD();

    if (spec == null)
    {
        EllipticCurve ellipticCurve = EC5Util.convertCurve(dp.getCurve(), dp.getSeed());

        this.ecSpec = new ECParameterSpec(
            ellipticCurve,
            new ECPoint(
                dp.getG().getAffineXCoord().toBigInteger(),
                dp.getG().getAffineYCoord().toBigInteger()),
            dp.getN(),
            dp.getH().intValue());
    }
    else
    {
        this.ecSpec = spec;
    }

    this.gostParams = pubKey.getGostParams();

    publicKey = getPublicKeyDetails(pubKey);
}
 
开发者ID:thedrummeraki,项目名称:Aki-SSL,代码行数:33,代码来源:BCECGOST3410PrivateKey.java

示例12: ECKey

import org.bouncycastle.crypto.params.ECPrivateKeyParameters; //导入方法依赖的package包/类
/**
 * Creates an ECKey with a new public/private key pair.  Point compression is used
 * so the resulting public key will be 33 bytes (32 bytes for the x-coordinate and
 * 1 byte to represent the y-coordinate sign)
 */
public ECKey() {
    ECKeyPairGenerator keyGenerator = new ECKeyPairGenerator();
    ECKeyGenerationParameters keyGenParams = new ECKeyGenerationParameters(ecParams, secureRandom);
    keyGenerator.init(keyGenParams);
    AsymmetricCipherKeyPair keyPair = keyGenerator.generateKeyPair();
    ECPrivateKeyParameters privKeyParams = (ECPrivateKeyParameters)keyPair.getPrivate();
    ECPublicKeyParameters pubKeyParams = (ECPublicKeyParameters)keyPair.getPublic();
    privKey = privKeyParams.getD();
    pubKey = pubKeyParams.getQ().getEncoded(true);
    creationTime = System.currentTimeMillis()/1000;
    isCompressed = true;
}
 
开发者ID:ScripterRon,项目名称:BitcoinCore,代码行数:18,代码来源:ECKey.java

示例13: createNew

import org.bouncycastle.crypto.params.ECPrivateKeyParameters; //导入方法依赖的package包/类
public static ECKeyPair createNew (boolean compressed)
{
	ECKeyPairGenerator generator = new ECKeyPairGenerator ();
	ECKeyGenerationParameters keygenParams = new ECKeyGenerationParameters (domain, secureRandom);
	generator.init (keygenParams);
	AsymmetricCipherKeyPair keypair = generator.generateKeyPair ();
	ECPrivateKeyParameters privParams = (ECPrivateKeyParameters) keypair.getPrivate ();
	ECPublicKeyParameters pubParams = (ECPublicKeyParameters) keypair.getPublic ();
	ECKeyPair k = new ECKeyPair ();
	k.priv = privParams.getD ();
	k.compressed = compressed;
	k.pub = pubParams.getQ ().getEncoded (compressed);
	return k;
}
 
开发者ID:bitsofproof,项目名称:bop-bitcoin-client,代码行数:15,代码来源:ECKeyPair.java

示例14: BCECPrivateKey

import org.bouncycastle.crypto.params.ECPrivateKeyParameters; //导入方法依赖的package包/类
public BCECPrivateKey(
    String                  algorithm,
    ECPrivateKeyParameters  params,
    ProviderConfiguration   configuration)
{
    this.algorithm = algorithm;
    this.d = params.getD();
    this.ecSpec = null;
    this.configuration = configuration;
}
 
开发者ID:mlundblad,项目名称:bc-java,代码行数:11,代码来源:BCECPrivateKey.java

示例15: JCEECPrivateKey

import org.bouncycastle.crypto.params.ECPrivateKeyParameters; //导入方法依赖的package包/类
public JCEECPrivateKey(
    String                  algorithm,
    ECPrivateKeyParameters  params)
{
    this.algorithm = algorithm;
    this.d = params.getD();
    this.ecSpec = null;
}
 
开发者ID:credentials,项目名称:irma_future_id,代码行数:9,代码来源:JCEECPrivateKey.java


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