Exemplo n.º 1
0
        internal static NetworkCredential Get(NetworkCredentialXML value)
        {
            if (value == null)
            {
                return(null);
            }
            string password;

            if (value.EncryptedPassword != null)
            {
                byte[] bytes = CryptoTools.Decrypt(value.EncryptedPassword, NetworkCredentialXML.PwdEncryptionKey);
                password = Encoding.Unicode.GetString(bytes);
            }
            else
            {
                password = null;
            }
            return(new NetworkCredential(value.Username, password, value.Domain));
        }