AsymmetricAlgorithm.ExportEncryptedPkcs8PrivateKey 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters) |
以 PKCS#8 EncryptedPrivateKeyInfo 格式匯出目前金鑰,並以位元組為基礎的密碼。 |
| ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters) |
以 PKCS#8 EncryptedPrivateKeyInfo 格式匯出目前金鑰,並以字元為基礎的密碼。 |
ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, PbeParameters)
以 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)參數。
傳回
一個包含 PKCS#8 EncryptedPrivateKeyInfo 表示的位元組陣列。
例外狀況
備註
密碼位元組直接傳送到由所 pbeParameters指示的演算法所使用的金鑰衍生函數(KDF)。
這使得在處理密碼時使用非 UTF-8 的系統能夠相容於 PBKDF2(Password-Based 金鑰衍生函數 2)的密碼。
另請參閱
適用於
ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, PbeParameters)
以 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)參數。
傳回
一個包含 PKCS#8 EncryptedPrivateKeyInfo 表示的位元組陣列。
例外狀況
該金鑰無法匯出。
備註
當 pbeParameters 表示使用 PBKDF2(Password-Based 金鑰衍生函數 2)的演算法時,密碼會透過 UTF-8 編碼轉換為位元組。