ECAlgorithm.ImportEncryptedPkcs8PrivateKey メソッド

定義

オーバーロード

名前 説明
ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32)

バイトベースのパスワードで復号化した後、PKCS#8 EncryptedPrivateKeyInfo 構造体から公開/秘密キーペアをインポートし、このオブジェクトのキーを置き換えます。

ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32)

バイトベースのパスワードで復号化した後、PKCS#8 EncryptedPrivateKeyInfo 構造体から公開/秘密キーペアをインポートし、このオブジェクトのキーを置き換えます。

ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Int32)

ソース:
ECAlgorithm.cs
ソース:
ECAlgorithm.cs
ソース:
ECAlgorithm.cs
ソース:
ECAlgorithm.cs
ソース:
ECAlgorithm.cs

バイトベースのパスワードで復号化した後、PKCS#8 EncryptedPrivateKeyInfo 構造体から公開/秘密キーペアをインポートし、このオブジェクトのキーを置き換えます。

public:
 override void ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<System::Byte> passwordBytes, ReadOnlySpan<System::Byte> source, [Runtime::InteropServices::Out] int % bytesRead);
public override void ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, ReadOnlySpan<byte> source, out int bytesRead);
override this.ImportEncryptedPkcs8PrivateKey : ReadOnlySpan<byte> * ReadOnlySpan<byte> * int -> unit
Public Overrides Sub ImportEncryptedPkcs8PrivateKey (passwordBytes As ReadOnlySpan(Of Byte), source As ReadOnlySpan(Of Byte), ByRef bytesRead As Integer)

パラメーター

passwordBytes
ReadOnlySpan<Byte>

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

source
ReadOnlySpan<Byte>

ASN.1-BER エンコード内の PKCS#8 EncryptedPrivateKeyInfo 構造体のバイト。

bytesRead
Int32

このメソッドから制御が戻るときに、 sourceから読み取られたバイト数を示す値が格納されます。 このパラメーターは、初期化されていないものとして扱われます。

例外

パスワードが正しくありません。

-又は-

sourceの内容は、適用するキー派生関数 (KDF) が従来の PKCS#12 KDF であり、char ベースのパスワードが必要であることを示します。

-又は-

sourceの内容は、ASN.1-BER でエンコードされた PKCS#8 EncryptedPrivateKeyInfo 構造体を表していません。

-又は-

sourceの内容は、キーがこのインスタンスによって表されるアルゴリズム以外のアルゴリズム用であることを示します。

-又は-

sourceの内容は、サポートされていない形式でキーを表します。

-又は-

アルゴリズム固有のキーのインポートに失敗しました。

派生クラスは、 ImportParameters(ECParameters)の実装を提供していません。

注釈

パスワード バイトは、EncryptedPrivateKeyInfo コンテンツによって示されるアルゴリズムによって使用されるキー派生関数 (KDF) に直接渡されます。 これにより、PBKDF2 (Password-Based キー派生関数 2) でパスワードを処理するときに UTF-8 以外のテキスト エンコードを使用する他のシステムとの互換性が確保されます。

          This method only supports the binary (BER/CER/DER) encoding of EncryptedPrivateKeyInfo.
          If the value is Base64-encoded, the caller must Base64-decode the contents before calling this method.
          If the contents are PEM-encoded, <xref:System.Security.Cryptography.ECAlgorithm.ImportFromEncryptedPem(System.ReadOnlySpan{System.Char},System.ReadOnlySpan{System.Byte})>
          should be used.

適用対象

ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<Char>, ReadOnlySpan<Byte>, Int32)

ソース:
ECAlgorithm.cs
ソース:
ECAlgorithm.cs
ソース:
ECAlgorithm.cs
ソース:
ECAlgorithm.cs
ソース:
ECAlgorithm.cs

バイトベースのパスワードで復号化した後、PKCS#8 EncryptedPrivateKeyInfo 構造体から公開/秘密キーペアをインポートし、このオブジェクトのキーを置き換えます。

public:
 override void ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, ReadOnlySpan<System::Byte> source, [Runtime::InteropServices::Out] int % bytesRead);
public override void ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, ReadOnlySpan<byte> source, out int bytesRead);
override this.ImportEncryptedPkcs8PrivateKey : ReadOnlySpan<char> * ReadOnlySpan<byte> * int -> unit
Public Overrides Sub ImportEncryptedPkcs8PrivateKey (password As ReadOnlySpan(Of Char), source As ReadOnlySpan(Of Byte), ByRef bytesRead As Integer)

パラメーター

password
ReadOnlySpan<Char>

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

source
ReadOnlySpan<Byte>

ASN.1-BER エンコード内の PKCS#8 EncryptedPrivateKeyInfo 構造体のバイト。

bytesRead
Int32

このメソッドから制御が戻るときに、 sourceから読み取られたバイト数を示す値が格納されます。 このパラメーターは、初期化されていないものとして扱われます。

例外

sourceの内容は、ASN.1-BER でエンコードされた PKCS#8 EncryptedPrivateKeyInfo 構造体を表していません。

-又は-

sourceの内容は、キーがこのインスタンスによって表されるアルゴリズム以外のアルゴリズム用であることを示します。

-又は-

sourceの内容は、サポートされていない形式でキーを表します。

-又は-

アルゴリズム固有のキーのインポートに失敗しました。

派生クラスは、 ImportParameters(ECParameters)の実装を提供していません。

注釈

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

          This method only supports the binary (BER/CER/DER) encoding of EncryptedPrivateKeyInfo.
          If the value is Base64-encoded, the caller must Base64-decode the contents before calling this method.
          If the contents are PEM-encoded, <xref:System.Security.Cryptography.ECAlgorithm.ImportFromEncryptedPem(System.ReadOnlySpan{System.Char},System.ReadOnlySpan{System.Char})>
          should be used.

適用対象