Skip to main content
AsymmetricKeyAlgorithmProvider.ImportKeyPair(IBuffer, CryptographicPrivateKeyBlobType) | importKeyPair(IBuffer, CryptographicPrivateKeyBlobType) method

Imports a public/private key pair from a buffer in the specified format.

Syntax


var cryptographicKey = asymmetricKeyAlgorithmProvider.importKeyPair(keyBlob, BlobType);

public CryptographicKey ImportKeyPair(
  IBuffer keyBlob, 
  CryptographicPrivateKeyBlobType BlobType
)

Public Function ImportKeyPair(
  keyBlob As IBuffer,  
  BlobType As CryptographicPrivateKeyBlobType 
) As CryptographicKey

public:
CryptographicKey^ ImportKeyPair(
  IBuffer^ keyBlob, 
  CryptographicPrivateKeyBlobType BlobType
)

Parameters

keyBlob

Type: IBuffer

Buffer that contains the key pair to import.

BlobType

Type: CryptographicPrivateKeyBlobType

A CryptographicPrivateKeyBlobType enumeration value that specifies information about the private key contained in the keyBlob buffer. The default value is Pkcs8RawPrivateKeyInfo.

Return value

Type: CryptographicKey

Represents the imported key pair.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Security.Cryptography.Core
Windows::Security::Cryptography::Core [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Security.Cryptography.Core
Windows::Security::Cryptography::Core [C++]

Metadata

Windows.winmd

See also

AsymmetricKeyAlgorithmProvider
ImportKeyPair(IBuffer)