本文整理汇总了Java中java.security.spec.ECPrivateKeySpec.getS方法的典型用法代码示例。如果您正苦于以下问题:Java ECPrivateKeySpec.getS方法的具体用法?Java ECPrivateKeySpec.getS怎么用?Java ECPrivateKeySpec.getS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.security.spec.ECPrivateKeySpec
的用法示例。
在下文中一共展示了ECPrivateKeySpec.getS方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetS
import java.security.spec.ECPrivateKeySpec; //导入方法依赖的package包/类
/**
* Test for <code>getS()</code> method<br>
* Assertion: returns associated private value<br>
* Test preconditions: <code>ECPrivateKeySpec</code> instance
* created using valid parameters<br>
* Expected: must return s value which is equal
* to the one passed to the constructor; (both must refer
* the same object)
*/
public final void testGetS() {
// Valid (see note below) parameters set
EllipticCurve c =
new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
BigInteger.ZERO,
BigInteger.valueOf(4L));
ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
ECParameterSpec params =
new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10);
BigInteger s = BigInteger.valueOf(5L);
ECPrivateKeySpec ks = new ECPrivateKeySpec(s, params);
BigInteger sRet = ks.getS();
assertEquals(s, sRet);
assertSame(s, sRet);
}
示例2: JCEECPrivateKey
import java.security.spec.ECPrivateKeySpec; //导入方法依赖的package包/类
public JCEECPrivateKey(
String algorithm,
ECPrivateKeySpec spec)
{
this.algorithm = algorithm;
this.d = spec.getS();
this.ecSpec = spec.getParams();
}
示例3: BCECPrivateKey
import java.security.spec.ECPrivateKeySpec; //导入方法依赖的package包/类
public BCECPrivateKey(
String algorithm,
ECPrivateKeySpec spec,
ProviderConfiguration configuration)
{
this.algorithm = algorithm;
this.d = spec.getS();
this.ecSpec = spec.getParams();
this.configuration = configuration;
}
示例4: OpenSSLECPrivateKey
import java.security.spec.ECPrivateKeySpec; //导入方法依赖的package包/类
OpenSSLECPrivateKey(ECPrivateKeySpec ecKeySpec) throws InvalidKeySpecException {
try {
group = OpenSSLECGroupContext.getInstance(ecKeySpec.getParams());
final BigInteger privKey = ecKeySpec.getS();
key = new OpenSSLKey(NativeCrypto.EVP_PKEY_new_EC_KEY(group.getNativeRef(), null,
privKey.toByteArray()));
} catch (Exception e) {
throw new InvalidKeySpecException(e);
}
}
示例5: BCDSTU4145PrivateKey
import java.security.spec.ECPrivateKeySpec; //导入方法依赖的package包/类
public BCDSTU4145PrivateKey(
ECPrivateKeySpec spec)
{
this.d = spec.getS();
this.ecSpec = spec.getParams();
}
示例6: BCECGOST3410PrivateKey
import java.security.spec.ECPrivateKeySpec; //导入方法依赖的package包/类
public BCECGOST3410PrivateKey(
ECPrivateKeySpec spec)
{
this.d = spec.getS();
this.ecSpec = spec.getParams();
}