473,387 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem in capturing Dos application messages C#


Friends,

I have a C# console application for verifying a signature of an encrypted,
this is done thru the Process.Startinfo method,

My dos application for the decryption is gpg.exe (gnupgi)

When I tried from the dos prompt the folloing output received:

------------------------------------------------------------------------
C:\Processor\bin\Debug>gpg --decrypt file4.gpg
gpg: encrypted with 2048-bit ELG-E key, ID C51C8CA2, created 2004-11-06
"FTSA_KEY (test_key)"
Chassis Type : R200
Chassis Mode : JubiNet
Software Version : MAIN4.4.2.218

Slot Item Serial Number Part Number Revision
--------------------------------------------------------------
E1200 E000000001664 6000003000 03
0 CC-E-SFM 0005072 7490033602 01
4 CC-E-SFM 0005074 7490033602 01
5 CC-E-SFM 0006771 7520003700 2
0 CC-E1200-PWR-DC N/A N/A N/A
0 CC-E1200-FAN N/A N/A N/A
5 CC-E1200-FAN N/A N/A N/A

* - standby

gpg: Signature made 11/06/04 11:16:19 using DSA key ID A94AF57D
gpg: Good signature from "Agent00017555 (test key for Hari)
<ha*******@bonbon.net>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the
owner.
Primary key fingerprint: C549 E5F1 FD6F 8AFE C5F3 B058 348D 3840 A94A F57D

C:\Processor\bin\Debug>

----------------------------------------------------------------------------
---

I need all the output for the purpose of varifying the signature including
the gpg messages

but when I tried from my application, only the file contents is getting
extracted

The output from my application is as follows like this
-------------------------------------------------------------------------

Chassis Type : R200
Chassis Mode : JubiNet
Software Version : MAIN4.4.2.218

Slot Item Serial Number Part Number Revision
--------------------------------------------------------------
E1200 E000000001664 6000003000 03
0 CC-E-SFM 0005072 7490033602 01
4 CC-E-SFM 0005074 7490033602 01
5 CC-E-SFM 0006771 7520003700 2
0 CC-E1200-PWR-DC N/A N/A N/A
0 CC-E1200-FAN N/A N/A N/A
5 CC-E1200-FAN N/A N/A N/A

* - standby
-------------------------------------------------------------------------
How can I get the application messages text also as the part of output
string?

My method as follows:

public static bool VarifyKey()
{
try
{
Process MyProc = new Process();
MyProc.StartInfo.FileName = "gpg.exe";
MyProc.StartInfo.CreateNoWindow = true;
MyProc.StartInfo.UseShellExecute = false;
MyProc.StartInfo.RedirectStandardOutput = true;

MyProc.StartInfo.Arguments = "--decrypt file4.gpg";
MyProc.Start();
//#capture results
string output = MyProc.StandardOutput.ReadToEnd();

if (!MyProc.WaitForExit(10000))
{
MyProc.Close();
return false;
}
if (MyProc.ExitCode != 0) // Decrypt Error -inside pg (unknown)
{
MyProc.Close();
return false;
}
int index = output.Trim().IndexOf("Good signature");
if (int = -1)
{return false;}
}
}

thanks
-hari
Nov 16 '05 #1
2 1410
Harikumar G <ha**@kottsoftware.com> wrote:
Friends,

I have a C# console application for verifying a signature of an encrypted,
this is done thru the Process.Startinfo method,

My dos application for the decryption is gpg.exe (gnupgi)

When I tried from the dos prompt the folloing output received:


<snip>

Have you tried reading StandardError as well as StandardOutput?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
Harikumar G <ha**@kottsoftware.com> wrote:
Friends,

I have a C# console application for verifying a signature of an encrypted,
this is done thru the Process.Startinfo method,

My dos application for the decryption is gpg.exe (gnupgi)

When I tried from the dos prompt the folloing output received:


<snip>

Have you tried reading StandardError as well as StandardOutput?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: BK Kim | last post by:
Hello. I am tryring to find a way to capture some of the windows messages ( eg. messages for creating, deleting files ) in c#. In windows application, i can override wndProc method to capture...
0
by: Harikumar G | last post by:
Friends, I have a C# console application for verifying a signature of an encrypted, this is done thru the Process.Startinfo method, My dos application for the decryption is gpg.exe (gnupgi) ...
6
by: Ed Leafe | last post by:
I've been approached by a local business that has been advised that they need to start capturing and archiving their instant messaging in order to comply with Sarbanes-Oxley. The company is largely...
1
by: giovannino | last post by:
Dear all, I did a query which update a sequence number (column NR_SEQUENZA) in a table using a nice code (from Trevor !). 1) Given that I'm not a programmer I can't understand why...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.