Beispiel #1
0
        public static void CreateDigitalSeal(string inputFile, string RSApublicReciever, string RSAprivateSender, string envelopeFile, string signatureFile, EncryptionMode encryptionMode, HashingMode hashingMode, SymetricAlgorithm algorithm, KeySize keySize)
        {
            DigitalEnvelope.CreateDigitalEnvelope(inputFile, RSApublicReciever, envelopeFile, encryptionMode, algorithm, keySize);

            var envelope = FileManager.Read_Envelope(envelopeFile);

            var hash = SHA.Hash(envelope.Data + envelope.Key, hashingMode);

            DigitalSignature.CreateDigitalSignature_FromString(hash, RSAprivateSender, signatureFile, hashingMode);
        }
Beispiel #2
0
        public static void CheckDigitalSeal(string outputFile, string RSApublicSender, string RSAprivateReciever, string envelopeFile, string signatureFile, TextBox sealCheck, EncryptionMode encryptionMode, HashingMode hashingMode, SymetricAlgorithm algorithm)
        {
            DigitalEnvelope.OpenDigitalEnvelope(envelopeFile, RSAprivateReciever, outputFile, encryptionMode, algorithm);

            var envelope = FileManager.Read_Envelope(envelopeFile);

            var hash = SHA.Hash(envelope.Data + envelope.Key, hashingMode);

            DigitalSignature.CheckDigitalSignature_FromString(hash, signatureFile, RSApublicSender, sealCheck, hashingMode);
        }
        private void button25_Click(object sender, EventArgs e)
        {
            HashingMode mode;

            if (rbSHA_1_Potpis2.Checked)
            {
                mode = HashingMode.SHA_1;
            }
            else if (rbSHA_2_256_Potpis2.Checked)
            {
                mode = HashingMode.SHA_2_256;
            }
            else
            {
                mode = HashingMode.SHA_2_512;
            }
            DigitalSignature.CheckDigitalSignature_FromFile(tbUlaznaDatotekaPotpis.Text, tbDigitalniPotpisProvjera.Text, tbJavniKljucPosiljatelja.Text, tbProvjeraPotpisa, mode);
        }
        private void button18_Click(object sender, EventArgs e)
        {
            HashingMode mode;

            if (rbSHA_1_Potpis.Checked)
            {
                mode = HashingMode.SHA_1;
            }
            else if (rbSHA_2_256_Potpis.Checked)
            {
                mode = HashingMode.SHA_2_256;
            }
            else
            {
                mode = HashingMode.SHA_2_512;
            }

            DigitalSignature.CreateDigitalSignature_FromFile(tbUlaznaDatotekaPotpis.Text, tbTajniKljucPosiljatelja.Text, tbDigitalniPotpisIzrada.Text, mode);
        }