Exemplo n.º 1
0
        public void TFSetup()
        {
            /// Create Object
            _signingData = new SigningData();

            _certName    = @"/bbidtoken.csk";
            _certTmpName = @"/bbidtoken.csk.bak";

            if (_signingData.Registered)
            {
                /// Backup CSK Password
                RegistryKey rkHKCU    = Registry.CurrentUser;
                RegistryKey rkCDKPass = null;
                rkCDKPass    = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
                _cskPassword = GlobalFunctions.Decrypt(rkCDKPass.GetValue("CSKPass").ToString());
                rkCDKPass.Close();
                rkHKCU.Close();

                /// Backup CSK File..
                File.Copy(_signingData.CertPath + _certName, _signingData.CertPath + _certTmpName);

                /// Remove Key so we can register again.
                _signingData.UnRegister();

                /// Backup CSK File..
                File.Copy(_signingData.CertPath + _certTmpName, _signingData.CertPath + _certName);
            }
            else
            {
                Assert.Ignore();
            }
        }
Exemplo n.º 2
0
        public void SigningDataUnregisterTest()
        {
            /// Check success Fail
            _signingData.UnRegister();

            /// Check return value from remote call
            StringAssert.IsMatch("CSK file deleted.\n", _signingData.Messages, "Return value from command is not as expected. " + _signingData.Messages);

            /// Check return value for errors
            StringAssert.DoesNotMatch("", _signingData.Errors, "Errors have been regturned from remote call. " + _signingData.Errors);

            /// Check to see that the cert file was removed
            Assert.False(File.Exists(_signingData.CertPath + @"/author.p12"), "Certificate File is still present");

            /// Check to see that the csk file was removed
            Assert.False(File.Exists(_signingData.CertPath + @"/bbidtoken.csk"), "CSK File is still present.");

            /// Get CSK Password
            RegistryKey rkHKCU    = Registry.CurrentUser;
            RegistryKey rkCDKPass = null;

            rkCDKPass = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
            StringAssert.IsMatch("", GlobalFunctions.Decrypt(rkCDKPass.GetValue("CSKPass").ToString()), "Password is not set to blank");
            rkCDKPass.Close();
            rkHKCU.Close();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Event fired on OK button click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            if (!signingData.UnRegister())
            {
                MessageBox.Show(signingData.Errors, "Registration Window", MessageBoxButton.OK, MessageBoxImage.Exclamation, MessageBoxResult.OK);
                signingData.Errors = null;
                e.Handled          = true;
                return;
            }
            else if (!string.IsNullOrEmpty(signingData.Messages))
            {
                signingData.Messages = signingData.Messages.Replace("CSK", "BB ID Token");
                MessageBox.Show(signingData.Messages, "Registration Window", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
                signingData.Messages = null;
            }

            DialogResult = true;
        }