EncryptedXml.DecryptKey 方法

定义

<EncryptedKey>解密元素。

重载

名称 说明
DecryptKey(Byte[], SymmetricAlgorithm)

<EncryptedKey>使用对称算法解密元素。

DecryptKey(Byte[], RSA, Boolean)

<EncryptedKey>使用非对称算法解密元素。

注解

使用该方法 DecryptKey 解密 <EncryptedKey> 元素并检索用于解密该元素的密钥。

DecryptKey(Byte[], SymmetricAlgorithm)

Source:
EncryptedXml.cs
Source:
EncryptedXml.cs
Source:
EncryptedXml.cs
Source:
EncryptedXml.cs
Source:
EncryptedXml.cs
Source:
EncryptedXml.cs
Source:
EncryptedXml.cs
Source:
EncryptedXml.cs

<EncryptedKey>使用对称算法解密元素。

public:
 static cli::array <System::Byte> ^ DecryptKey(cli::array <System::Byte> ^ keyData, System::Security::Cryptography::SymmetricAlgorithm ^ symmetricAlgorithm);
public static byte[] DecryptKey(byte[] keyData, System.Security.Cryptography.SymmetricAlgorithm symmetricAlgorithm);
static member DecryptKey : byte[] * System.Security.Cryptography.SymmetricAlgorithm -> byte[]
Public Shared Function DecryptKey (keyData As Byte(), symmetricAlgorithm As SymmetricAlgorithm) As Byte()

参数

keyData
Byte[]

表示加密 <EncryptedKey> 元素的字节数组。

symmetricAlgorithm
SymmetricAlgorithm

用于解密 keyData的对称密钥。

返回

Byte[]

包含纯文本键的字节数组。

例外

参数的值 keyDatanull.

-或-

参数的值 symmetricAlgorithmnull.

元素的值 symmetricAlgorithm 不是三重 DES 密钥包装算法或高级加密标准 (AES) 密钥包装算法(也称为 Rijndael)。

注解

该方法 DecryptKey 解密 XML 文档元素中包含的 <EncryptedKey> 加密密钥。 此方法接受表示 Triple DES 算法或 AES 键换行算法(也称为 Rijndael)的参数的值 symmetricAlgorithm

适用于

DecryptKey(Byte[], RSA, Boolean)

Source:
EncryptedXml.cs
Source:
EncryptedXml.cs
Source:
EncryptedXml.cs
Source:
EncryptedXml.cs
Source:
EncryptedXml.cs
Source:
EncryptedXml.cs
Source:
EncryptedXml.cs
Source:
EncryptedXml.cs

<EncryptedKey>使用非对称算法解密元素。

public:
 static cli::array <System::Byte> ^ DecryptKey(cli::array <System::Byte> ^ keyData, System::Security::Cryptography::RSA ^ rsa, bool useOAEP);
public static byte[] DecryptKey(byte[] keyData, System.Security.Cryptography.RSA rsa, bool useOAEP);
static member DecryptKey : byte[] * System.Security.Cryptography.RSA * bool -> byte[]
Public Shared Function DecryptKey (keyData As Byte(), rsa As RSA, useOAEP As Boolean) As Byte()

参数

keyData
Byte[]

表示加密 <EncryptedKey> 元素的字节数组。

rsa
RSA

用于解密 keyData的非对称密钥。

useOAEP
Boolean

一个值,该值指定是否使用最佳非对称加密填充(OAEP)。

返回

Byte[]

包含纯文本键的字节数组。

例外

参数的值 keyDatanull.

-或-

参数的值 rsanull.

注解

该方法 DecryptKey 解密 XML 文档元素中包含的 <EncryptedKey> 加密密钥。 此方法接受表示 RSA PKCS#1 v1.5 算法或 RSA PKCS#1 类型 2 算法(也称为 OAEP 填充)的参数的值 rsa

适用于