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:
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:
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)