コード例 #1
0
        /// <summary>
        /// Creates the private key.
        /// </summary>
        /// <param name="publicKey">The public key.</param>
        /// <returns></returns>
        public DiffieHellmanKey CreatePrivateKey(DiffieHellmanKey publicKey)
        {
            var yother = new BigInteger(publicKey.ToByteArray());

            return(new DiffieHellmanKey(_prime, _g, yother.ModPow(_secret, _prime)));
        }
コード例 #2
0
 /// <summary>
 /// Creates the private key.
 /// </summary>
 /// <param name="publicKey">The public key.</param>
 /// <returns></returns>
 public DiffieHellmanKey CreatePrivateKey(DiffieHellmanKey publicKey)
 {
     var yother = new BigInteger(publicKey.ToByteArray());
     return new DiffieHellmanKey(_prime, _g, yother.ModPow(_secret, _prime));
 }