예제 #1
0
  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);
  }
예제 #2
0
 public JCEECPrivateKey(String algorithm, ECPrivateKeyParameters params) {
   this.algorithm = algorithm;
   this.d = params.getD();
   this.ecSpec = null;
 }