<PackageReference Include="System.Security.Cryptography.Xml" Version="11.0.0-preview.2.26159.112" />

System.Security.Cryptography.Xml.EncryptedXml

public class EncryptedXml
Represents the process model for implementing XML encryption.
public const string XmlEncAES128KeyWrapUrl = "http://www.w3.org/2001/04/xmlenc#kw-aes128"

Represents the namespace Uniform Resource Identifier (URI) for the 128-bit Advanced Encryption Standard (AES) Key Wrap algorithm (also known as the Rijndael Key Wrap algorithm). This field is constant.

public const string XmlEncAES128Url = "http://www.w3.org/2001/04/xmlenc#aes128-cbc"

Represents the namespace Uniform Resource Identifier (URI) for the 128-bit Advanced Encryption Standard (AES) algorithm (also known as the Rijndael algorithm). This field is constant.

public const string XmlEncAES192KeyWrapUrl = "http://www.w3.org/2001/04/xmlenc#kw-aes192"

Represents the namespace Uniform Resource Identifier (URI) for the 192-bit Advanced Encryption Standard (AES) Key Wrap algorithm (also known as the Rijndael Key Wrap algorithm). This field is constant.

public const string XmlEncAES192Url = "http://www.w3.org/2001/04/xmlenc#aes192-cbc"

Represents the namespace Uniform Resource Identifier (URI) for the 192-bit Advanced Encryption Standard (AES) algorithm (also known as the Rijndael algorithm). This field is constant.

public const string XmlEncAES256KeyWrapUrl = "http://www.w3.org/2001/04/xmlenc#kw-aes256"

Represents the namespace Uniform Resource Identifier (URI) for the 256-bit Advanced Encryption Standard (AES) Key Wrap algorithm (also known as the Rijndael Key Wrap algorithm). This field is constant.

public const string XmlEncAES256Url = "http://www.w3.org/2001/04/xmlenc#aes256-cbc"

Represents the namespace Uniform Resource Identifier (URI) for the 256-bit Advanced Encryption Standard (AES) algorithm (also known as the Rijndael algorithm). This field is constant.

public const string XmlEncDESUrl = "http://www.w3.org/2001/04/xmlenc#des-cbc"

Represents the namespace Uniform Resource Identifier (URI) for the Digital Encryption Standard (DES) algorithm. This field is constant.

public const string XmlEncElementContentUrl = "http://www.w3.org/2001/04/xmlenc#Content"

Represents the namespace Uniform Resource Identifier (URI) for XML encryption element content. This field is constant.

public const string XmlEncElementUrl = "http://www.w3.org/2001/04/xmlenc#Element"

Represents the namespace Uniform Resource Identifier (URI) for an XML encryption element. This field is constant.

public const string XmlEncEncryptedKeyUrl = "http://www.w3.org/2001/04/xmlenc#EncryptedKey"

Represents the namespace Uniform Resource Identifier (URI) for the XML encryption <EncryptedKey> element. This field is constant.

public const string XmlEncNamespaceUrl = "http://www.w3.org/2001/04/xmlenc#"

Represents the namespace Uniform Resource Identifier (URI) for XML encryption syntax and processing. This field is constant.

public const string XmlEncRSA15Url = "http://www.w3.org/2001/04/xmlenc#rsa-1_5"

Represents the namespace Uniform Resource Identifier (URI) for the RSA Public Key Cryptography Standard (PKCS) Version 1.5 algorithm. This field is constant.

public const string XmlEncRSAOAEPUrl = "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"

Represents the namespace Uniform Resource Identifier (URI) for the RSA Optimal Asymmetric Encryption Padding (OAEP) encryption algorithm. This field is constant.

public const string XmlEncSHA256Url = "http://www.w3.org/2001/04/xmlenc#sha256"

Represents the namespace Uniform Resource Identifier (URI) for the SHA-256 algorithm. This field is constant.

public const string XmlEncSHA512Url = "http://www.w3.org/2001/04/xmlenc#sha512"

Represents the namespace Uniform Resource Identifier (URI) for the SHA-512 algorithm. This field is constant.

public const string XmlEncTripleDESKeyWrapUrl = "http://www.w3.org/2001/04/xmlenc#kw-tripledes"

Represents the namespace Uniform Resource Identifier (URI) for the TRIPLEDES key wrap algorithm. This field is constant.

public const string XmlEncTripleDESUrl = "http://www.w3.org/2001/04/xmlenc#tripledes-cbc"

Represents the namespace Uniform Resource Identifier (URI) for the Triple DES algorithm. This field is constant.

public Evidence DocumentEvidence { get; set; }

Gets or sets the evidence of the XmlDocument object from which the EncryptedXml object is constructed.

public Encoding Encoding { get; set; }

Gets or sets the encoding used for XML encryption.

public CipherMode Mode { get; set; }

Gets or sets the cipher mode used for XML encryption.

public PaddingMode Padding { get; set; }

Gets or sets the padding mode used for XML encryption.

public string Recipient { get; set; }

Gets or sets the recipient of the encrypted key information.

public XmlResolver Resolver { get; set; }

Gets or sets the XmlResolver object used by the Document Object Model (DOM) to resolve external XML references.

public int XmlDSigSearchDepth { get; set; }

Gets or sets the XML digital signature recursion depth to prevent infinite recursion and stack overflow. This might happen if the digital signature XML contains the URI that then points back to the original XML.

public EncryptedXml()

Initializes a new instance of the EncryptedXml class.

public EncryptedXml(XmlDocument document)

Initializes a new instance of the EncryptedXml class using the specified XML document.

public EncryptedXml(XmlDocument document, Evidence evidence)

Initializes a new instance of the EncryptedXml class using the specified XML document and evidence.

public static byte[] DecryptKey(byte[] keyData, SymmetricAlgorithm symmetricAlgorithm)

Decrypts an <EncryptedKey> element using a symmetric algorithm.

public static byte[] DecryptKey(byte[] keyData, RSA rsa, bool useOAEP)

Decrypts an <EncryptedKey> element using an asymmetric algorithm.

public static byte[] EncryptKey(byte[] keyData, SymmetricAlgorithm symmetricAlgorithm)

Encrypts a key using a symmetric algorithm that a recipient uses to decrypt an <EncryptedData> element.

public static byte[] EncryptKey(byte[] keyData, RSA rsa, bool useOAEP)

Encrypts the key that a recipient uses to decrypt an <EncryptedData> element.

public static void ReplaceElement(XmlElement inputElement, EncryptedData encryptedData, bool content)

Replaces the specified element with the specified EncryptedData object.

public void AddKeyNameMapping(string keyName, object keyObject)

Defines a mapping between a key name and a symmetric key or an asymmetric key.

public void ClearKeyNameMappings()

Resets all key name mapping.

public byte[] DecryptData(EncryptedData encryptedData, SymmetricAlgorithm symmetricAlgorithm)

Decrypts an <EncryptedData> element using the specified symmetric algorithm.

public void DecryptDocument()

Decrypts all <EncryptedData> elements of the XML document that were specified during initialization of the EncryptedXml class.

public virtual byte[] DecryptEncryptedKey(EncryptedKey encryptedKey)

Determines the key represented by the EncryptedKey element.

public EncryptedData Encrypt(XmlElement inputElement, X509Certificate2 certificate)

Encrypts the outer XML of an element using the specified X.509 certificate.

public EncryptedData Encrypt(XmlElement inputElement, string keyName)

Encrypts the outer XML of an element using the specified key in the key mapping table.

public byte[] EncryptData(byte[] plaintext, SymmetricAlgorithm symmetricAlgorithm)

Encrypts data in the specified byte array using the specified symmetric algorithm.

public byte[] EncryptData(XmlElement inputElement, SymmetricAlgorithm symmetricAlgorithm, bool content)

Encrypts the specified element or its contents using the specified symmetric algorithm.

public virtual byte[] GetDecryptionIV(EncryptedData encryptedData, string symmetricAlgorithmUri)

Retrieves the decryption initialization vector (IV) from an EncryptedData object.

public virtual SymmetricAlgorithm GetDecryptionKey(EncryptedData encryptedData, string symmetricAlgorithmUri)

Retrieves the decryption key from the specified EncryptedData object.

public virtual XmlElement GetIdElement(XmlDocument document, string idValue)

Determines how to resolve internal Uniform Resource Identifier (URI) references.

public void ReplaceData(XmlElement inputElement, byte[] decryptedData)

Replaces an <EncryptedData> element with a specified decrypted sequence of bytes.