UserCertificateEnrollmentManager.ImportPfxDataAsync Method

Definition

Overloads

ImportPfxDataAsync(String, String, PfxImportParameters)

Asynchronously imports a certificate from a Personal Information Exchange (PFX) message using the specified import parameters.

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

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

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

Asynchronously imports a certificate from a Personal Information Exchange (PFX) message using the specified key storage provider.

ImportPfxDataAsync(String, String, PfxImportParameters)

Asynchronously imports a certificate from a Personal Information Exchange (PFX) message using the specified import parameters.

public:
 virtual IAsyncAction ^ ImportPfxDataAsync(Platform::String ^ pfxData, Platform::String ^ password, PfxImportParameters ^ pfxImportParameters) = ImportPfxDataAsync;
/// [Windows.Foundation.Metadata.Overload("ImportPfxDataToKspWithParametersAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncAction ImportPfxDataAsync(winrt::hstring const& pfxData, winrt::hstring const& password, PfxImportParameters const& pfxImportParameters);
[Windows.Foundation.Metadata.Overload("ImportPfxDataToKspWithParametersAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncAction ImportPfxDataAsync(string pfxData, string password, PfxImportParameters pfxImportParameters);
function importPfxDataAsync(pfxData, password, pfxImportParameters)
Public Function ImportPfxDataAsync (pfxData As String, password As String, pfxImportParameters As PfxImportParameters) As IAsyncAction

Parameters

pfxData
String

Platform::String

winrt::hstring

Base64-encoded PFX message.

password
String

Platform::String

winrt::hstring

he 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.

pfxImportParameters
PfxImportParameters

The import parameters.

Returns

This method does not return a value.

Attributes

See also

Applies to

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

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

public:
 virtual IAsyncAction ^ ImportPfxDataAsync(Platform::String ^ pfxData, Platform::String ^ password, ExportOption exportable, KeyProtectionLevel keyProtectionLevel, InstallOptions installOption, Platform::String ^ friendlyName) = ImportPfxDataAsync;
/// [Windows.Foundation.Metadata.Overload("ImportPfxDataAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncAction ImportPfxDataAsync(winrt::hstring const& pfxData, winrt::hstring const& password, ExportOption const& exportable, KeyProtectionLevel const& keyProtectionLevel, InstallOptions const& installOption, winrt::hstring const& friendlyName);
[Windows.Foundation.Metadata.Overload("ImportPfxDataAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncAction ImportPfxDataAsync(string pfxData, string password, ExportOption exportable, KeyProtectionLevel keyProtectionLevel, InstallOptions installOption, string friendlyName);
function importPfxDataAsync(pfxData, password, exportable, keyProtectionLevel, installOption, friendlyName)
Public Function ImportPfxDataAsync (pfxData As String, password As String, exportable As ExportOption, keyProtectionLevel As KeyProtectionLevel, installOption As InstallOptions, friendlyName As String) As IAsyncAction

Parameters

pfxData
String

Platform::String

winrt::hstring

Base64-encoded PFX message.

password
String

Platform::String

winrt::hstring

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
ExportOption

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

keyProtectionLevel
KeyProtectionLevel

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

installOption
InstallOptions

An InstallOptions enumeration value that specifies the certificate installation option.

friendlyName
String

Platform::String

winrt::hstring

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

Returns

This method does not return a value.

Attributes

Examples

The following code imports a pfx-based certificate into the user's "My" store and protects the certificate's private key using the devices Trusted Platform Module (TPM). Note that apps require the sharedUserCertificates capability to import PFX files or use certificates from the user's "MY" certificate store.

CertificateEnrollmentManager.UserCertificateEnrollmentManager.ImportPfxDataAsync(
    pfxData,
    password,
    ExportOption.NotExportable,
    KeyProtectionLevel.NoConsent,
    InstallOptions.DeleteExpired,
    strFriendlyName,
    KeyStorageProviderNames.PlatformKeyStorageProvider);

See also

Applies to

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

Asynchronously imports a certificate from a Personal Information Exchange (PFX) message using the specified key storage provider.

public:
 virtual IAsyncAction ^ ImportPfxDataAsync(Platform::String ^ pfxData, Platform::String ^ password, ExportOption exportable, KeyProtectionLevel keyProtectionLevel, InstallOptions installOption, Platform::String ^ friendlyName, Platform::String ^ keyStorageProvider) = ImportPfxDataAsync;
/// [Windows.Foundation.Metadata.Overload("ImportPfxDataToKspAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncAction ImportPfxDataAsync(winrt::hstring const& pfxData, winrt::hstring const& password, ExportOption const& exportable, KeyProtectionLevel const& keyProtectionLevel, InstallOptions const& installOption, winrt::hstring const& friendlyName, winrt::hstring const& keyStorageProvider);
[Windows.Foundation.Metadata.Overload("ImportPfxDataToKspAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncAction ImportPfxDataAsync(string pfxData, string password, ExportOption exportable, KeyProtectionLevel keyProtectionLevel, InstallOptions installOption, string friendlyName, string keyStorageProvider);
function importPfxDataAsync(pfxData, password, exportable, keyProtectionLevel, installOption, friendlyName, keyStorageProvider)
Public Function ImportPfxDataAsync (pfxData As String, password As String, exportable As ExportOption, keyProtectionLevel As KeyProtectionLevel, installOption As InstallOptions, friendlyName As String, keyStorageProvider As String) As IAsyncAction

Parameters

pfxData
String

Platform::String

winrt::hstring

Base64-encoded PFX message.

password
String

Platform::String

winrt::hstring

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
ExportOption

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

keyProtectionLevel
KeyProtectionLevel

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

installOption
InstallOptions

An InstallOptions enumeration value that specifies the certificate installation option.

friendlyName
String

Platform::String

winrt::hstring

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

keyStorageProvider
String

Platform::String

winrt::hstring

The name of the key storage provider to use when importing the certificate.

Returns

This method does not return a value.

Attributes

Examples

The following code imports a pfx-based certificate into the user's "My" store and protects the certificate's private key using the devices Trusted Platform Module (TPM). Note that apps require the sharedUserCertificates capability to import PFX files or use certificates from the user's "MY" certificate store.

CertificateEnrollmentManager.UserCertificateEnrollmentManager.ImportPfxDataAsync(
    pfxData,
    password,
    ExportOption.NotExportable,
    KeyProtectionLevel.NoConsent,
    InstallOptions.DeleteExpired,
    strFriendlyName,
    KeyStorageProviderNames.PlatformKeyStorageProvider);

See also

Applies to