CngKey.Open メソッド

定義

既存のキーを表す CngKey オブジェクトのインスタンスを作成します。

オーバーロード

名前 説明
Open(String)

既存の名前付きキーを表す CngKey オブジェクトのインスタンスを作成します。

Open(SafeNCryptKeyHandle, CngKeyHandleOpenOptions)

既存のキーへのハンドルを使用して、 CngKey オブジェクトのインスタンスを作成します。

Open(String, CngProvider)

指定したキー ストレージ プロバイダー (KSP) を使用して、既存の名前付きキーを表す CngKey オブジェクトのインスタンスを作成します。

Open(String, CngProvider, CngKeyOpenOptions)

指定したキー ストレージ プロバイダー (KSP) とキーを開くオプションを使用して、既存の名前付きキーを表す CngKey オブジェクトのインスタンスを作成します。

Open(String)

ソース:
Cng.NotSupported.cs
ソース:
Cng.NotSupported.cs
ソース:
Cng.NotSupported.cs
ソース:
Cng.NotSupported.cs
ソース:
Cng.NotSupported.cs

既存の名前付きキーを表す CngKey オブジェクトのインスタンスを作成します。

public:
 static System::Security::Cryptography::CngKey ^ Open(System::String ^ keyName);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Security.Cryptography.CngKey Open(string keyName);
public static System.Security.Cryptography.CngKey Open(string keyName);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Open : string -> System.Security.Cryptography.CngKey
static member Open : string -> System.Security.Cryptography.CngKey
Public Shared Function Open (keyName As String) As CngKey

パラメーター

keyName
String

キーの名前。

返品

既存のキー。

属性

例外

keyNamenullです。

このシステムでは、暗号化次世代 (CNG) はサポートされていません。

その他すべてのエラー。

注釈

このオーバーロードでは、次の既定値が使用されます。

適用対象

Open(SafeNCryptKeyHandle, CngKeyHandleOpenOptions)

ソース:
Cng.NotSupported.cs
ソース:
Cng.NotSupported.cs
ソース:
Cng.NotSupported.cs
ソース:
Cng.NotSupported.cs
ソース:
Cng.NotSupported.cs

既存のキーへのハンドルを使用して、 CngKey オブジェクトのインスタンスを作成します。

public:
 static System::Security::Cryptography::CngKey ^ Open(Microsoft::Win32::SafeHandles::SafeNCryptKeyHandle ^ keyHandle, System::Security::Cryptography::CngKeyHandleOpenOptions keyHandleOpenOptions);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Security.Cryptography.CngKey Open(Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle keyHandle, System.Security.Cryptography.CngKeyHandleOpenOptions keyHandleOpenOptions);
public static System.Security.Cryptography.CngKey Open(Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle keyHandle, System.Security.Cryptography.CngKeyHandleOpenOptions keyHandleOpenOptions);
[System.Security.SecurityCritical]
public static System.Security.Cryptography.CngKey Open(Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle keyHandle, System.Security.Cryptography.CngKeyHandleOpenOptions keyHandleOpenOptions);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Open : Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle * System.Security.Cryptography.CngKeyHandleOpenOptions -> System.Security.Cryptography.CngKey
static member Open : Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle * System.Security.Cryptography.CngKeyHandleOpenOptions -> System.Security.Cryptography.CngKey
[<System.Security.SecurityCritical>]
static member Open : Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle * System.Security.Cryptography.CngKeyHandleOpenOptions -> System.Security.Cryptography.CngKey
Public Shared Function Open (keyHandle As SafeNCryptKeyHandle, keyHandleOpenOptions As CngKeyHandleOpenOptions) As CngKey

パラメーター

keyHandle
SafeNCryptKeyHandle

既存のキーへのハンドル。

keyHandleOpenOptions
CngKeyHandleOpenOptions

keyHandleがエフェメラル キーまたは名前付きキーを表すかどうかを示す列挙値の 1 つ。

返品

既存のキー。

属性

例外

keyHandlenullです。

keyHandle が無効であるか、形式が正しくないか、既に閉じられています。 この例外は、キーが共通言語ランタイム (CLR) によって作成されたエフェメラル キーであっても、 EphemeralKey 値が指定されていない場合にもスローされます。

このシステムでは、暗号化次世代 (CNG) はサポートされていません。

その他すべてのエラー。

注釈

このオーバーロードにより、高度なユーザーは、プラットフォーム呼び出しまたは C++ のマネージド相互運用機能に依存している場合でも、CNG クラスを使用できます。 たとえば、キーをNCRYPT_KEY_HANDLEとして返すネイティブ ライブラリがある場合、このオーバーロードを使用すると、キーの周囲にマネージド ラッパーを作成し、CNG クラスを使用して操作できます。

ハンドルを使用してキーを開くと、キーの一時状態を特定できず、自分で指定する必要があります。 CngKey クラスのいくつかのプロパティは、この値を正しくするために使用します。 そのため、 Open メソッドに正しいフラグ値を渡してください。

適用対象

Open(String, CngProvider)

ソース:
Cng.NotSupported.cs
ソース:
Cng.NotSupported.cs
ソース:
Cng.NotSupported.cs
ソース:
Cng.NotSupported.cs
ソース:
Cng.NotSupported.cs

指定したキー ストレージ プロバイダー (KSP) を使用して、既存の名前付きキーを表す CngKey オブジェクトのインスタンスを作成します。

public:
 static System::Security::Cryptography::CngKey ^ Open(System::String ^ keyName, System::Security::Cryptography::CngProvider ^ provider);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Security.Cryptography.CngKey Open(string keyName, System.Security.Cryptography.CngProvider provider);
public static System.Security.Cryptography.CngKey Open(string keyName, System.Security.Cryptography.CngProvider provider);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Open : string * System.Security.Cryptography.CngProvider -> System.Security.Cryptography.CngKey
static member Open : string * System.Security.Cryptography.CngProvider -> System.Security.Cryptography.CngKey
Public Shared Function Open (keyName As String, provider As CngProvider) As CngKey

パラメーター

keyName
String

キーの名前。

provider
CngProvider

キーを含む KSP。

返品

既存のキー。

属性

例外

keyName または providernull

このシステムでは、暗号化次世代 (CNG) はサポートされていません。

その他すべてのエラー。

注釈

Open(String) メソッドのオーバーロードとは異なり、このオーバーロードではプロバイダーを指定できます。 さらに、CngKeyOpenOptionsの既定のNone値が作成され、キーにバインドされます。

適用対象

Open(String, CngProvider, CngKeyOpenOptions)

ソース:
Cng.NotSupported.cs
ソース:
Cng.NotSupported.cs
ソース:
Cng.NotSupported.cs
ソース:
Cng.NotSupported.cs
ソース:
Cng.NotSupported.cs

指定したキー ストレージ プロバイダー (KSP) とキーを開くオプションを使用して、既存の名前付きキーを表す CngKey オブジェクトのインスタンスを作成します。

public:
 static System::Security::Cryptography::CngKey ^ Open(System::String ^ keyName, System::Security::Cryptography::CngProvider ^ provider, System::Security::Cryptography::CngKeyOpenOptions openOptions);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Security.Cryptography.CngKey Open(string keyName, System.Security.Cryptography.CngProvider provider, System.Security.Cryptography.CngKeyOpenOptions openOptions);
public static System.Security.Cryptography.CngKey Open(string keyName, System.Security.Cryptography.CngProvider provider, System.Security.Cryptography.CngKeyOpenOptions openOptions);
[System.Security.SecurityCritical]
public static System.Security.Cryptography.CngKey Open(string keyName, System.Security.Cryptography.CngProvider provider, System.Security.Cryptography.CngKeyOpenOptions openOptions);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Open : string * System.Security.Cryptography.CngProvider * System.Security.Cryptography.CngKeyOpenOptions -> System.Security.Cryptography.CngKey
static member Open : string * System.Security.Cryptography.CngProvider * System.Security.Cryptography.CngKeyOpenOptions -> System.Security.Cryptography.CngKey
[<System.Security.SecurityCritical>]
static member Open : string * System.Security.Cryptography.CngProvider * System.Security.Cryptography.CngKeyOpenOptions -> System.Security.Cryptography.CngKey
Public Shared Function Open (keyName As String, provider As CngProvider, openOptions As CngKeyOpenOptions) As CngKey

パラメーター

keyName
String

キーの名前。

provider
CngProvider

キーを含む KSP。

openOptions
CngKeyOpenOptions

キーを開く場所 (マシンまたはユーザー ストレージ) や UI プロンプトを抑制するかどうかなど、キーを開くオプションを指定する列挙値のビットごとの組み合わせ。

返品

既存のキー。

属性

例外

keyName または providernull

このシステムでは、暗号化次世代 (CNG) はサポートされていません。

その他すべてのエラー。

注釈

Open(String) メソッドのオーバーロードとは異なり、このオーバーロードを使用すると、プロバイダーとキーオープン オプションの両方を指定できます。

適用対象