本文整理汇总了Java中org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util类的典型用法代码示例。如果您正苦于以下问题:Java EC5Util类的具体用法?Java EC5Util怎么用?Java EC5Util使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EC5Util类属于org.bouncycastle.jcajce.provider.asymmetric.util包,在下文中一共展示了EC5Util类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JCEECPrivateKey
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入依赖的package包/类
public JCEECPrivateKey(
String algorithm,
org.bouncycastle.jce.spec.ECPrivateKeySpec spec)
{
this.algorithm = algorithm;
this.d = spec.getD();
if (spec.getParams() != null) // can be null if implicitlyCA
{
ECCurve curve = spec.getParams().getCurve();
EllipticCurve ellipticCurve;
ellipticCurve = EC5Util.convertCurve(curve, spec.getParams().getSeed());
this.ecSpec = EC5Util.convertSpec(ellipticCurve, spec.getParams());
}
else
{
this.ecSpec = null;
}
}
示例2: JCEECPublicKey
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入依赖的package包/类
public JCEECPublicKey(
String algorithm,
org.bouncycastle.jce.spec.ECPublicKeySpec spec)
{
this.algorithm = algorithm;
this.q = spec.getQ();
if (spec.getParams() != null) // can be null if implictlyCa
{
ECCurve curve = spec.getParams().getCurve();
EllipticCurve ellipticCurve = EC5Util.convertCurve(curve, spec.getParams().getSeed());
this.ecSpec = EC5Util.convertSpec(ellipticCurve, spec.getParams());
}
else
{
if (q.getCurve() == null)
{
org.bouncycastle.jce.spec.ECParameterSpec s = BouncyCastleProvider.CONFIGURATION.getEcImplicitlyCa();
q = s.getCurve().createPoint(q.getX().toBigInteger(), q.getY().toBigInteger(), false);
}
this.ecSpec = null;
}
}
示例3: BCDSTU4145PrivateKey
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入依赖的package包/类
public BCDSTU4145PrivateKey(
org.bouncycastle.jce.spec.ECPrivateKeySpec spec)
{
this.d = spec.getD();
if (spec.getParams() != null) // can be null if implicitlyCA
{
ECCurve curve = spec.getParams().getCurve();
EllipticCurve ellipticCurve;
ellipticCurve = EC5Util.convertCurve(curve, spec.getParams().getSeed());
this.ecSpec = EC5Util.convertSpec(ellipticCurve, spec.getParams());
}
else
{
this.ecSpec = null;
}
}
示例4: BCDSTU4145PublicKey
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入依赖的package包/类
public BCDSTU4145PublicKey(
org.bouncycastle.jce.spec.ECPublicKeySpec spec)
{
this.q = spec.getQ();
if (spec.getParams() != null) // can be null if implictlyCa
{
ECCurve curve = spec.getParams().getCurve();
EllipticCurve ellipticCurve = EC5Util.convertCurve(curve, spec.getParams().getSeed());
this.ecSpec = EC5Util.convertSpec(ellipticCurve, spec.getParams());
}
else
{
if (q.getCurve() == null)
{
org.bouncycastle.jce.spec.ECParameterSpec s = BouncyCastleProvider.CONFIGURATION.getEcImplicitlyCa();
q = s.getCurve().createPoint(q.getX().toBigInteger(), q.getY().toBigInteger(), false);
}
this.ecSpec = null;
}
}
示例5: BCECPrivateKey
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入依赖的package包/类
public BCECPrivateKey(
String algorithm,
org.bouncycastle.jce.spec.ECPrivateKeySpec spec,
ProviderConfiguration configuration)
{
this.algorithm = algorithm;
this.d = spec.getD();
if (spec.getParams() != null) // can be null if implicitlyCA
{
ECCurve curve = spec.getParams().getCurve();
EllipticCurve ellipticCurve;
ellipticCurve = EC5Util.convertCurve(curve, spec.getParams().getSeed());
this.ecSpec = EC5Util.convertSpec(ellipticCurve, spec.getParams());
}
else
{
this.ecSpec = null;
}
this.configuration = configuration;
}
示例6: BCECPublicKey
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入依赖的package包/类
public BCECPublicKey(
String algorithm,
ECPublicKeyParameters params,
ECParameterSpec spec,
ProviderConfiguration configuration)
{
ECDomainParameters dp = params.getParameters();
this.algorithm = algorithm;
this.q = params.getQ();
if (spec == null)
{
EllipticCurve ellipticCurve = EC5Util.convertCurve(dp.getCurve(), dp.getSeed());
this.ecSpec = createSpec(ellipticCurve, dp);
}
else
{
this.ecSpec = spec;
}
this.configuration = configuration;
}
示例7: BCECGOST3410PrivateKey
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入依赖的package包/类
public BCECGOST3410PrivateKey(
org.bouncycastle.jce.spec.ECPrivateKeySpec spec)
{
this.d = spec.getD();
if (spec.getParams() != null) // can be null if implicitlyCA
{
ECCurve curve = spec.getParams().getCurve();
EllipticCurve ellipticCurve;
ellipticCurve = EC5Util.convertCurve(curve, spec.getParams().getSeed());
this.ecSpec = EC5Util.convertSpec(ellipticCurve, spec.getParams());
}
else
{
this.ecSpec = null;
}
}
示例8: BCECGOST3410PublicKey
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入依赖的package包/类
public BCECGOST3410PublicKey(
org.bouncycastle.jce.spec.ECPublicKeySpec spec)
{
this.q = spec.getQ();
if (spec.getParams() != null) // can be null if implictlyCa
{
ECCurve curve = spec.getParams().getCurve();
EllipticCurve ellipticCurve = EC5Util.convertCurve(curve, spec.getParams().getSeed());
this.ecSpec = EC5Util.convertSpec(ellipticCurve, spec.getParams());
}
else
{
if (q.getCurve() == null)
{
org.bouncycastle.jce.spec.ECParameterSpec s = BouncyCastleProvider.CONFIGURATION.getEcImplicitlyCa();
q = s.getCurve().createPoint(q.getX().toBigInteger(), q.getY().toBigInteger(), false);
}
this.ecSpec = null;
}
}
示例9: JCEECPublicKey
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入依赖的package包/类
public JCEECPublicKey(
String algorithm,
org.bouncycastle.jce.spec.ECPublicKeySpec spec)
{
this.algorithm = algorithm;
this.q = spec.getQ();
if (spec.getParams() != null) // can be null if implictlyCa
{
ECCurve curve = spec.getParams().getCurve();
EllipticCurve ellipticCurve = EC5Util.convertCurve(curve, spec.getParams().getSeed());
this.ecSpec = EC5Util.convertSpec(ellipticCurve, spec.getParams());
}
else
{
if (q.getCurve() == null)
{
org.bouncycastle.jce.spec.ECParameterSpec s = BouncyCastleProvider.CONFIGURATION.getEcImplicitlyCa();
q = s.getCurve().createPoint(q.getAffineXCoord().toBigInteger(), q.getAffineYCoord().toBigInteger(), false);
}
this.ecSpec = null;
}
}
示例10: BCDSTU4145PublicKey
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入依赖的package包/类
public BCDSTU4145PublicKey(
org.bouncycastle.jce.spec.ECPublicKeySpec spec)
{
this.q = spec.getQ();
if (spec.getParams() != null) // can be null if implictlyCa
{
ECCurve curve = spec.getParams().getCurve();
EllipticCurve ellipticCurve = EC5Util.convertCurve(curve, spec.getParams().getSeed());
this.ecSpec = EC5Util.convertSpec(ellipticCurve, spec.getParams());
}
else
{
if (q.getCurve() == null)
{
org.bouncycastle.jce.spec.ECParameterSpec s = BouncyCastleProvider.CONFIGURATION.getEcImplicitlyCa();
q = s.getCurve().createPoint(q.getAffineXCoord().toBigInteger(), q.getAffineYCoord().toBigInteger());
}
this.ecSpec = null;
}
}
示例11: engineInit
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入依赖的package包/类
@Override
protected void engineInit(AlgorithmParameterSpec algorithmParameterSpec)
throws InvalidParameterSpecException
{
if (algorithmParameterSpec instanceof ECGenParameterSpec)
{
ECGenParameterSpec ecGenParameterSpec = (ECGenParameterSpec)algorithmParameterSpec;
X9ECParameters params = ECUtils.getDomainParametersFromGenSpec(ecGenParameterSpec);
if (params == null)
{
throw new InvalidParameterSpecException("EC curve name not recognized: " + ecGenParameterSpec.getName());
}
curveName = ecGenParameterSpec.getName();
ecParameterSpec = EC5Util.convertToSpec(params);
}
else if (algorithmParameterSpec instanceof ECParameterSpec)
{
curveName = null;
ecParameterSpec = (ECParameterSpec)algorithmParameterSpec;
}
else
{
throw new InvalidParameterSpecException("AlgorithmParameterSpec class not recognized: " + algorithmParameterSpec.getClass().getName());
}
}
示例12: populateFromPrivKeyInfo
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入依赖的package包/类
private void populateFromPrivKeyInfo(PrivateKeyInfo info)
throws IOException
{
X962Parameters params = X962Parameters.getInstance(info.getPrivateKeyAlgorithm().getParameters());
ECCurve curve = EC5Util.getCurve(configuration, params);
ecSpec = EC5Util.convertToSpec(params, curve);
ASN1Encodable privKey = info.parsePrivateKey();
if (privKey instanceof ASN1Integer)
{
ASN1Integer derD = ASN1Integer.getInstance(privKey);
this.d = derD.getValue();
}
else
{
org.bouncycastle.asn1.sec.ECPrivateKey ec = org.bouncycastle.asn1.sec.ECPrivateKey.getInstance(privKey);
this.d = ec.getKey();
this.publicKey = ec.getPublicKey();
}
}
示例13: BCECGOST3410PublicKey
import org.bouncycastle.jcajce.provider.asymmetric.util.EC5Util; //导入依赖的package包/类
public BCECGOST3410PublicKey(
org.bouncycastle.jce.spec.ECPublicKeySpec spec)
{
this.q = spec.getQ();
if (spec.getParams() != null) // can be null if implictlyCa
{
ECCurve curve = spec.getParams().getCurve();
EllipticCurve ellipticCurve = EC5Util.convertCurve(curve, spec.getParams().getSeed());
this.ecSpec = EC5Util.convertSpec(ellipticCurve, spec.getParams());
}
else
{
if (q.getCurve() == null)
{
org.bouncycastle.jce.spec.ECParameterSpec s = BouncyCastleProvider.CONFIGURATION.getEcImplicitlyCa();
q = s.getCurve().createPoint(q.getAffineXCoord().toBigInteger(), q.getAffineYCoord().toBigInteger());
}
this.ecSpec = null;
}
}