private void handleSigGenEvent(SignatureType type)
 {
     if (type == SignatureType.Pkcs1)
     {
         this.signature = (RsaSig)SignatureHandler.getInstance().getSignature();
         this.setEnabled();
         this.rbSigPkcs.IsEnabled = true;
         this.rbSigPkcs.IsChecked = true;
         this.rbSigPkcs.Content   = SigValCtrl.rsaSig;
         this.ResultEmpty();
     }
     else if (type == SignatureType.Bleichenbacher)
     {
         this.signature = (BleichenbacherSig)SignatureHandler.getInstance().getBleichenbSig();
         this.setEnabled();
         this.rbSigBlei.IsEnabled = true;
         this.rbSigBlei.IsChecked = true;
         this.rbSigBlei.Content   = SigValCtrl.bleichenbSig;
         this.ResultEmpty();
     }
     else if (type == SignatureType.Kuehn)
     {
         this.signature = (KuehnSig)SignatureHandler.getInstance().getKuehnSig();
         this.setEnabled();
         this.rbSigKuehn.IsEnabled = true;
         this.rbSigKuehn.IsChecked = true;
         this.rbSigKuehn.Content   = SigValCtrl.kuehnSig;
         this.ResultEmpty();
     }
 }
Exemple #2
0
        private void bExecute_Click(object sender, RoutedEventArgs e)
        {
            this.m_RSASignature = (RsaSig)SignatureHandler.getInstance().getSignature();
            this.m_RSASignature.GenerateSignature();
            UserControlHelper.loadRtbColoredSig(this.rtbResult, this.m_RSASignature.GetSignatureDecToHexString());
            this.tbResultEncrypted.Text = this.m_RSASignature.GetSignatureToHexString();

            // nur temp
            //SignatureHandler.getInstance().setSignature(this.m_RSASignature);
        }
Exemple #3
0
        private void bExecute_Click(object sender, RoutedEventArgs e)
        {
            Cursor = Cursors.Wait;

            this.m_BleichSignature = (BleichenbacherSig)SignatureHandler.getInstance().getBleichenbSig();
            this.m_BleichSignature.DataBlockStartPos = (int)this.cbPosDataBlock.SelectedValue;
            this.m_BleichSignature.ChangeSign        = this.tbChangeSign.Text;

            this.m_BleichSignature.GenerateSignature();
            UserControlHelper.loadRtbColoredSig(this.rtbResult, this.m_BleichSignature.GetSignatureDecToHexString());
            this.tbResultEncrypted.Text = this.m_BleichSignature.GetSignatureToHexString();

            SignatureHandler.getInstance().setBleichenBSig(this.m_BleichSignature);
            Cursor = Cursors.Arrow;
        }
        public void Init()
        {
            //TODO: dreifaches anmelden anders lösen?
            SignatureHandler.getInstance().getSignature().RaiseSigGenEvent    += handleSigGenEvent;
            SignatureHandler.getInstance().getBleichenbSig().RaiseSigGenEvent += handleSigGenEvent;
            SignatureHandler.getInstance().getKuehnSig().RaiseSigGenEvent     += handleSigGenEvent;

            this.rbVal.IsChecked = true;
            this.validator       = new SigValidator();

            this.rbSigBlei.IsEnabled  = false;
            this.rbSigBlei.Content    = SigValCtrl.bleichenbSig + " " + SigValCtrl.sigNotGeneratedYet;
            this.rbSigPkcs.IsEnabled  = false;
            this.rbSigPkcs.Content    = SigValCtrl.rsaSig + " " + SigValCtrl.sigNotGeneratedYet;
            this.rbSigKuehn.IsEnabled = false;
            this.rbSigKuehn.Content   = SigValCtrl.kuehnSig + " " + SigValCtrl.sigNotGeneratedYet;


            if (SignatureHandler.getInstance().isRsaSigGenerated())
            {
                this.signature = (RsaSig)SignatureHandler.getInstance().getSignature();
                this.setEnabled();
                this.rbSigPkcs.IsEnabled = true;
                this.rbSigPkcs.IsChecked = true;
                this.rbSigPkcs.Content   = SigValCtrl.rsaSig;
            }
            else if (SignatureHandler.getInstance().isBleichenbSigGenerated())
            {
                this.signature = (BleichenbacherSig)SignatureHandler.getInstance().getBleichenbSig();
                this.setEnabled();
                this.rbSigBlei.IsEnabled = true;
                this.rbSigBlei.IsChecked = true;
                this.rbSigBlei.Content   = SigValCtrl.bleichenbSig;
            }
            else if (SignatureHandler.getInstance().isKuehnSigGenerated())
            {
                this.signature = (KuehnSig)SignatureHandler.getInstance().getKuehnSig();
                this.setEnabled();
                this.rbSigKuehn.IsEnabled = true;
                this.rbSigKuehn.IsChecked = true;
                this.rbSigKuehn.Content   = SigValCtrl.kuehnSig;
            }
            else
            {
                this.setDisabled();
            }
        }
        private void bExecute_Click(object sender, RoutedEventArgs e)
        {
            Cursor = Cursors.Wait;

            if (this.Signature.GenerateSignature())
            {
                UserControlHelper.loadRtbColoredSig(this.rtbResult, this.Signature.GetSignatureDecToHexString());
                this.tbResultEncrypted.Text = this.Signature.GetSignatureToHexString();
                SignatureHandler.getInstance().setKuehnSig(this.Signature);
            }
            else
            {
                this.tbError.Text = SigGenKuehnCtrl.genSigErrorMaxIter;
            }

            Cursor = Cursors.Arrow;
        }
 private void rbSigKuehn_Checked(object sender, RoutedEventArgs e)
 {
     this.ResultEmpty();
     this.signature = (KuehnSig)SignatureHandler.getInstance().getKuehnSig();
     this.setEnabled();
 }
 private void rbSigBlei_Checked(object sender, RoutedEventArgs e)
 {
     this.ResultEmpty();
     this.signature = (BleichenbacherSig)SignatureHandler.getInstance().getBleichenbSig();
     this.setEnabled();
 }