CngKey.Import Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a new key by importing key material into the key storage provider (KSP).
Overloads
Import(Byte[], CngKeyBlobFormat, CngProvider) |
Creates a new key by importing the specified key material into the specified key storage provider (KSP), using the specified format. |
Import(Byte[], CngKeyBlobFormat) |
Creates a new key by importing the specified key material into the default key storage provider (KSP) and using the specified format. |
Import(Byte[], CngKeyBlobFormat, CngProvider)
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
Creates a new key by importing the specified key material into the specified key storage provider (KSP), using the specified format.
public:
static System::Security::Cryptography::CngKey ^ Import(cli::array <System::Byte> ^ keyBlob, System::Security::Cryptography::CngKeyBlobFormat ^ format, System::Security::Cryptography::CngProvider ^ provider);
public static System.Security.Cryptography.CngKey Import (byte[] keyBlob, System.Security.Cryptography.CngKeyBlobFormat format, System.Security.Cryptography.CngProvider provider);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Security.Cryptography.CngKey Import (byte[] keyBlob, System.Security.Cryptography.CngKeyBlobFormat format, System.Security.Cryptography.CngProvider provider);
[System.Security.SecurityCritical]
public static System.Security.Cryptography.CngKey Import (byte[] keyBlob, System.Security.Cryptography.CngKeyBlobFormat format, System.Security.Cryptography.CngProvider provider);
static member Import : byte[] * System.Security.Cryptography.CngKeyBlobFormat * System.Security.Cryptography.CngProvider -> System.Security.Cryptography.CngKey
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Import : byte[] * System.Security.Cryptography.CngKeyBlobFormat * System.Security.Cryptography.CngProvider -> System.Security.Cryptography.CngKey
[<System.Security.SecurityCritical>]
static member Import : byte[] * System.Security.Cryptography.CngKeyBlobFormat * System.Security.Cryptography.CngProvider -> System.Security.Cryptography.CngKey
Public Shared Function Import (keyBlob As Byte(), format As CngKeyBlobFormat, provider As CngProvider) As CngKey
Parameters
- keyBlob
- Byte[]
An array that contains the key information.
- format
- CngKeyBlobFormat
An object that specifies the format of the keyBlob
array.
- provider
- CngProvider
The KSP.
Returns
A new key.
- Attributes
Exceptions
keyBlob
, format
, or provider
is null
.
Cryptography Next Generation (CNG) is not supported on this system.
All other errors.
Remarks
Important
On Windows operating systems before Windows 7 and Windows Server 2008 R2, some CNG key binary large object (BLOB) formats are not supported.
Applies to
Import(Byte[], CngKeyBlobFormat)
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
- Source:
- Cng.NotSupported.cs
Creates a new key by importing the specified key material into the default key storage provider (KSP) and using the specified format.
public:
static System::Security::Cryptography::CngKey ^ Import(cli::array <System::Byte> ^ keyBlob, System::Security::Cryptography::CngKeyBlobFormat ^ format);
public static System.Security.Cryptography.CngKey Import (byte[] keyBlob, System.Security.Cryptography.CngKeyBlobFormat format);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static System.Security.Cryptography.CngKey Import (byte[] keyBlob, System.Security.Cryptography.CngKeyBlobFormat format);
static member Import : byte[] * System.Security.Cryptography.CngKeyBlobFormat -> System.Security.Cryptography.CngKey
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member Import : byte[] * System.Security.Cryptography.CngKeyBlobFormat -> System.Security.Cryptography.CngKey
Public Shared Function Import (keyBlob As Byte(), format As CngKeyBlobFormat) As CngKey
Parameters
- keyBlob
- Byte[]
An array that contains the key information.
- format
- CngKeyBlobFormat
An object that specifies the format of the keyBlob
array.
Returns
A new key.
- Attributes
Exceptions
keyBlob
or format
is null
.
Cryptography Next Generation (CNG) is not supported on this system.
All other errors.
Remarks
The default KSP is MicrosoftSoftwareKeyStorageProvider.
Important
On Windows operating systems before Windows 7 and Windows Server 2008 R2, some CNG key binary large object (BLOB) formats are not supported.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기