Share via


Pkcs8PrivateKeyInfo.DecryptAndDecode メソッド

定義

オーバーロード

DecryptAndDecode(ReadOnlySpan<Byte>, ReadOnlyMemory<Byte>, Int32)

指定されたバイト ベースのパスワードを使用して指定されたデータを復号化し、その出力を PKCS#8 PrivateKeyInfo のオブジェクト ビューにデコードします。

DecryptAndDecode(ReadOnlySpan<Char>, ReadOnlyMemory<Byte>, Int32)

指定された文字ベースのパスワードを使用して指定されたデータを復号化し、その出力を PKCS#8 PrivateKeyInfo のオブジェクト ビューにデコードします。

DecryptAndDecode(ReadOnlySpan<Byte>, ReadOnlyMemory<Byte>, Int32)

ソース:
Pkcs8PrivateKeyInfo.cs
ソース:
Pkcs8PrivateKeyInfo.cs
ソース:
Pkcs8PrivateKeyInfo.cs
ソース:
Pkcs8PrivateKeyInfo.cs

指定されたバイト ベースのパスワードを使用して指定されたデータを復号化し、その出力を PKCS#8 PrivateKeyInfo のオブジェクト ビューにデコードします。

public:
 static System::Security::Cryptography::Pkcs::Pkcs8PrivateKeyInfo ^ DecryptAndDecode(ReadOnlySpan<System::Byte> passwordBytes, ReadOnlyMemory<System::Byte> source, [Runtime::InteropServices::Out] int % bytesRead);
public static System.Security.Cryptography.Pkcs.Pkcs8PrivateKeyInfo DecryptAndDecode (ReadOnlySpan<byte> passwordBytes, ReadOnlyMemory<byte> source, out int bytesRead);
static member DecryptAndDecode : ReadOnlySpan<byte> * ReadOnlyMemory<byte> * int -> System.Security.Cryptography.Pkcs.Pkcs8PrivateKeyInfo
Public Shared Function DecryptAndDecode (passwordBytes As ReadOnlySpan(Of Byte), source As ReadOnlyMemory(Of Byte), ByRef bytesRead As Integer) As Pkcs8PrivateKeyInfo

パラメーター

passwordBytes
ReadOnlySpan<Byte>

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

source
ReadOnlyMemory<Byte>

ASN.1-BER エンコードで PKCS#8 EncryptedPrivateKeyInfo 構造体として読み取るデータ。

bytesRead
Int32

このメソッドが戻るときに、source から読み込まれたバイト数を示す値が含まれます。 このパラメーターは初期化前として処理されます。

戻り値

復号化されて PKCS#8 PrivateKeyInfo としてデコードされた内容のオブジェクト ビュー。

例外

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

または

source のコンテンツは、適用するキー派生関数 (KDF) が、Char ベースのパスワードを必要とするレガシの PKCS#12 KDF であることを示しています。

または

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

注釈

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

このメソッドでは、EncryptedPrivateKeyInfo のバイナリ (BER/CER/DER) エンコードのみがサポートされます。 値が Base64 エンコードまたは PEM テキスト形式の場合、呼び出し元は、このメソッドを呼び出す前に、内容を Base64 デコードする必要があります。

適用対象

DecryptAndDecode(ReadOnlySpan<Char>, ReadOnlyMemory<Byte>, Int32)

ソース:
Pkcs8PrivateKeyInfo.cs
ソース:
Pkcs8PrivateKeyInfo.cs
ソース:
Pkcs8PrivateKeyInfo.cs
ソース:
Pkcs8PrivateKeyInfo.cs

指定された文字ベースのパスワードを使用して指定されたデータを復号化し、その出力を PKCS#8 PrivateKeyInfo のオブジェクト ビューにデコードします。

public:
 static System::Security::Cryptography::Pkcs::Pkcs8PrivateKeyInfo ^ DecryptAndDecode(ReadOnlySpan<char> password, ReadOnlyMemory<System::Byte> source, [Runtime::InteropServices::Out] int % bytesRead);
public static System.Security.Cryptography.Pkcs.Pkcs8PrivateKeyInfo DecryptAndDecode (ReadOnlySpan<char> password, ReadOnlyMemory<byte> source, out int bytesRead);
static member DecryptAndDecode : ReadOnlySpan<char> * ReadOnlyMemory<byte> * int -> System.Security.Cryptography.Pkcs.Pkcs8PrivateKeyInfo
Public Shared Function DecryptAndDecode (password As ReadOnlySpan(Of Char), source As ReadOnlyMemory(Of Byte), ByRef bytesRead As Integer) As Pkcs8PrivateKeyInfo

パラメーター

password
ReadOnlySpan<Char>

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

source
ReadOnlyMemory<Byte>

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

bytesRead
Int32

このメソッドが戻るときに、source から読み込まれたバイト数を示す値が含まれます。 このパラメーターは初期化前として処理されます。

戻り値

復号化されて PKCS#8 PrivateKeyInfo としてデコードされた内容のオブジェクト ビュー。

注釈

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

このメソッドでは、EncryptedPrivateKeyInfo のバイナリ (BER/CER/DER) エンコードのみがサポートされます。 値が Base64 エンコードまたは PEM テキスト形式の場合、呼び出し元は、このメソッドを呼び出す前に、内容を Base64 デコードする必要があります。

こちらもご覧ください

適用対象