If you haven't figured it out yet, you need to provide the -a/-base64 option
to 'openssl enc' to encode/decode the base64 data. Check 'man enc'.

-Sandeep

On Sun, Sep 5, 2010 at 1:13 PM, tera tellence <[email protected]>wrote:

> Hi,
>
> Thank you for the reply.
>
> I now send the signature and original message as base64 format from System
> A(Java Machine) and now at System B I decode it using:
>
> openssl enc -d -in sig.b64 -out sig.bin
>
> But unfortunately, the output file is empty!
>
> I wonder why!
>
> Also, I do the same on my original file that I pass to System B (in
> base64).
>
> I decode it as:
>
> openssl enc -d -in orig.b64 -out orig.bin
>
> But the orig.bin now contains the text that I sent(string) and not the
> binary.
>
> What am I missing?
>
>
> On Fri, Sep 3, 2010 at 10:13 AM, tera tellence <[email protected]>wrote:
>
>> Dear all,
>>
>>
>> I have to sign a message with a private key using the sha1 with RSA using
>> the Java JCE(Bouncy Castle engine) on System A.
>>
>> I then have to pass the public key, the original message and the signature
>> to  System B which uses OpenSSL to verify the signature.
>>
>> At the openSSL end, I use:
>>
>> openssl dgst -sha1 -verify pubkey.pem -signature s.sign data.sha1
>>
>>
>> Where: pubkey.pem is the public key I pass as a PEM format.
>>
>> s.sign= signature in hex format( here I am not sure what format to use)
>>
>> data.sha1= I get send the original message to system B as a hex string. At
>> System B I compute the sha1 digest of this hex string and store it at
>> data.sha1 to verify.
>>
>>
>> However the verification always fails.
>>
>>
>> With this regard, what are the expected formats of the files?
>>
>> Is there a way to use a hex file for data and signature? or even a base64
>> encoded signature and data for verification?
>>
>> What am I doing wrong here?
>>
>>
>> Please help!!
>>
>>
>> Regards,
>>
>> Tera Tellence
>>
>
>

Reply via email to