You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Har oppdatert ett prosjekt som har brukt en gammel versjon av denne pakken. Når jeg da bruker nuget-pakken i .net6 applikasjonen, så ender jeg opp med en nullreference exception i System.Security.Cryptography.Xml.SignedXml. Er dette ett kjent problem?
System.Security.Cryptography.Xml.SignedXml.IsKeyTheCorrectAlgorithm(System.Security.Cryptography.AsymmetricAlgorithm, System.Type) in SignedXml.cs
System.Security.Cryptography.Xml.SignedXml.CheckSignedInfo(System.Security.Cryptography.AsymmetricAlgorithm) in SignedXml.cs
System.Security.Cryptography.Xml.SignedXml.CheckSignature(System.Security.Cryptography.AsymmetricAlgorithm) in SignedXml.cs
System.Security.Cryptography.Xml.SignedXml.CheckSignatureReturningKey(out System.Security.Cryptography.AsymmetricAlgorithm) in SignedXml.cs
Difi.SikkerDigitalPost.Klient.XmlValidering.ResponseValidator.ValidateSignatureAndCertificate(string, string)
Difi.SikkerDigitalPost.Klient.XmlValidering.ResponseValidator.ValidateHeaderSignature()
Difi.SikkerDigitalPost.Klient.XmlValidering.ResponseValidator.ValidateEmptyQueueReceipt()
Difi.SikkerDigitalPost.Klient.Api.SikkerDigitalPostKlient.SecurityValidationOfEmptyQueueReceipt(System.Xml.XmlDocument, System.Xml.XmlDocument)
Difi.SikkerDigitalPost.Klient.Api.SikkerDigitalPostKlient.HentKvitteringOgBekreftForrigeAsync(Difi.SikkerDigitalPost.Klient.Domene.Entiteter.Kvitteringer.Kvitteringsforespørsel, Difi.SikkerDigitalPost.Klient.Domene.Entiteter.Kvitteringer.Forretning.Forretningskvittering)
I SignedXml.cs ender det opp med at expectedType er null.
private static bool IsKeyTheCorrectAlgorithm(AsymmetricAlgorithm key, Type expectedType)
{
Type actualType = key.GetType();
if (actualType == expectedType)
return true;
// This check exists solely for compatibility with 4.6. Normally, we would expect "expectedType" to be the superclass type and
// the actualType to be the subclass.
if (expectedType.IsSubclassOf(actualType))
return true;
//
// "expectedType" comes from the KeyAlgorithm property of a SignatureDescription. The BCL SignatureDescription classes have historically
// denoted provider-specific implementations ("RSACryptoServiceProvider") rather than the base class for the algorithm ("RSA"). We could
// change those (at the risk of creating other compat problems) but we have no control over third party SignatureDescriptions.
//
// So, in the absence of a better approach, walk up the parent hierarchy until we find the ancestor that's a direct subclass of
// AsymmetricAlgorithm and treat that as the algorithm identifier.
//
while (expectedType != null && expectedType.BaseType != typeof(AsymmetricAlgorithm))
{
expectedType = expectedType.BaseType;
}
if (expectedType == null)
return false; // SignatureDescription specified something that isn't even a subclass of AsymmetricAlgorithm. For compatibility with 4.6, return false rather throw.
if (actualType.IsSubclassOf(expectedType))
return true;
return false;
}
The text was updated successfully, but these errors were encountered:
Har oppdatert ett prosjekt som har brukt en gammel versjon av denne pakken. Når jeg da bruker nuget-pakken i .net6 applikasjonen, så ender jeg opp med en nullreference exception i
System.Security.Cryptography.Xml.SignedXml
. Er dette ett kjent problem?I SignedXml.cs ender det opp med at
expectedType
er null.The text was updated successfully, but these errors were encountered: