Extensions.Configuration.Xml -> XmlDocumentDecryptor: How to provide encryption algorithm? #66453
Unanswered
marlon-tucker
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I've been trying to determine how the following class can be used:
https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlDocumentDecryptor.cs
From what I can see, it creates a new
EncryptedXml
class and then callsDecryptDocument
:runtime/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlDocumentDecryptor.cs
Lines 95 to 96 in 5c0c317
However, reading the documentation for the
EncryptedXml
class, it indicates an encryption algorithm should be set before calling theDecrpytDocument
method, and I can't see any way that can be achieved. The factory method appears to be only used for testing and there's no way to provide an alternative decryptor to the standardXmlConfigurationProvider
.https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.xml.encryptedxml.decryptdocument?view=dotnet-plat-ext-6.0
Are developers supposed to inherit from
XmlDocumentDecryptor
which can then provide it's own implementation. Create a new custom Xml Configuration provider and then forward onto theXmlStreamConfigurationProvider
?The standard decryptor class has a nice helper method to determine if a Xml document has any encrypted elements, but that method is marked as private so it feels like it isn't intended to be inherited.
Beta Was this translation helpful? Give feedback.
All reactions