Skip to main content
CertificateEnrollmentManager.ImportPfxDataAsync(String, String, ExportOption, KeyProtectionLevel, InstallOptions, String) | importPfxDataAsync(String, String, ExportOption, KeyProtectionLevel, InstallOptions, String) method

Applies to Windows and Windows Phone

Asynchronously imports a certificate from a Personal Information Exchange (PFX) message.

Syntax


Windows.Security.Cryptography.Certificates.CertificateEnrollmentManager.importPfxDataAsync(pfxData, password, exportable, keyProtectionLevel, installOption, friendlyName).done( /* Your success and error handlers */ );

public static IAsyncAction ImportPfxDataAsync(
  string pfxData, 
  string password, 
  ExportOption exportable, 
  KeyProtectionLevel keyProtectionLevel, 
  InstallOptions installOption, 
  string friendlyName
)

Public Shared Function ImportPfxDataAsync(
  pfxData As String,  
  password As String,  
  exportable As ExportOption,  
  keyProtectionLevel As KeyProtectionLevel,  
  installOption As InstallOptions,  
  friendlyName As String 
) As IAsyncAction

public:
static IAsyncAction^ ImportPfxDataAsync(
  String^ pfxData, 
  String^ password, 
  ExportOption exportable, 
  KeyProtectionLevel keyProtectionLevel, 
  InstallOptions installOption, 
  String^ friendlyName
)

Parameters

pfxData

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

Base64-encoded PFX message.

password

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The password used to decrypt and verify the PFX packet. The password must be exactly the same as the password that was used to encrypt the packet.

exportable

Type: ExportOption

A value of the ExportOption enumeration that specifies whether the key can be exported.

keyProtectionLevel

Type: KeyProtectionLevel

A value of the KeyProtectionLevel enumeration that specifies the strength of the key protection. The default is NoConsent.

installOption

Type: InstallOptions

An InstallOptions enumeration value that specifies the certificate installation option.

friendlyName

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The display name of the enrolled certificate. This value overwrites the FriendlyName property inside the PFX message.

Return value

Type: IAsyncAction

This method does not return a value.

Remarks

This method imports the certificate chain into the app container.

  • To import an issued certificate, it is not necessary for the certificate request to have been generated on the importing computer.
  • The certificates included in the response need not be chained to trusted root certificates on the importing computer.
  • The certificate is installed in the app container MY store.
  • Certification authority and Root certificates are installed in the app container intermediate certification authority store.
  • The key container name and key specification for the imported certificate are determined as described in the Remarks section of PFXImportCertStore with the exception that if AttributeId 1.3.6.1.4.1.311.17.1 is not present, MS_KEY_STORAGE_PROVIDER is always used as the provider name.

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.Certificates
Windows::Security::Cryptography::Certificates [C++]

Metadata

Windows.winmd

See also

CertificateEnrollmentManager
ImportPfxDataAsync(String, String, ExportOption, KeyProtectionLevel, InstallOptions, String, String)