Код заключается в следующем: < /p>
Код: Выделить всё
public static ConfigRoot ValidateAndLoadSignedConfig(string signedXml, RSA publicKey)
{
// Load the signed XML
XmlDocument xmlDoc = new();
xmlDoc.LoadXml(signedXml);
// Verify the signature
SignedXml signedXmlVerifier = new(xmlDoc);
XmlNodeList signatureNodes = xmlDoc.GetElementsByTagName("Signature");
if (signatureNodes?.Count != 1)
{
throw new CryptographicException("No signature");
}
signedXmlVerifier.LoadXml((XmlElement)signatureNodes[0]);
if (!signedXmlVerifier.CheckSignature(publicKey)) //
Я думаю что -то оптимизировано. Поэтому я добавил их в CSPROJ моего проекта приложения: < /p>
[code]
apk
true
r8
proguard.cfg
portable
true
SdkOnly
Код: Выделить всё
-keep class androidx.security.crypto.** { *; }
-keep class com.google.crypto.tink.** { *; }
# Keep all classes in System.Security.Cryptography.Xml
-keep class System.Security.Cryptography.Xml.** { *; }
# Keep classes used by SignedXml and RSA
-keep class System.Security.Cryptography.Xml.SignedXml { *; }
-keep class System.Security.Cryptography.Xml.RSAPKCS1SignatureDescription { *; }
# Keep XML serialization classes (if used)
-keep class System.Xml.** { *; }
< /code>
Но это не имеет значения ... < /p>
[Решено] < /p>
сразу после публикации, я нашел Это на github: https://github.com/dotnet/runtime/issues/97242 твою System.security.cryptography
Подробнее здесь: https://stackoverflow.com/questions/794 ... hybrid-app