Skip to main content
AsymmetricKeyAlgorithmProvider.ImportPublicKey(IBuffer, CryptographicPublicKeyBlobType) | importPublicKey(IBuffer, CryptographicPublicKeyBlobType) method

Applies to Windows and Windows Phone

Imports a public key into a buffer for a specified format.

Syntax


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

public CryptographicKey ImportPublicKey(
  IBuffer keyBlob, 
  CryptographicPublicKeyBlobType BlobType
)

Public Function ImportPublicKey(
  keyBlob As IBuffer,  
  BlobType As CryptographicPublicKeyBlobType 
) As CryptographicKey

public:
CryptographicKey^ ImportPublicKey(
  IBuffer^ keyBlob, 
  CryptographicPublicKeyBlobType BlobType
)

Parameters

keyBlob

Type: IBuffer

Buffer that contains the key to import.

BlobType

Type: CryptographicPublicKeyBlobType

A CryptographicPublicKeyBlobType enumeration value that specifies the format of the public key contained in the keyBlob buffer. The default value is X509SubjectPublicKeyInfo.

Return value

Type: CryptographicKey

Represents the imported key.

Requirements

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
ImportPublicKey(IBuffer)