コード例 #1
0
ファイル: Encrypt.cs プロジェクト: Coflnet/cloud
        /// <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);
        }