Click here to Skip to main content
       

C / C++ / MFC

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
Questionhow to get private key from a file (not from a keystore) to sign data ?memberIICTECH4 Feb '13 - 19:12 
Hi,
 
I'm trying to sign data using dsa private key using openSSL. I want to use a private key that is stored in a file. Can any one please suggest me how to get privae key from a file.
 
Thanks in advance. Wink | ;)
AnswerRe: how to get private key from a file (not from a keystore) to sign data ?mvpRichard MacCutchan4 Feb '13 - 22:20 
Read the file and extract the key. You need to explain exactly how this key is stored in the file and what problem you are having reading it out.
GeneralRe: how to get private key from a file (not from a keystore) to sign data ?memberIICTECH4 Feb '13 - 23:44 
My private key file is a text file and it contains the data
 
// BIG p
FCA6 82CE 8E12 CABA 26EF CCF7 110E 526D B078 B05E DECB CD1E B4A2 08F3 AE16 17AE 01F3 5B91 A47E 6DF6 3413 C5E1 2ED0 899B CD13 2ACD 50D9 9151 BDC4 3EE7 3759 2E17.
// BIG q
962E DDCC 369C BA8E BB26 0EE6 B6A1 26D9 346E 38C5.
// BIG g
6784 71B2 7A9C F44E E91A 49C5 147D B1A9 AAF2 44F0 5A43 4D64 8693 1D2D 1427 1B9E 3503 0B71 FD73 DA17 9069 B32E 2935 630E 1C20 6235 4D0D A20A 6C41 6E50 BE79 4CA4.
// BIG x
06CE 2BF2 3F33 FDCD 3F22 1301 4F56 1152 69F6 FA4D.
 
Here BIG x is the private key and I need this key to sign my data. Smile | :)
GeneralRe: how to get private key from a file (not from a keystore) to sign data ?mvpRichard MacCutchan4 Feb '13 - 23:58 
IICTECH wrote:
Here BIG x is the private key and I need this key to sign my data.
So what is your problem?
GeneralRe: how to get private key from a file (not from a keystore) to sign data ?memberGraham Breach5 Feb '13 - 3:57 
If that is your actual private key file, then it is not private anymore.
QuestionPop up window from a dialog based applicationmemberMember 80516113 Feb '13 - 23:46 
Hi,
I have started programming with Visual C++ recently. I have created a dialog based application which has some buttons. When I click one of the buttons I want a window to pop up(which will eventually display an image). Can you please tell me how to do it? Thanks in advance,
-Danny
AnswerRe: Pop up window from a dialog based applicationmvpRichard MacCutchan4 Feb '13 - 0:21 
Either use a popup window which you create by hand (see CreateWindowEx[^]), or use another dialog. It all depends what you are trying to do.
GeneralRe: Pop up window from a dialog based applicationmemberMember 80516114 Feb '13 - 0:55 
Thanks Richard for your reply. FYI I am doing the development using Visual C++. From the image window which pops up I would like to process mouse messages etc . Would that be possible if the image window is created with CreateWindowEx? I was thinking that the pop up image window should be created with a combination of CFrameWnd and CView. Is that the way to go? But I don't know how to do that. Thanks very much,
-D
GeneralRe: Pop up window from a dialog based applicationmvpRichard MacCutchan4 Feb '13 - 2:34 
It's not easy to give a definitive answer to your question because I am not sure exactly what you are trying to do. But it sounds like you are starting from the wrong position. Why are you creating a popup window from within a dialog? Why not go for a standard CFrameWnd with whatever View type inside that will display the information that you want to show?
GeneralRe: Pop up window from a dialog based applicationmemberMember 80516114 Feb '13 - 19:19 
Richard,
Ok I am trying what you have suggested. In that case also when the user clicks on the image(which is displayed on the CFrameWnd with view window) I want another image window to pop up which will display information corresponding to the clicked point. Please help. Thanks very much,
-Danny
GeneralRe: Pop up window from a dialog based applicationmvpRichard MacCutchan4 Feb '13 - 22:17 
Member 8051611 wrote:
I want another image window to pop up which will display information corresponding to the clicked point.
For that you should use the DialogBox function[^] to create a modal dialog.
GeneralRe: Pop up window from a dialog based applicationmemberMember 80516114 Feb '13 - 23:59 
I want the popup window to display the image. AFAIK a dialog box won't do it. Or can it? Thanks,
-DJ
GeneralRe: Pop up window from a dialog based applicationmvpRichard MacCutchan5 Feb '13 - 0:04 
You previously said the you wanted the popup to display information about the image. In either case you just need to add the information to your dialog, either by adding static information in your dialog resource, or by adding it at run time. Adding information to a dialog at run time can be done in response to the WM_INITDIALOG message[^] or in response to some user action on one of the dialog controls.
GeneralRe: Pop up window from a dialog based applicationmemberMember 80516115 Feb '13 - 1:03 
Richard,
Thanks for the reply. You are not understanding my requirement. When I click somewhere on the client area of the application I want to display a image(2-D)(thru a Cview object possibly). Something like what you would get on displaying a image with Microsoft Paint. Instead I am reading the image and displaying it. I don't think a dialog can do that display. I know how to read the image but I don't know how to display it in a pop-up window(a window other than the main application window). I hope I am clear. Regards,
-DJ
GeneralRe: Pop up window from a dialog based applicationmvpRichard MacCutchan5 Feb '13 - 1:33 
You can display an image in any sort of window, it is just a matter of writing the code to do the work. Whether that window is a CView, a dialog, or any other type is not important. What I am confused about is the fact that you seem to be talking about more than one image and more than one window; but which one comes first and what does it contain?
GeneralRe: Pop up window from a dialog based applicationmemberMember 80516115 Feb '13 - 17:47 
Richard,
Thanks for your reply. In very simple terms I have a SDI application which displays an image. Now when the user clicks on a point on this image I want to display a pop up window with another image(This image is the grating[2-d array] corresponding to the color of the point clicked). I have made the SDI application which displays the 1st image.But I don't know how to make a popup window with the grating image. I have searched a lot on the web with no luck. It's frustrating. Please comment asap. Regards,
-DJ
GeneralRe: Pop up window from a dialog based applicationmvpRichard MacCutchan5 Feb '13 - 21:10 
I'm not sure what a grating image is, but assuming you can create it using Windows GDI or GDI+, then any Window type should be OK to display it. The simplest option would obviously be a Dialog with a Static Control[^] on which you would display this image.
GeneralRe: Pop up window from a dialog based applicationmemberMember 80516116 Feb '13 - 22:45 
Dear Richard,
I am attempting what you have suggested. But I am curious how to open a pop-up window from the SDI application(CWinapp1+CDocument1+CFrameWnd1+CScrollView1) which shows the first image. The pop-up window (CWinapp2+CDocument2+CFrameWnd2+CScrollView2) which corresponds to grating/second image has to be displayed from CSrollview1::OnLButtonDown. If I can do that, it would save me a lot of effort. But I don't know how to do it. In CSrollview1 I tried
....
AddDocTemplate(pDocTemplate2);//corresponding to 2nd document
.....
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
but it didn't work that way. Please guide me. Thanks very much,
-DJ
GeneralRe: Pop up window from a dialog based applicationmvpRichard MacCutchan6 Feb '13 - 23:43 
Adding another document template is not what is needed in your case. As I have suggested a number of times, using a simple modal dialog would be the simplest way to create what you need. Alternatively, you can create a stand-alone window with the appropriate styles[^] and display it until the user requests it to be discarded.
GeneralRe: Pop up window from a dialog based applicationmemberMember 80516117 Feb '13 - 0:29 
Dear Richard,
What you have suggested(dialog with bitmap static control) has mostly worked. I agree it would be the shortest route. I have a small issue. When I click on the 1st image I get the pixel/color value of that point. Now I have to pass that to the dialog box which is popped up. Any clue how I would do that.
void CCreateGratingsView::OnLButtonDown(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	CClientDC dc (this);
	COLORREF clr;
    CPicDialog dlg;
	BYTE Red,Green,Blue;
	clr=dc.GetPixel (point);
	Red=GetRValue(clr);
    Green=GetGValue(clr);
	Blue=GetBValue(clr);
	//dlg should receive Red Green Blue
    dlg.DoModal()
 
	CScrollView::OnLButtonDown(nFlags, point);
}
 
Thanks again,
-DJ
GeneralRe: Pop up window from a dialog based applicationmvpRichard MacCutchan7 Feb '13 - 0:50 
You could add a member variable to the CPicDialog class and store it there, or add another parameter to the dialog's constructor and pass it in that way.
GeneralRe: Pop up window from a dialog based applicationmemberMember 805161111 Feb '13 - 19:55 
Dear Richard,
Thanks for all your help. It works fine(there are a few bugs to be cleared). Will get in touch with you if I have any trouble in future. Cheers,
-DJ
GeneralRe: Pop up window from a dialog based applicationmemberMember 80516115 Feb '13 - 19:33 
Richard,
To add to what I have stated previously, From the Cview object(OnLButtonDown f.n) of the SDI application I want to create a pop-up window ,read the second or grating image and display it in the pop-up window. Thanks,
-DJ
AnswerRe: Pop up window from a dialog based applicationmemberAlbert Holguin4 Feb '13 - 12:18 
If you're only doing something simple... CDialog is really the easy route...
QuestionHow to Implement Drag & Drop feature for Imagesin MFC.?membermbatra313 Feb '13 - 19:17 
Hi,
 
I have a dialog box and a picture control (canvas) on that dialog box. I have a list of Images in my dialog box in a list box. I want to implement Drag & Drop feature in my application. I want the user be able to click on the Image with a mouse and then drag the Image to the canvas.
 
Any help will be appreciated.
 

 

Regards,
Mbatra

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 25 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid