Exemplo n.º 1
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            signingData = new SigningData();

            // validate certificate by calling a function
            ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateRemoteCertificate);

            this.webBrowser1 = new System.Windows.Forms.WebBrowser();
            this.SuspendLayout();
            //
            // webBrowser1
            //
            this.webBrowser1.Dock        = System.Windows.Forms.DockStyle.Fill;
            this.webBrowser1.Location    = new System.Drawing.Point(0, 0);
            this.webBrowser1.MaximumSize = new System.Drawing.Size(1280, 768);
            this.webBrowser1.MinimumSize = new System.Drawing.Size(1280, 768);
            this.webBrowser1.Name        = "webBrowser1";
            this.webBrowser1.Size        = new System.Drawing.Size(1280, 768);
            this.webBrowser1.TabIndex    = 0;
            this.webBrowser1.Url         = new System.Uri("https://developer.blackberry.com/codesigning/", System.UriKind.Absolute);
            this.webBrowser1.Navigating += new System.Windows.Forms.WebBrowserNavigatingEventHandler(this.webBrowser1_Navigating);
            //
            // Browser
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
            this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize          = new System.Drawing.Size(1280, 768);
            this.Controls.Add(this.webBrowser1);
            this.Name = "Browser";
            this.Text = "Sign in to create and download your BlackBerry ID token";
            this.ResumeLayout(false);
            this.MinimizeBox = false;
        }
Exemplo n.º 2
0
        public SigningDialog()
        {
            InitializeComponent();

            signingData          = new SigningData();
            gridMain.DataContext = signingData;
        }
Exemplo n.º 3
0
        /// <summary>
        /// RegistrationWindow Constructor
        /// </summary>
        public RegistrationWindow()
        {
            InitializeComponent();

            signingData          = new SigningData();
            gridMain.DataContext = signingData;
        }
Exemplo n.º 4
0
 private void OnConfirmPrivateKey(object sender, RoutedEventArgs e)
 {
     if (SigningData.TryAddKey(_model.PrivateKey))
     {
         this.MoveToControl <Step2>();
     }
 }
Exemplo n.º 5
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.º 6
0
 public void TFSetup()
 {
     /// Create Object
     _signingData = new SigningData();
     _certName    = "BackupTest.zip";
     _certTmpPath = @"\temp";
 }
Exemplo n.º 7
0
 private void OnClearKey(object sender, RoutedEventArgs e)
 {
     if (SigningData.PopCurrentKey())
     {
         this.MoveToControl <Step1a>();
     }
     else
     {
         this.MoveToControl <Step1>();
     }
 }
Exemplo n.º 8
0
        public void BytesForSigningComputedCorrectlyForStdTx()
        {
            using var client = CreateClient(Configuration.LocalBaseUrl);

            var stdSignDoc = SigningData.StdSignDoc();
            var bytes      = Encoding.UTF8.GetBytes(client.Serializer.SerializeSortedAndCompact(stdSignDoc));

            OutputHelper.WriteLine("StdSignDoc:");
            Dump(stdSignDoc);

            OutputHelper.WriteLine("SignBytes:");
            OutputHelper.WriteLine(bytes.ToHexString());
            OutputHelper.WriteLine("");

            var expectedBytes = SigningData.StdSignDocBytes();

            OutputHelper.WriteLine("Expected SignBytes:");
            OutputHelper.WriteLine(expectedBytes.ToHexString());
            OutputHelper.WriteLine("");

            Assert.Equal(
                expectedBytes,
                bytes);
        }
 private void OnStartOver(object sender, RoutedEventArgs e)
 {
     SigningData.Reset();
     this.MoveToControl <Step1>();
 }