SharpTox.Encryption.ToxEncryptionKey.ToxEncryptionKey C# (CSharp) Méthode

ToxEncryptionKey() public méthode

public ToxEncryptionKey ( string passphrase, byte salt = null ) : System
passphrase string
salt byte
Résultat System
        public ToxEncryptionKey(string passphrase, byte[] salt = null)
        {
            var key = salt == null ? ToxEncryption.DeriveKey(passphrase) : ToxEncryption.DeriveKey(passphrase, salt);
            if (key == null)
                throw new Exception("Could not derive key from passphrase");

            Bytes = key.Value.Key;
            Salt = key.Value.Salt;
        }