Пример #1
0
		//    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;
		}
Пример #2
0
 public override void Initialize(AlgorithmParameterSpec pars)
 {
     pspec = (DHParameterSpec)pars;
 }
Пример #3
0
		public override void Initialize (AlgorithmParameterSpec pars)
		{
			pspec = (DHParameterSpec) pars;
		}