_calculateMyPublicKeyAndSecret(theirPublicKey) {

        let diffieHellman = new DiffieHellman();
        let myPrivateBI = diffieHellman.RandomPrivateKey(GROUP14_2048_BIT_MODP);
        let myPublicBI = diffieHellman.PublicKey(GROUP14_2048_BIT_MODP, GENERATOR, myPrivateBI);
        let secretBI = diffieHellman.Secret(GROUP14_2048_BIT_MODP, theirPublicKey, myPrivateBI);

        let secret = this.DHSecretToSPISecret(secretBI);

        return new PublicKeyAndSecret(myPublicBI, secret);
    }
// <returns>Your B value and the Secret</returns>
Your B value and the Secret
Your B value and the Secret
_calculateMyPublicKeyAndSecret(theirPublicKey) {
        let diffieHellman = new DiffieHellman();
        let myPrivateBI = diffieHellman.RandomPrivateKey(GROUP14_2048_BIT_MODP);
        let myPublicBI = diffieHellman.PublicKey(GROUP14_2048_BIT_MODP, GENERATOR, myPrivateBI);
        let secretBI = diffieHellman.Secret(GROUP14_2048_BIT_MODP, theirPublicKey, myPrivateBI);
        let secret = this.DHSecretToSPISecret(secretBI);
        return new PublicKeyAndSecret(myPublicBI, secret);
    }
_calculateMyPublicKeyAndSecret ( theirPublicKey ) { let diffieHellman = new DiffieHellman ( ) ; let myPrivateBI = diffieHellman . RandomPrivateKey ( GROUP14_2048_BIT_MODP ) ; let myPublicBI = diffieHellman . PublicKey ( GROUP14_2048_BIT_MODP , GENERATOR , myPrivateBI ) ; let secretBI = diffieHellman . Secret ( GROUP14_2048_BIT_MODP , theirPublicKey , myPrivateBI ) ; let secret = this . DHSecretToSPISecret ( secretBI ) ; return new PublicKeyAndSecret ( myPublicBI , secret ) ; }
<returns>Your B value and the Secret</returns>
<returns > Your B value and the Secret< / returns >