HexEncoder class to CString
-
Im using boZoi library to implement Elliptic curve cryptography to my VC project.The functions output r in the format of hexadecimal and OCTETSTR(octant string) now if i want to show the output in the edit box control of a dialog box...???. ECDSA sig; HexEncoder hex(sig); CEdit* poEdit = static_cast(GetDlgItem(IDC_EDIT3)); poEdit->SetWindowText(hex); HexEncoder is a class which converts to hexadecimal format & i want to convert it converted to CString or LPCTSTR...How i do that? borZoi can be found at: http://dragongate-technologies.com/products.html[^]
-
Im using boZoi library to implement Elliptic curve cryptography to my VC project.The functions output r in the format of hexadecimal and OCTETSTR(octant string) now if i want to show the output in the edit box control of a dialog box...???. ECDSA sig; HexEncoder hex(sig); CEdit* poEdit = static_cast(GetDlgItem(IDC_EDIT3)); poEdit->SetWindowText(hex); HexEncoder is a class which converts to hexadecimal format & i want to convert it converted to CString or LPCTSTR...How i do that? borZoi can be found at: http://dragongate-technologies.com/products.html[^]
titi@yahoo.com wrote: HexEncoder is a class which converts to hexadecimal format & i want to convert it converted to CString or LPCTSTR...How i do that? You should be able to do it the same way I told you[^] when you asked this same question[^] before. Have you tried it? -- jlr http://jlamas.blogspot.com/[^]
-
titi@yahoo.com wrote: HexEncoder is a class which converts to hexadecimal format & i want to convert it converted to CString or LPCTSTR...How i do that? You should be able to do it the same way I told you[^] when you asked this same question[^] before. Have you tried it? -- jlr http://jlamas.blogspot.com/[^]
Yup it worked fine...thanx.But that converts Octant string to Hex String....here i want to convert Hexadecimal to char* or CString to show in edit box....I dont know if the same method can be applied here?
-
Yup it worked fine...thanx.But that converts Octant string to Hex String....here i want to convert Hexadecimal to char* or CString to show in edit box....I dont know if the same method can be applied here?
OK as u suggested i used ostringstream to store hex vaue as a string and then convert it into a CString form to show in the edit control of dialog box.It gives no error but at the time of execution of this code "illegal operation error" message box is displayed.Where Im doing wrong? std::string s(""); ECDSA sig1(sk, OS2IP(hash)); // generate the signature DER der_str (sig1); //DER class function HexEncoder hex_str(der_str); //Hexencoder class function std::ostringstream str; str<(GetDlgItem(IDC_EDIT3)); poEdit->SetWindowText(cs);
-
titi@yahoo.com wrote: HexEncoder is a class which converts to hexadecimal format & i want to convert it converted to CString or LPCTSTR...How i do that? You should be able to do it the same way I told you[^] when you asked this same question[^] before. Have you tried it? -- jlr http://jlamas.blogspot.com/[^]
OK as u suggested i used ostringstream to store hex vaue as a string and then convert it into a CString form to show in the edit control of dialog box.It gives no error but at the time of execution of this code "illegal operation error" message box is displayed.Where Im doing wrong? std::string s(""); ECDSA sig1(sk, OS2IP(hash)); // generate the signature DER der_str (sig1); //DER class function HexEncoder hex_str(der_str); //Hexencoder class function std::ostringstream str; str<SetWindowText(cs); Hope ull reply soon.
-
OK as u suggested i used ostringstream to store hex vaue as a string and then convert it into a CString form to show in the edit control of dialog box.It gives no error but at the time of execution of this code "illegal operation error" message box is displayed.Where Im doing wrong? std::string s(""); ECDSA sig1(sk, OS2IP(hash)); // generate the signature DER der_str (sig1); //DER class function HexEncoder hex_str(der_str); //Hexencoder class function std::ostringstream str; str<SetWindowText(cs); Hope ull reply soon.
titi@yahoo.com wrote: It gives no error but at the time of execution of this code "illegal operation error" message box is displayed.Where Im doing wrong? Hard to tell without knowing at what point in the code you get that error. In any case, if you looked at the
DER
declaration in borzoi.h, you'd noteDER
objects hold their data in anOCTETSTR
public member namedv
, and as I already shown you how to code anOctetStrToHexString
, you'd realize you can simply useOctetStrToHexString
passingder_str.v
.ECDSA sig1(sk, OS2IP(hash)); // generate the signature
DER der_str (sig1); //DER class function
CWnd* pWnd = GetDlgItem(IDC_EDIT3);
if (pWnd)
{
CString sDer;
OctetStrToHexString(der_str.v, sDer);
pWnd->SetWindowText(sDer);
}-- jlr http://jlamas.blogspot.com/[^]
-
titi@yahoo.com wrote: It gives no error but at the time of execution of this code "illegal operation error" message box is displayed.Where Im doing wrong? Hard to tell without knowing at what point in the code you get that error. In any case, if you looked at the
DER
declaration in borzoi.h, you'd noteDER
objects hold their data in anOCTETSTR
public member namedv
, and as I already shown you how to code anOctetStrToHexString
, you'd realize you can simply useOctetStrToHexString
passingder_str.v
.ECDSA sig1(sk, OS2IP(hash)); // generate the signature
DER der_str (sig1); //DER class function
CWnd* pWnd = GetDlgItem(IDC_EDIT3);
if (pWnd)
{
CString sDer;
OctetStrToHexString(der_str.v, sDer);
pWnd->SetWindowText(sDer);
}-- jlr http://jlamas.blogspot.com/[^]
Thnx for (late) reply but ive done it and through the same method as u told. Since Im stuck in cryptography stuff nad Im using CryptoAPI Ive some data of type BYTE* (PUBLICKEYBLOB)I want to write it in a file then send it across the network and then read from file and use that public key.SIGH!!!! now to write it in the file i covert BYTE* to CHAR* and then inverse to read ...but to dont get the same value back. Do u have any better idea to do this?? Thanx again for ur help.