本文整理汇总了Java中org.spongycastle.jce.spec.ECPrivateKeySpec类的典型用法代码示例。如果您正苦于以下问题:Java ECPrivateKeySpec类的具体用法?Java ECPrivateKeySpec怎么用?Java ECPrivateKeySpec使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ECPrivateKeySpec类属于org.spongycastle.jce.spec包,在下文中一共展示了ECPrivateKeySpec类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getSignature
import org.spongycastle.jce.spec.ECPrivateKeySpec; //导入依赖的package包/类
@Override
public byte[] getSignature(byte[] data, PrivateKey privateKey) {
try {
ECParameterSpec spec = new ECParameterSpec(
EC_CURVE_PARAMETERS.getCurve(),
EC_CURVE_PARAMETERS.getG(),
EC_CURVE_PARAMETERS.getN(),
EC_CURVE_PARAMETERS.getH(),
EC_CURVE_PARAMETERS.getSeed()
);
BigInteger d = keyToBigInt(privateKey.getPrivateSigningKey());
KeySpec keySpec = new ECPrivateKeySpec(d, spec);
java.security.PrivateKey privKey = KeyFactory.getInstance(ALGORITHM_ECDSA, provider)
.generatePrivate(keySpec);
Signature sig = Signature.getInstance(ALGORITHM_ECDSA, provider);
sig.initSign(privKey);
sig.update(data);
return sig.sign();
} catch (GeneralSecurityException e) {
throw new ApplicationException(e);
}
}
开发者ID:Dissem,项目名称:Jabit,代码行数:25,代码来源:SpongyCryptography.java
示例2: privateKeyFromBigInteger
import org.spongycastle.jce.spec.ECPrivateKeySpec; //导入依赖的package包/类
private static PrivateKey privateKeyFromBigInteger(BigInteger priv) {
if (priv == null) {
return null;
} else {
try {
return ECKeyFactory
.getInstance(SpongyCastleProvider.getInstance())
.generatePrivate(new ECPrivateKeySpec(priv, CURVE_SPEC));
} catch (InvalidKeySpecException ex) {
throw new AssertionError("Assumed correct key spec statically");
}
}
}
开发者ID:toshiapp,项目名称:toshi-headless-client,代码行数:14,代码来源:ECKey.java
示例3: privateKeyFromBigInteger
import org.spongycastle.jce.spec.ECPrivateKeySpec; //导入依赖的package包/类
private static PrivateKey privateKeyFromBigInteger(BigInteger priv) {
if (priv == null) {
return null;
} else {
try {
return ECKeyFactory
.getInstance(SpongyCastleProvider.getInstance())
.generatePrivate(new ECPrivateKeySpec(priv, CURVE_SPEC));
} catch (InvalidKeySpecException ex) {
throw new AssertionError("Assumed correct key spec statically");
}
}
}
开发者ID:talentchain,项目名称:talchain,代码行数:14,代码来源:ECKey.java
示例4: privateKeyFromBigInteger
import org.spongycastle.jce.spec.ECPrivateKeySpec; //导入依赖的package包/类
private static PrivateKey privateKeyFromBigInteger(BigInteger priv) {
if (priv == null) {
return null;
} else {
try {
return ECKeyFactory.getInstance(SpongyCastleProvider.getInstance())
.generatePrivate(new ECPrivateKeySpec(priv, CURVE_SPEC));
} catch (InvalidKeySpecException ex) {
throw new AssertionError("Assumed correct key spec statically");
}
}
}
开发者ID:Aptoide,项目名称:AppCoins-ethereumj,代码行数:13,代码来源:ECKey.java
示例5: loadPrivateKey
import org.spongycastle.jce.spec.ECPrivateKeySpec; //导入依赖的package包/类
private PrivateKey loadPrivateKey(byte[] data) throws InvalidKeySpecException {
ECPrivateKeySpec prvkey = new ECPrivateKeySpec(new BigInteger(1, data), params);
return kf.generatePrivate(prvkey);
}
开发者ID:SamouraiDev,项目名称:BIP47_RPC,代码行数:5,代码来源:SecretPoint.java
注:本文中的org.spongycastle.jce.spec.ECPrivateKeySpec类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论