private static bool SetCredential()

in SurfaceDevCenterManager/Utility/DevCenterCredentialsHandler.cs [52:74]


        private static bool SetCredential(string token)
        {
            byte[] data = Encoding.Unicode.GetBytes(token);
            byte[] encryptData = null;
            bool retval = false;
            try
            {
                encryptData = ProtectedData.Protect(data, s_aditionalEntropy, DataProtectionScope.CurrentUser);
            }
            catch (CryptographicException)
            {
                encryptData = null;
            }

            if (encryptData != null)
            {

                System.IO.File.WriteAllBytes(GetSdcmBinPath(), encryptData);
                retval = true;
            }

            return retval;
        }