AsymmetricAlgorithm.ExportEncryptedPkcs8PrivateKey 方法

定義

多載

ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters)

使用位元組型密碼以 PKCS#8 EncryptedPrivateKeyInfo 格式匯出目前金鑰。

ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters)

使用 Char 型密碼以 PKCS#8 EncryptedPrivateKeyInfo 格式匯出目前金鑰。

ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters)

來源:
AsymmetricAlgorithm.cs
來源:
AsymmetricAlgorithm.cs
來源:
AsymmetricAlgorithm.cs

使用位元組型密碼以 PKCS#8 EncryptedPrivateKeyInfo 格式匯出目前金鑰。

public:
 virtual cli::array <System::Byte> ^ ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<System::Byte> passwordBytes, System::Security::Cryptography::PbeParameters ^ pbeParameters);
public virtual byte[] ExportEncryptedPkcs8PrivateKey (ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters);
abstract member ExportEncryptedPkcs8PrivateKey : ReadOnlySpan<byte> * System.Security.Cryptography.PbeParameters -> byte[]
override this.ExportEncryptedPkcs8PrivateKey : ReadOnlySpan<byte> * System.Security.Cryptography.PbeParameters -> byte[]
Public Overridable Function ExportEncryptedPkcs8PrivateKey (passwordBytes As ReadOnlySpan(Of Byte), pbeParameters As PbeParameters) As Byte()

參數

passwordBytes
ReadOnlySpan<Byte>

加密金鑰內容時要用作密碼的位元組。

pbeParameters
PbeParameters

加密金鑰產製原料時要使用的密碼型加密 (PBE) 參數。

傳回

Byte[]

位元組陣列,其中包含此金鑰的 PKCS#8 EncryptedPrivateKeyInfo 表示。

例外狀況

無法匯出金鑰。

-或-

pbeParameters 指出應該使用 TripleDes3KeyPkcs12,這需要 Char 型密碼。

備註

密碼位元組會直接傳遞至金鑰衍生函式, (KDF) 由 所指示 pbeParameters 的演算法使用。 這可讓與使用 UTF-8 以外的文字編碼的其他系統相容,以 PBKDF2 處理密碼 (密碼型金鑰衍生函式 2) 。

另請參閱

適用於

ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters)

來源:
AsymmetricAlgorithm.cs
來源:
AsymmetricAlgorithm.cs
來源:
AsymmetricAlgorithm.cs

使用 Char 型密碼以 PKCS#8 EncryptedPrivateKeyInfo 格式匯出目前金鑰。

public:
 virtual cli::array <System::Byte> ^ ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, System::Security::Cryptography::PbeParameters ^ pbeParameters);
public virtual byte[] ExportEncryptedPkcs8PrivateKey (ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters);
abstract member ExportEncryptedPkcs8PrivateKey : ReadOnlySpan<char> * System.Security.Cryptography.PbeParameters -> byte[]
override this.ExportEncryptedPkcs8PrivateKey : ReadOnlySpan<char> * System.Security.Cryptography.PbeParameters -> byte[]
Public Overridable Function ExportEncryptedPkcs8PrivateKey (password As ReadOnlySpan(Of Char), pbeParameters As PbeParameters) As Byte()

參數

password
ReadOnlySpan<Char>

加密金鑰產製原料時要使用的密碼。

pbeParameters
PbeParameters

加密金鑰產製原料時要使用的密碼型加密 (PBE) 參數。

傳回

Byte[]

位元組陣列,其中包含此金鑰的 PKCS#8 EncryptedPrivateKeyInfo 表示。

例外狀況

無法匯出金鑰。

備註

pbeParameters 指出使用 PBKDF2 的演算法 (密碼型金鑰衍生函式 2) 時,密碼會透過 UTF-8 編碼轉換成位元組。

另請參閱

適用於