EnvelopedCms.Decrypt 方法

定義

將已解碼的包裹 CMS/PKCS#7 訊息內容解密。

多載

Decrypt(RecipientInfo, X509Certificate2Collection)

藉由搜尋憑證存放區和所提供集合以取得相符的憑證和金鑰,透過指定收件者資訊將已解碼的包裹 CMS/PKCS#7 訊息內容解密。

Decrypt(RecipientInfo, AsymmetricAlgorithm)

使用指定的私密金鑰,透過任何指定收件者資訊將已解碼的包裹 CMS/PKCS#7 訊息內容解密。

Decrypt()

藉由搜尋憑證存放區以取得相符的憑證和金鑰,透過任何可用收件者將已解碼的包裹 CMS/PKCS#7 訊息內容解密。

Decrypt(RecipientInfo)

藉由搜尋憑證存放區以取得相符的憑證和金鑰,透過任何指定收件者資訊將已解碼的包裹 CMS/PKCS#7 訊息內容解密。

Decrypt(X509Certificate2Collection)

藉由搜尋憑證存放區和所提供集合以取得相符的憑證和金鑰,透過任何可用收件者資訊將已解碼的包裹 CMS/PKCS#7 訊息內容解密。

Decrypt(RecipientInfo, X509Certificate2Collection)

來源:
EnvelopedCms.cs
來源:
EnvelopedCms.cs
來源:
EnvelopedCms.cs

藉由搜尋憑證存放區和所提供集合以取得相符的憑證和金鑰,透過指定收件者資訊將已解碼的包裹 CMS/PKCS#7 訊息內容解密。

public:
 void Decrypt(System::Security::Cryptography::Pkcs::RecipientInfo ^ recipientInfo, System::Security::Cryptography::X509Certificates::X509Certificate2Collection ^ extraStore);
public void Decrypt (System.Security.Cryptography.Pkcs.RecipientInfo recipientInfo, System.Security.Cryptography.X509Certificates.X509Certificate2Collection extraStore);
member this.Decrypt : System.Security.Cryptography.Pkcs.RecipientInfo * System.Security.Cryptography.X509Certificates.X509Certificate2Collection -> unit
Public Sub Decrypt (recipientInfo As RecipientInfo, extraStore As X509Certificate2Collection)

參數

recipientInfo
RecipientInfo

要用於解密的收件者資訊。

extraStore
X509Certificate2Collection

除了用來尋找收件者憑證和私密金鑰的憑證存放區以外,要使用的憑證集合。

例外狀況

recipientInfoextraStore 參數為 null

密碼編譯作業無法完成。

物件目前狀態的方法呼叫無效。

備註

需要下列許可權才能存取 .NET Framework 上的解密金鑰:

適用於

Decrypt(RecipientInfo, AsymmetricAlgorithm)

來源:
EnvelopedCms.cs
來源:
EnvelopedCms.cs
來源:
EnvelopedCms.cs

使用指定的私密金鑰,透過任何指定收件者資訊將已解碼的包裹 CMS/PKCS#7 訊息內容解密。

public:
 void Decrypt(System::Security::Cryptography::Pkcs::RecipientInfo ^ recipientInfo, System::Security::Cryptography::AsymmetricAlgorithm ^ privateKey);
public void Decrypt (System.Security.Cryptography.Pkcs.RecipientInfo recipientInfo, System.Security.Cryptography.AsymmetricAlgorithm privateKey);
public void Decrypt (System.Security.Cryptography.Pkcs.RecipientInfo recipientInfo, System.Security.Cryptography.AsymmetricAlgorithm? privateKey);
member this.Decrypt : System.Security.Cryptography.Pkcs.RecipientInfo * System.Security.Cryptography.AsymmetricAlgorithm -> unit
Public Sub Decrypt (recipientInfo As RecipientInfo, privateKey As AsymmetricAlgorithm)

參數

recipientInfo
RecipientInfo

要用於解密的收件者資訊。

privateKey
AsymmetricAlgorithm

用於解密收件者特定資訊的私密金鑰。

例外狀況

recipientInfoprivateKey 參數為 null

密碼編譯作業無法完成。

物件目前狀態的方法呼叫無效。

備註

不同於 的其他多載,此多載 Decrypt不會搜尋證書存儲。 方法 MatchesCertificate(X509Certificate2) 可用來手動比對預期的憑證與 RecipientInfo.RecipientIdentifier 值,以評估私鑰對收件者資訊值的適用性。

另請參閱

適用於

Decrypt()

來源:
EnvelopedCms.cs
來源:
EnvelopedCms.cs
來源:
EnvelopedCms.cs

藉由搜尋憑證存放區以取得相符的憑證和金鑰,透過任何可用收件者將已解碼的包裹 CMS/PKCS#7 訊息內容解密。

public:
 void Decrypt();
public void Decrypt ();
member this.Decrypt : unit -> unit
Public Sub Decrypt ()

例外狀況

密碼編譯作業無法完成。

物件目前狀態的方法呼叫無效。

備註

EnvelopedCms.Decode應該在或任何其他Decrypt方法之前EnvelopedCms.Decrypt()呼叫。

如果無法存取,此方法 Decrypt() 就不會搜尋我的存放區計算機。

需要下列許可權才能存取 .NET Framework 上的解密金鑰:

適用於

Decrypt(RecipientInfo)

來源:
EnvelopedCms.cs
來源:
EnvelopedCms.cs
來源:
EnvelopedCms.cs

藉由搜尋憑證存放區以取得相符的憑證和金鑰,透過任何指定收件者資訊將已解碼的包裹 CMS/PKCS#7 訊息內容解密。

public:
 void Decrypt(System::Security::Cryptography::Pkcs::RecipientInfo ^ recipientInfo);
public void Decrypt (System.Security.Cryptography.Pkcs.RecipientInfo recipientInfo);
member this.Decrypt : System.Security.Cryptography.Pkcs.RecipientInfo -> unit
Public Sub Decrypt (recipientInfo As RecipientInfo)

參數

recipientInfo
RecipientInfo

要用於解密的收件者資訊。

例外狀況

recipientInfo 參數為 null

密碼編譯作業無法完成。

物件目前狀態的方法呼叫無效。

備註

需要下列許可權才能存取 .NET Framework 上的解密金鑰:

適用於

Decrypt(X509Certificate2Collection)

來源:
EnvelopedCms.cs
來源:
EnvelopedCms.cs
來源:
EnvelopedCms.cs

藉由搜尋憑證存放區和所提供集合以取得相符的憑證和金鑰,透過任何可用收件者資訊將已解碼的包裹 CMS/PKCS#7 訊息內容解密。

public:
 void Decrypt(System::Security::Cryptography::X509Certificates::X509Certificate2Collection ^ extraStore);
public void Decrypt (System.Security.Cryptography.X509Certificates.X509Certificate2Collection extraStore);
member this.Decrypt : System.Security.Cryptography.X509Certificates.X509Certificate2Collection -> unit
Public Sub Decrypt (extraStore As X509Certificate2Collection)

參數

extraStore
X509Certificate2Collection

除了用來尋找收件者憑證和私密金鑰的憑證存放區以外,要使用的憑證集合。

例外狀況

extraStore 參數為 null

密碼編譯作業無法完成。

物件目前狀態的方法呼叫無效。

備註

需要下列許可權才能存取 .NET Framework 上的解密金鑰:

適用於