Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Commit

Permalink
Change digest type, because that fixed an error for some reason.
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronArrick committed Aug 29, 2019
1 parent 7aa6feb commit f8eb5d1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
using Difi.SikkerDigitalPost.Klient.Domene.Extensions;
using Difi.SikkerDigitalPost.Klient.Envelope.Abstract;
using Difi.SikkerDigitalPost.Klient.Utilities;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Digests;

namespace Difi.SikkerDigitalPost.Klient.Envelope.Forretningsmelding
{
internal class DigitalPostElement : EnvelopeXmlPart
{
private readonly Sha256Digest _managedSha256;
private readonly IDigest _managedSha256;

public DigitalPostElement(EnvelopeSettings settings, XmlDocument context)
: base(settings, context)
Expand Down Expand Up @@ -165,7 +166,7 @@ private XmlElement DokumentpakkeFingeravtrykkElement()
digestMethod.SetAttribute("Algorithm", "http://www.w3.org/2001/04/xmlenc#sha256");

var digestValue = dokumentpakkefingeravtrykk.AppendChildElement("DigestValue", "ns5", NavneromUtility.XmlDsig, Context);

var hash = new byte[_managedSha256.GetDigestSize()];
_managedSha256.BlockUpdate(Settings.DocumentBundle.BundleBytes, 0, Settings.DocumentBundle.BundleBytes.Length);
_managedSha256.DoFinal(hash, 0);
Expand Down

0 comments on commit f8eb5d1

Please sign in to comment.