AsymmetricAlgorithm.TryExportEncryptedPkcs8PrivateKeyPem メソッド

定義

オーバーロード

TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Byte>, PbeParameters, Span<Char>, Int32)

PKCS#8 EncryptedPrivateKeyInfo 形式の現在のキーを、PEM でエンコードされたバイトベースのパスワードでエクスポートしようとします。

TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Char>, PbeParameters, Span<Char>, Int32)

PKCS#8 EncryptedPrivateKeyInfo 形式の現在のキーを、文字ベースのパスワード PEM エンコードでエクスポートします。

TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Byte>, PbeParameters, Span<Char>, Int32)

ソース:
AsymmetricAlgorithm.cs
ソース:
AsymmetricAlgorithm.cs

PKCS#8 EncryptedPrivateKeyInfo 形式の現在のキーを、PEM でエンコードされたバイトベースのパスワードでエクスポートしようとします。

public:
 bool TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<System::Byte> passwordBytes, System::Security::Cryptography::PbeParameters ^ pbeParameters, Span<char> destination, [Runtime::InteropServices::Out] int % charsWritten);
public bool TryExportEncryptedPkcs8PrivateKeyPem (ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, Span<char> destination, out int charsWritten);
member this.TryExportEncryptedPkcs8PrivateKeyPem : ReadOnlySpan<byte> * System.Security.Cryptography.PbeParameters * Span<char> * int -> bool
Public Function TryExportEncryptedPkcs8PrivateKeyPem (passwordBytes As ReadOnlySpan(Of Byte), pbeParameters As PbeParameters, destination As Span(Of Char), ByRef charsWritten As Integer) As Boolean

パラメーター

passwordBytes
ReadOnlySpan<Byte>

キー マテリアルを暗号化するときにパスワードとして使用するバイト。

pbeParameters
PbeParameters

キー マテリアルを暗号化するときに使用する、パスワードベースの暗号化 (PBE) パラメーター。

destination
Span<Char>

PEM でエンコードされた PKCS#8 EncryptedPrivateKeyInfo データを受信する文字スパン。

charsWritten
Int32

このメソッドが返されるときに、 に書き込まれた文字数を示す値が destination格納されます。 このパラメーターは初期化前として処理されます。

戻り値

destination が出力を受け入れるだけの十分な大きさの場合は true。それ以外の場合は false

例外

キーをエクスポートすることができませんでした。

注釈

PEM でエンコードされた PKCS#8 EncryptedPrivateKeyInfo は、 で始まり -----BEGIN ENCRYPTED PRIVATE KEY----- 、 で -----END ENCRYPTED PRIVATE KEY-----終わり、PEM 境界間のキーの base64 でエンコードされた DER コンテンツを使用します。

PEM は IETF RFC 7468 の "strict" エンコード規則に従ってエンコードされます。

適用対象

TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Char>, PbeParameters, Span<Char>, Int32)

ソース:
AsymmetricAlgorithm.cs
ソース:
AsymmetricAlgorithm.cs
ソース:
AsymmetricAlgorithm.cs

PKCS#8 EncryptedPrivateKeyInfo 形式の現在のキーを、文字ベースのパスワード PEM エンコードでエクスポートします。

public:
 bool TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<char> password, System::Security::Cryptography::PbeParameters ^ pbeParameters, Span<char> destination, [Runtime::InteropServices::Out] int % charsWritten);
public bool TryExportEncryptedPkcs8PrivateKeyPem (ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters, Span<char> destination, out int charsWritten);
member this.TryExportEncryptedPkcs8PrivateKeyPem : ReadOnlySpan<char> * System.Security.Cryptography.PbeParameters * Span<char> * int -> bool
Public Function TryExportEncryptedPkcs8PrivateKeyPem (password As ReadOnlySpan(Of Char), pbeParameters As PbeParameters, destination As Span(Of Char), ByRef charsWritten As Integer) As Boolean

パラメーター

password
ReadOnlySpan<Char>

キー マテリアルを暗号化するときに使用するパスワード。

pbeParameters
PbeParameters

キー マテリアルを暗号化するときに使用する、パスワードベースの暗号化 (PBE) パラメーター。

destination
Span<Char>

PEM でエンコードされた PKCS#8 EncryptedPrivateKeyInfo データを受信する文字スパン。

charsWritten
Int32

このメソッドが返されるときに、 に書き込まれた文字数を示す値が destination格納されます。 このパラメーターは初期化前として処理されます。

戻り値

destination が出力を受け入れるだけの十分な大きさの場合は true。それ以外の場合は false

例外

キーをエクスポートすることができませんでした。

注釈

が PBKDF2 (パスワードベースのキー派生関数 2) を使用するアルゴリズムを示す場合 pbeParameters 、パスワードは UTF-8 エンコードを介してバイトに変換されます。

          A PEM-encoded PKCS#8 EncryptedPrivateKeyInfo will begin with
        `-----BEGIN ENCRYPTED PRIVATE KEY-----` and end with
        `-----END ENCRYPTED PRIVATE KEY-----`, with the base64 encoded DER
          contents of the key between the PEM boundaries.

          The PEM is encoded according to the IETF RFC 7468 "strict"
          encoding rules.

適用対象