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
I try to sign an XML but with an URI = Id whose value is numerical.
But "compute Signature" will not sign and generates an error:
System.Security.Cryptography.CryptographicException: Malformed reference element.
Certificado = New X509Certificate2(_CertArchivo, _CertContrasenia, X509KeyStorageFlags.Exportable)
Dim ReferenceId As String = FindReferenceId(xdTmp)........'Call Function ReferenceID'
refTmp = New Reference With {
.Uri = "#" & ReferenceId
}
refTmp.AddTransform(New XmlDsigEnvelopedSignatureTransform)
Uh oh!
There was an error while loading. Please reload this page.
VB.net 2022:
I try to sign an XML but with an URI = Id whose value is numerical.
But "compute Signature" will not sign and generates an error:
System.Security.Cryptography.CryptographicException: Malformed reference element.
Certificado = New X509Certificate2(_CertArchivo, _CertContrasenia, X509KeyStorageFlags.Exportable)
.PreserveWhitespace = False
}
sxTmp = New SignedXml(xdTmp) With {
.SigningKey = Certificado.GetRSAPrivateKey
}
sxTmp.SignedInfo.SignatureMethod = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"
sxTmp.SignedInfo.CanonicalizationMethod = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315"
refTmp.AddTransform(New XmlDsigC14NWithCommentsTransform)
sxTmp.AddReference(refTmp)
The text was updated successfully, but these errors were encountered: