/// <summary> /// Generates a new keypair. /// </summary> /// <returns>The keypair.</returns> public static KeyPair NewKeypair() { byte[] publicKey = new byte[CRYPTO_KX_KEYBYTES]; byte[] secretKey = new byte[CRYPTO_KX_KEYBYTES]; NativeLibsodium.crypto_kx_keypair(publicKey, secretKey); KeyPair pair = new KeyPair(); pair.publicKey = publicKey; pair.secretKey = secretKey; return(pair); }