Good afternoon.
I’ m Looking for a solution to create a hash key type Sha1 encoded Base64.
In openssl is done by executing in CMD:
‘openssl dgst sha1-sign Fileprivatekey.pem out Filemessage.sha1 message’
and thain
‘Openssl enc -base64 -in Filemessage.sha1 -out FileMsgb64 –A’
I can do runshell() openssl but I wanted to avoid using external exes and not install openssl on customers PCs.
Any body now some dll or Api that does this type of commands, or know or recommend any api that I can use to do this type of keys?
or what is the Api Openssl Dll to do This kind of hash!??
Any Light or idea, I will Appreciate
Thanks for attention
Best regards.
Pedro.
Use OpenSSl comand from API / DLL
Use OpenSSl comand from API / DLL
Pedro Alexandre
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: Use OpenSSl comand from API / DLL
Look at Crytosys.net. They have two products, cryptosys api and cryptosys pki. The are win32 dll's that are rather easy to use. I used cryptosys api for AES encryption purposes. I think it has the additional items you are looking for in one of the two libraries. Cost is rather inexpensive. $159 each in US dollars. There are different tools but have some overlay. I uses the VB6 examples to create the Win32 dll function wrappers. They also work in a com activex fashion but I prefer to use the straight win32 DLL.
What the dll function calls as you need to have the pass by reference code, @, in the function definition itself, not only in the function call as the pass by reference must be carried forward to the actual Win32 call to get the return variable.
Cliff.
What the dll function calls as you need to have the pass by reference code, @, in the function definition itself, not only in the function call as the pass by reference must be carried forward to the actual Win32 call to get the return variable.
Cliff.
Re: Use OpenSSl comand from API / DLL
Cliff. Many Thanks for reply.
Right now I'm trying to run the commands mentioned in the previous post, from the DLL libeay32.dll from openssl.
It's a matter of time and research so I can get it.
It's a toothless that xbase has nothing on this type of tool increasingly important in current times.
If we look at what is free xHarbour Libs have all these and many more.
Surely this issue will be more important in the near future.
My apologies to Roger for presenting this subject in this forum, because it has nothing to do with the title purpose.
Again many thanks to Cliff for the opinion.
I was hoping someone has experience with the API of openssl.
At this point any tip can show me the right way.
I´m Almost there ...
best regards.
Pedro.
Right now I'm trying to run the commands mentioned in the previous post, from the DLL libeay32.dll from openssl.
It's a matter of time and research so I can get it.
It's a toothless that xbase has nothing on this type of tool increasingly important in current times.
If we look at what is free xHarbour Libs have all these and many more.
Surely this issue will be more important in the near future.
My apologies to Roger for presenting this subject in this forum, because it has nothing to do with the title purpose.
Again many thanks to Cliff for the opinion.
I was hoping someone has experience with the API of openssl.
At this point any tip can show me the right way.
I´m Almost there ...
best regards.
Pedro.
Pedro Alexandre
Re: Use OpenSSl comand from API / DLL
Hi Pedro
The dll of CryptoSys is excellent.
http://www.cryptosys.net/pki/
Wrapper using ot4xb library of Pablo Botella is free, is not necessary openssl.dll .or libeay32.dll
Best Regard
Hector
Example : wrapper wih ot4xb.dll
#xtranslate HASH_HexFromFile([<params,...>]) =>;
FpQCall({"diCrPKI","HASH_HexFromFile" },"__sl__pt__sl__pt__sl"[,<params>])
// ' Create an SHA-1 digest value in hex format
strDigest = Space (40) //(PKI_SHA1_CHARS)
nLen = HASH_HexFromBytes(@strDigest, Len(strDigest), @strData, Len(strData), 0 ) //PKI_HASH_SHA1)
// ' Display in base64
// ? "SHA1(DA)= esto es importante en base64" , cnvB64StrFromBytes(cnvBytesFromHexStr(strDigest))
// msgbox(cPrintf( "SIG= : %s", strDigest))
return strDigest
The dll of CryptoSys is excellent.
http://www.cryptosys.net/pki/
Wrapper using ot4xb library of Pablo Botella is free, is not necessary openssl.dll .or libeay32.dll
Best Regard
Hector
Example : wrapper wih ot4xb.dll
#xtranslate HASH_HexFromFile([<params,...>]) =>;
FpQCall({"diCrPKI","HASH_HexFromFile" },"__sl__pt__sl__pt__sl"[,<params>])
// ' Create an SHA-1 digest value in hex format
strDigest = Space (40) //(PKI_SHA1_CHARS)
nLen = HASH_HexFromBytes(@strDigest, Len(strDigest), @strData, Len(strData), 0 ) //PKI_HASH_SHA1)
// ' Display in base64
// ? "SHA1(DA)= esto es importante en base64" , cnvB64StrFromBytes(cnvBytesFromHexStr(strDigest))
// msgbox(cPrintf( "SIG= : %s", strDigest))
return strDigest
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: Use OpenSSl comand from API / DLL
I also did the wrappers without using Pablos library.
Re: Use OpenSSl comand from API / DLL
patito.
many thanks for feedback
I need this to work with openssl.
I have other solutions to work with openssl.
è robust and free.
I have SSL functions that work very well.
Thanks to Phil Idle examples.
But this small example rsa_sign not going well for me, and I do not see why.
cares to take a look.
You may have a different view.
What I want is that the function returns a message signed by the private key in the format sha1.
and than encoded in Base64, but this point I have not problema.
IF anybody can see this rsa.prg sample, maybe can help..
many Thanks in advance.
Thank you.
Pedro
many thanks for feedback
I need this to work with openssl.
I have other solutions to work with openssl.
è robust and free.
I have SSL functions that work very well.
Thanks to Phil Idle examples.
But this small example rsa_sign not going well for me, and I do not see why.
cares to take a look.
You may have a different view.
What I want is that the function returns a message signed by the private key in the format sha1.
and than encoded in Base64, but this point I have not problema.
IF anybody can see this rsa.prg sample, maybe can help..
many Thanks in advance.
Thank you.
Pedro
- Attachments
-
- Rsa.rar
- Rsa.prg
- (450.72 KiB) Downloaded 926 times
Pedro Alexandre
Re: Use OpenSSl comand from API / DLL
Hi Pedro
If you need this routine for Billing Software Certification , I recommend
lose no time, as you need to know thoroughly the openssl, Bio handling, etc, so its function rsa_sign () fails.
If you are from Portugal, talk to Pablo Botella, sure he can give you the solution.
And the other thing to check this link which has been recommended at you.
http://www.cryptosys.net/pki/portugal_D ... tware.html
Best Regard
Hector
If you need this routine for Billing Software Certification , I recommend
lose no time, as you need to know thoroughly the openssl, Bio handling, etc, so its function rsa_sign () fails.
If you are from Portugal, talk to Pablo Botella, sure he can give you the solution.
And the other thing to check this link which has been recommended at you.
http://www.cryptosys.net/pki/portugal_D ... tware.html
Best Regard
Hector