本文整理汇总了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;
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}