Пример #1
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);
        }
Пример #2
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;
        }
Пример #3
0
        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;
        }
Пример #4
0
        public static void loadRtbColoredSig(RichTextBox richTB, string decryptedSig)
        {
            FlowDocument flowDoc = new FlowDocument();
            Paragraph    para    = new Paragraph();
            Run          run     = new Run(decryptedSig);

            para.Inlines.Add(run);

            int paddingEnd = decryptedSig.IndexOf("ff0030"); // Ende des Padding
            int identEnd   = paddingEnd + 10 + Datablock.getInstance().HashFunctionIdent.DERIdent.Length;
            int digestEnd  = identEnd + 2 + (Datablock.getInstance().HashFunctionIdent.digestLength / 4);

            TextRange rangePadding = UserControlHelper.GenTextRange(run, 4, paddingEnd + 2, Colors.Green);
            TextRange rangeIdent   = UserControlHelper.GenTextRange(run, paddingEnd + 8, identEnd, Colors.Blue);
            TextRange rangeDigest  = UserControlHelper.GenTextRange(run, identEnd, digestEnd, Colors.Red);

            flowDoc.Blocks.Add(para);
            richTB.Document = flowDoc;
        }
Пример #5
0
 private void rtbResult_TextChanged(object sender, TextChangedEventArgs e)
 {
     this.lblSignatureLength.Content = String.Format(Common.length, UserControlHelper.GetRtbTextLength(this.rtbResult) * 4);
 }