// myKeyAgree=KeyAgreement.getInstance("DiffieHellman"); /// <exception cref="System.Exception"></exception> public virtual byte[] GetE() { if (e == null) { DHParameterSpec dhSkipParamSpec = new DHParameterSpec(p, g); myKpairGen.Initialize(dhSkipParamSpec); Sharpen.KeyPair myKpair = myKpairGen.GenerateKeyPair(); myKeyAgree.Init(myKpair.GetPrivate()); // BigInteger x=((javax.crypto.interfaces.DHPrivateKey)(myKpair.getPrivate())).getX(); e = ((DHPublicKey)(myKpair.GetPublic())).GetY(); e_array = e.GetBytes(); } return e_array; }
public override void Initialize(AlgorithmParameterSpec pars) { pspec = (DHParameterSpec)pars; }
public override void Initialize (AlgorithmParameterSpec pars) { pspec = (DHParameterSpec) pars; }