CngKey.Open 메서드

정의

기존 키를 나타내는 CngKey 개체의 인스턴스를 만듭니다.

오버로드

Open(String)

명명된 기존 키를 나타내는 CngKey 개체의 인스턴스를 만듭니다.

Open(SafeNCryptKeyHandle, CngKeyHandleOpenOptions)

기존 키에 대한 핸들을 사용하여 CngKey 개체의 인스턴스를 만듭니다.

Open(String, CngProvider)

지정된 KSP(키 스토리지 공급자)를 사용하여 명명된 기존 키를 나타내는 CngKey 개체의 인스턴스를 만듭니다.

Open(String, CngProvider, CngKeyOpenOptions)

지정된 KSP(키 스토리지 공급자) 및 키 열기 옵션을 사용하여 명명된 기존 키를 나타내는 CngKey 개체의 인스턴스를 만듭니다.

Open(String)

명명된 기존 키를 나타내는 CngKey 개체의 인스턴스를 만듭니다.

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

매개 변수

keyName
String

키의 이름입니다.

반환

CngKey

기존 키입니다.

특성

예외

keyName이(가) null인 경우

CNG(Cryptography Next Generation)은 이 시스템에서 지원되지 않습니다.

다른 모든 오류입니다.

설명

이 오버로드는 다음 기본값을 사용합니다.

적용 대상

Open(SafeNCryptKeyHandle, CngKeyHandleOpenOptions)

기존 키에 대한 핸들을 사용하여 CngKey 개체의 인스턴스를 만듭니다.

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.Runtime.Versioning.SupportedOSPlatform("windows")]
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);
static member Open : Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle * System.Security.Cryptography.CngKeyHandleOpenOptions -> System.Security.Cryptography.CngKey
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
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이 사용 후 삭제되는 키를 나타내는지 또는 명명된 키를 나타내는지 여부를 지정하는 열거형 값 중 하나입니다.

반환

CngKey

기존 키입니다.

특성

예외

keyHandle이(가) null인 경우

keyHandle이 유효하지 않거나 형식이 잘못되었거나 이미 닫힌 경우. 이 예외는 키가 CLR(공용 언어 런타임)에서 만든 사용 후 삭제되는 키이지만 EphemeralKey 값이 지정되지 않은 경우에도 throw됩니다.

CNG(Cryptography Next Generation)은 이 시스템에서 지원되지 않습니다.

다른 모든 오류입니다.

설명

이 오버로드를 사용하면 고급 사용자가 플랫폼 호출 또는 C++의 관리형 interop 기능을 사용하는 경우에도 CNG 클래스를 사용할 수 있습니다. 예를 들어 키를 NCRYPT_KEY_HANDLE 반환하는 네이티브 라이브러리가 있는 경우 이 오버로드를 사용하면 키 주위에 관리되는 래퍼를 만들고 CNG 클래스를 사용하여 조작할 수 있습니다.

핸들을 사용하여 키를 열 때 키의 사용 후 삭제 상태를 확인할 수 없으며 직접 지정해야 합니다. 클래스의 여러 속성은 CngKey 올바른 값에 의존합니다. 따라서 올바른 플래그 값을 메서드에 전달해야 합니다 Open .

적용 대상

Open(String, CngProvider)

지정된 KSP(키 스토리지 공급자)를 사용하여 명명된 기존 키를 나타내는 CngKey 개체의 인스턴스를 만듭니다.

public:
 static System::Security::Cryptography::CngKey ^ Open(System::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")]
public static System.Security.Cryptography.CngKey Open (string keyName, System.Security.Cryptography.CngProvider provider);
static member Open : string * System.Security.Cryptography.CngProvider -> System.Security.Cryptography.CngKey
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
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입니다.

반환

CngKey

기존 키입니다.

특성

예외

keyName 또는 providernull인 경우

CNG(Cryptography Next Generation)은 이 시스템에서 지원되지 않습니다.

다른 모든 오류입니다.

설명

메서드 오버로드와 Open(String) 달리 이 오버로드를 사용하면 공급자를 지정할 수 있습니다. 또한 기본 CngKeyOpenOptionsNone 이 만들어지고 키에 바인딩됩니다.

적용 대상

Open(String, CngProvider, CngKeyOpenOptions)

지정된 KSP(키 스토리지 공급자) 및 키 열기 옵션을 사용하여 명명된 기존 키를 나타내는 CngKey 개체의 인스턴스를 만듭니다.

public:
 static System::Security::Cryptography::CngKey ^ Open(System::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.Runtime.Versioning.SupportedOSPlatform("windows")]
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);
static member Open : string * System.Security.Cryptography.CngProvider * System.Security.Cryptography.CngKeyOpenOptions -> System.Security.Cryptography.CngKey
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
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 프롬프트를 표시하지 않을지 여부와 같은 키 열기 옵션을 지정하는 열거형 값의 비트 조합입니다.

반환

CngKey

기존 키입니다.

특성

예외

keyName 또는 providernull인 경우

CNG(Cryptography Next Generation)은 이 시스템에서 지원되지 않습니다.

다른 모든 오류입니다.

설명

Open(String) 메서드 오버로드와 달리 이 오버로드를 사용하면 공급자와 키 열기 옵션을 모두 지정할 수 있습니다.

적용 대상