Hi Pete,

The XML I am using to calculate the digest attached. 

Please note this is openssl for windows on the command line.

The exact command is as follows:

> openssl dgst -sha256 -binary < "C:\syncsoft_canonical_ebmessaging.dat" > 
> "C:\digest.xml"

The correct digest as far as I see it should be:

h3glgGx5VGm0a6IOT3aBNJik8vJBnbaKhNzLD/DSebE=

Could you advise on the correct DigestInfo.

Cheers,

Jean-Paul


Jean-Paul Berthelot | Developer
SyncSoft | Ground Floor, 19-23 Prospect Street | Box Hill Vic 3128 | Australia  
T: +61 3 9236 1936 | M: 0432327799 | F: +61 3 9236 1999 
E: jean.paul.berthe...@syncsoft.com.au | W: www.syncsoft.com.au
 
***NOTICE*** 
This e-mail/facsimile may contain confidential or legally privileged material 
and if you are not the intended recipient, you are advised that Synchronised 
Software Pty Ltd does not consent to you reading or copying the material and 
does not waive any confidentiality or legal privilege associated with it. This 
e-mail/facsimile may also contain material which is protected by copyright and 
if you are not the intended recipient, you are advised that Synchronised 
Software Pty Ltd has not consented to your reproduction of the material and 
there is no intention to provide you with an implied licence to exercise any of 
the rights of the copyright owner or an authorised licensee. If you have 
received this e-mail/facsimile in error, please advise Synchronised Software 
Pty Ltd immediately by return e-mail/facsimile or by telephone on 
61-3-9236-1900.
The recipient of this e-mail/facsimile is solely responsible for conducting 
such tests and virus scanning as may be necessary, before using any attachment, 
to ensure that the attachment does not contain any virus and that use of the 
attached materials will in no way corrupt the recipient's data or systems or 
those of any other person.
Please consider the environment before printing this message.

-----Original Message-----
From: Peter Dettman [mailto:peter.dett...@bouncycastle.org] 
Sent: Friday, 28 June 2013 11:25 AM
To: 'dev-crypto-csharp@bouncycastle.org'
Subject: Re: [dev-crypto-csharp] Calculate RSA SHA-256 digest value

It is very common to misuse the openssl command-line for this due to confusion 
over the DigestInfo structure, see e.g. my answer here:
http://stackoverflow.com/questions/14444741/cant-get-openssl-signed-data-to-match-net-signed-data-or-bouncycastle-signed-d

If that is not clear, please give the exact openssl command line you are trying 
to match.

Regards,
Pete Dettman

On 27/06/2013 7:24 PM, Mankowski, Chris wrote:
> I'm fairly certain it does exist in Bouncy Castle.
>
> Do you have any more information on this bug in .net?
>   
>
>
> ----- Original Message -----
> From: Jean-Paul Berthelot [mailto:jean.paul.berthe...@syncsoft.com.au]
> Sent: Thursday, June 27, 2013 07:09 AM
> To: dev-crypto-csharp@bouncycastle.org 
> <dev-crypto-csharp@bouncycastle.org>
> Subject: [dev-crypto-csharp] Calculate RSA SHA-256 digest value
>
> Hi,
>
>
>
> I have a specific problem I am trying to solve and I was wondering if Bouncy 
> Castle could assist me.
>
>
>
> I have a byte array contain an xml element and need to calculate the RSA 
> SHA-256 digest value.
>
>
>
> There is a bug in the native Microsoft SHA256Managed class that produces a 
> different has to when the digest is calculated via openssl on the command 
> line.
>
>
>
>
>
> Does Bouncy Castle offer a class that would take a byte array and the 
> calculate the RSA SHA-256 digest?
>
>
>
> I need the algorithm to be equivalent to OpenSSL.
>
>
>
> Could someone please advice me.
>
>
>
> Kind regards,
>
>
>
> Jean-Paul
>
> **********************************************************************
> Notice: This e-mail message and any attachment to this e-mail message may 
> contain information that is confidential, proprietary, privileged, legally 
> privileged and/or exempt from disclosure under applicable law.  If you are 
> not the intended recipient, please accept this as notice that any disclosure, 
> copying, distribution or use of the information contained in this 
> transmission is strictly prohibited. NFP reserves the right, to the extent 
> and under circumstances permitted by applicable law, to retain, monitor and 
> intercept e-mail messages to and from its systems.
>
> Any views or opinions expressed in this e-mail are those of the sender and do 
> not necessarily express those of NFP.  Although this transmission and any 
> attachment are believed to be free of any virus or other defect that might 
> affect any computer system into which it is received and opened, it is the 
> responsibility of the recipient to ensure that it is virus free and no 
> responsibility is accepted by NFP, its subsidiaries and affiliates, as 
> applicable, for any loss or damage arising in any way from its use.
>
> If you have received this e-mail in error, please immediately contact the 
> sender by return e-mail or by telephone at 212-301-4000 and destroy the 
> material in its entirety, whether electronic or hard copy format.
>


Attachment: syncsoft_canonical_ebmessaging.dat
Description: syncsoft_canonical_ebmessaging.dat

Reply via email to