|
hello,
I have to verify the digital signature of an XML file and for this I need to write a code in VC++. Any pointer towards it will be highly appreciated.
Thnx
|
|
|
|
|
What digital signature ?
Christian Graus - C++ MVP
|
|
|
|
|
Sorry I din get ur Q.
But I can explain what I have to do . I have to basically first make an XML file digitally signed and then have to verify from other end. (Objective of the excercise)
1. To make it digitally signed I have to first HASH encrypt the file with a unique values (e.g. some ID) by HASH algo (SHA) and then have to sign it with a private key.
2. Now to verify it I have to do the same oprocedure but in reverse direction and with the help of the public key which would be differenct from the private key. (asymmnetric key)
I want to know how this to be done in VC++. Also if anyone knows that where these keys come from please let me know.
Thnx
|
|
|
|
|
Prinky wrote: Also if anyone knows that where these keys come from please let me know.
Well, you're the one telling the story. I guess you want to look for cryptography extensions to C++, as there is nothing in the actual language.
Christian Graus - C++ MVP
|
|
|
|
|
why dialog box ID is enumerated as the IDD member? Is there any special reason that it is enumerated?
KIRAN PINJARLA
|
|
|
|
|
Because macros suck, unless there in no better solution. In this case there is. For example, macros can't be class members but an enum can (and in this case is).
Steve
|
|
|
|
|
Stephen Hewitt wrote: Because macros suck,
Why? If we use macros carefully they are very helpful. Mainly because of irrational use most of the BUGs happen. For me macros are indispensable.
|
|
|
|
|
As I said, if there is no better solution macros are fine. But there are many problems with them and they’re overused by many C/C++ programmers. Some of the problems with them are:
- Can’t be overloaded.
- Make debugging harder.
- Don’t obey C/C++ scoping rules.
- Can cause nasty side effects.
All of these problems with macros – and more besides – are well known.
Steve
|
|
|
|
|
Stephen Hewitt wrote: - Can’t be overloaded.
They are not meant to be overloaded. If that's the purpose there are functions we should use them.
Stephen Hewitt wrote: - Make debugging harder.
TRUE.
Stephen Hewitt wrote: - Don’t obey C/C++ scoping rules.
Macros were not made for this purpose. They acts as just pure inline code replacement routine. If not used carefully ....
Stephen Hewitt wrote: - Can cause nasty side effects.
TRUE. They should be extremely well written.
|
|
|
|
|
Not exactly sure, but I think has mostly to do with the wizards that create the dialog classes, because as far as I can tell, IDD is is only passed to the constructor of CDialog as the resource ID. I could be way wrong of course...
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
It's how the Class Wizard recognises and remembers which classes are tied to which dialogs. If you remove that line, Class Wizard won't recognise which dialog belongs to the class any more.
|
|
|
|
|
Yup, and this now ties the resource file (with every resource) to the header, so any user of the header had to re-compile, any time any resource element changes, no matter how unrelated....
|
|
|
|
|
I have a simple client-server socket application. After the client runs for a while (2/3 days) the client machine gets to a state where it cannot make any outbound tcp/ip connections (i.e., browser, http requests, etc).
Once I restart the client (running as a service) then everything seems to work fine. I ran the scoket code through BoundsChecker to look for any memory or resource leaks and didnt find any. Has anyone here faced this or a similar issue?
Any help would be greatly appreciated.
TIA
|
|
|
|
|
when it blocks check with netstat and see if you have sockets still open
|
|
|
|
|
|
U can use API to do so
I right now dont remeber the exact API
Tell u Later
bye
pitchu
|
|
|
|
|
Do you need to transparent window ?
|
|
|
|
|
You need to use Layered windows for this purpose.
Search CP for WS_EX_LAYERED , you will get lot of articels, that states how to achieve this.
|
|
|
|
|
what u said appears to work only in windows2000 or above
|
|
|
|
|
Yes.
Are people still using OS before that ?
|
|
|
|
|
Is there a Win32 API for parsing a string that represents a date/time value and getting back a SYSTEMTIME or something similar?
I found VarDateFromStr but I notice that it appears to cause access violations on certain unpatched systems, so I'm reluctant to use it.
|
|
|
|
|
Did a bunch of research on this, back in July, and VarDateFromStr is the best I could come up with.
For the VCF:
DateTime Win32LocalePeer::toDateTime( const UnicodeString& str )
{
DateTime time;
DATE dtSrc;
unsigned short* data = (unsigned short*)str.data();
HRESULT hr = ::VarDateFromStr(data, LANG_USER_DEFAULT, 0, &dtSrc);
if (SUCCEEDED( hr ))
{
struct tm newTime;
SYSTEMTIME st;
if( VariantTimeToSystemTime(dtSrc, &st) )
{
newTime.tm_sec = st.wSecond;
newTime.tm_min = st.wMinute;
newTime.tm_hour = st.wHour;
newTime.tm_mday = st.wDay;
newTime.tm_mon = st.wMonth;
newTime.tm_year = st.wYear;
newTime.tm_wday = st.wDayOfWeek;
newTime.tm_isdst = -1; // Force DST checking
mktime(&newTime); // Normalize
time.set(newTime.tm_year, newTime.tm_mon, newTime.tm_mday, newTime.tm_hour, newTime.tm_min, newTime.tm_sec);
}
}
return time;
}
Haven't run into any problems with it in production code (yet!), but will keep my eye out for any access violations.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Steve, are you using the VCF? In production code? That's awesome!
|
|
|
|
|
Using the VCF and loving it! Had to make a few modifications, but so far it's working great! I guess I use the term "production" a bit loosely, as it's still very much in beta, and only a few people have downloaded it.
This is sort of my VCF pet project (still got a ways to go...):
http://www.riptrails.com/downloads.asp[^]
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Holy crap that's totally cool! You should post something on the VCF boards! If you can't or don't have the time, do you mind if I do?
Do you know of anyone else using it? I had no idea about this!!
|
|
|
|