DpapiNGXmlEncryptor Class¶
A class that can encrypt XML elements using Windows DPAPI:NG.
- Namespace
Microsoft.AspNetCore.DataProtection.XmlEncryption
- Assemblies
- Microsoft.AspNetCore.DataProtection
Syntax¶
public sealed class DpapiNGXmlEncryptor : IXmlEncryptor
-
class
Microsoft.AspNetCore.DataProtection.XmlEncryption.
DpapiNGXmlEncryptor
Constructors¶
-
DpapiNGXmlEncryptor
(System.String, Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiNGProtectionDescriptorFlags)¶ Creates a new instance of a
Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiNGXmlEncryptor
.Arguments: - protectionDescriptorRule (System.String) – The rule string from which to create the protection descriptor.
- flags (Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiNGProtectionDescriptorFlags) – Flags controlling the creation of the protection descriptor.
public DpapiNGXmlEncryptor(string protectionDescriptorRule, DpapiNGProtectionDescriptorFlags flags)
-
DpapiNGXmlEncryptor
(System.String, Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiNGProtectionDescriptorFlags, System.IServiceProvider) Creates a new instance of a
Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiNGXmlEncryptor
.Arguments: - protectionDescriptorRule (System.String) – The rule string from which to create the protection descriptor.
- flags (Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiNGProtectionDescriptorFlags) – Flags controlling the creation of the protection descriptor.
- services (System.IServiceProvider) – An optional
System.IServiceProvider
to provide ancillary services.
public DpapiNGXmlEncryptor(string protectionDescriptorRule, DpapiNGProtectionDescriptorFlags flags, IServiceProvider services)
-
Methods¶
-
Encrypt
(System.Xml.Linq.XElement)¶ Encrypts the specified
System.Xml.Linq.XElement
.Arguments: plaintextElement (System.Xml.Linq.XElement) – The plaintext to encrypt. Return type: Microsoft.AspNetCore.DataProtection.XmlEncryption.EncryptedXmlInfo Returns: An Microsoft.AspNetCore.DataProtection.XmlEncryption.EncryptedXmlInfo
that contains the encrypted value of <em>plaintextElement</em> along with information about how to decrypt it.public EncryptedXmlInfo Encrypt(XElement plaintextElement)
-