Share via


KeyCredentialManager.RequestCreateAsync Method

Definition

Overloads

RequestCreateAsync(String, KeyCredentialCreationOption)

Creates a new key credential for the current user and application.

public:
 static IAsyncOperation<KeyCredentialRetrievalResult ^> ^ RequestCreateAsync(Platform::String ^ name, KeyCredentialCreationOption option);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<KeyCredentialRetrievalResult> RequestCreateAsync(winrt::hstring const& name, KeyCredentialCreationOption const& option);
 static IAsyncOperation<KeyCredentialRetrievalResult> RequestCreateAsync(winrt::hstring const& name, KeyCredentialCreationOption const& option);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<KeyCredentialRetrievalResult> RequestCreateAsync(string name, KeyCredentialCreationOption option);
public static IAsyncOperation<KeyCredentialRetrievalResult> RequestCreateAsync(string name, KeyCredentialCreationOption option);
function requestCreateAsync(name, option)
Public Shared Function RequestCreateAsync (name As String, option As KeyCredentialCreationOption) As IAsyncOperation(Of KeyCredentialRetrievalResult)

Parameters

name
String

Platform::String

winrt::hstring

The name of the key credential to create.

option
KeyCredentialCreationOption

Options for the creation operation.

Returns

When this method completes, it returns the results of the key credential creation.

Attributes

Examples

Refer to the KeyCredentialManager sample for an example of exporting and parsing the public key.

Remarks

The RequestCreateAsync method generates a new RSA 2048-bit key credential. The generated key is stored securely and can be used for cryptographic operations.

Key Export and Parsing

The public key can be exported in a binary format. To parse the parameters of the public key:

  1. Use the BCrypt library to extract the key blob.
  2. Parse the key blob to retrieve the modulus and exponent.

Applies to

RequestCreateAsync(String, KeyCredentialCreationOption, String, String, KeyCredentialCacheConfiguration, WindowId, ChallengeResponseKind, AttestationChallengeHandler)

public:
 static IAsyncOperation<KeyCredentialRetrievalResult ^> ^ RequestCreateAsync(Platform::String ^ name, KeyCredentialCreationOption option, Platform::String ^ algorithm, Platform::String ^ message, KeyCredentialCacheConfiguration ^ cacheConfiguration, WindowId windowId, ChallengeResponseKind callbackType, AttestationChallengeHandler ^ attestationCallback);
/// [Windows.Foundation.Metadata.Overload("RequestCreateAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<KeyCredentialRetrievalResult> RequestCreateAsync(winrt::hstring const& name, KeyCredentialCreationOption const& option, winrt::hstring const& algorithm, winrt::hstring const& message, KeyCredentialCacheConfiguration const& cacheConfiguration, WindowId const& windowId, ChallengeResponseKind const& callbackType, AttestationChallengeHandler const& attestationCallback);
[Windows.Foundation.Metadata.Overload("RequestCreateAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<KeyCredentialRetrievalResult> RequestCreateAsync(string name, KeyCredentialCreationOption option, string algorithm, string message, KeyCredentialCacheConfiguration cacheConfiguration, WindowId windowId, ChallengeResponseKind callbackType, AttestationChallengeHandler attestationCallback);
function requestCreateAsync(name, option, algorithm, message, cacheConfiguration, windowId, callbackType, attestationCallback)
Public Shared Function RequestCreateAsync (name As String, option As KeyCredentialCreationOption, algorithm As String, message As String, cacheConfiguration As KeyCredentialCacheConfiguration, windowId As WindowId, callbackType As ChallengeResponseKind, attestationCallback As AttestationChallengeHandler) As IAsyncOperation(Of KeyCredentialRetrievalResult)

Parameters

name
String

Platform::String

winrt::hstring

algorithm
String

Platform::String

winrt::hstring

message
String

Platform::String

winrt::hstring

cacheConfiguration
KeyCredentialCacheConfiguration
windowId
WindowId
callbackType
ChallengeResponseKind
attestationCallback
AttestationChallengeHandler

Returns

Attributes

Applies to