Skip to content

Commit 775dace

Browse files
committed
Merged PR 22201: Add remarks and links to example in KeyCredentialManager API docs
Add remarks and links to example in KeyCredentialManager API docs. ---- #### AI description (iteration 1) #### PR Classification Documentation update to enhance the KeyCredentialManager API docs with detailed remarks and example links. #### PR Summary This pull request enriches the API documentation for key credential management by adding clear explanations on RSA 2048-bit key usage, export/parsing, attestation details, and operational behavior of various methods. - **`keycredentialmanager_requestcreateasync_1254045680.md`**: Added detailed remarks describing RSA 2048-bit key creation, key export and parsing steps, and provided a sample link. - **`keycredentialmanager.md`**: Expanded the documentation with comprehensive key specifications, attestation data formats, and verification instructions. - **`keycredentialmanager_openasync_1404306189.md`, `keycredentialmanager_deleteasync_333495081.md`, `keycredentialmanager_issupportedasync_2134939103.md`, and `keycredentialmanager_renewattestationasync_1621496073.md`**: Updated remarks to clarify key retrieval, deletion irreversibility, device support requirements, and attestation renewal processes. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2 parents f7eee3e + c5e4778 commit 775dace

6 files changed

Lines changed: 74 additions & 4 deletions

windows.security.credentials/keycredentialmanager.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,33 @@ Contains methods for basic management of key credentials.
1616

1717
## -remarks
1818

19+
The `KeyCredentialManager` class provides methods to manage key credentials, which are RSA 2048-bit keys. These keys are used for secure authentication and cryptographic operations.
20+
21+
#### Key Information
22+
23+
- **Key Type**: RSA 2048-bit
24+
- **Signature Format**: PKCS #1 RSA PSS with SHA256
25+
- **Attestation Data**: The attestation data is a binary blob that includes metadata about the key, such as its origin and security properties.
26+
27+
#### Attestation Data Format
28+
29+
The attestation data is encoded in a binary format. It includes:
30+
31+
1. **Key Metadata**: Information about the key's origin and properties.
32+
1. **Certificate Chain**: A chain of certificates that can be used to verify the authenticity of the attestation.
33+
34+
#### Verifying Attestation Data
35+
36+
To verify the attestation data:
37+
38+
1. Parse the binary blob to extract the metadata and certificate chain.
39+
1. Use the certificate chain to validate the authenticity of the attestation.
40+
1. Ensure the metadata matches the expected properties of the key.
41+
42+
For more details, refer to the [KeyCredentialManager sample](https://github.com/Microsoft/Windows-universal-samples/tree/main/Samples/KeyCredentialManager).
43+
1944
## -examples
2045

2146
## -see-also
2247

23-
[KeyCredentialManager sample](https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/KeyCredentialManager)
48+
[KeyCredentialManager sample](https://github.com/Microsoft/Windows-universal-samples/tree/main/Samples/KeyCredentialManager)

windows.security.credentials/keycredentialmanager_deleteasync_333495081.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,23 @@ public Windows.Foundation.IAsyncAction DeleteAsync(System.String name)
1111
# Windows.Security.Credentials.KeyCredentialManager.DeleteAsync
1212

1313
## -description
14+
1415
Deletes a previously provisioned user identity key for the current user and application.
1516

1617
## -parameters
18+
1719
### -param name
20+
1821
The name of the key to delete.
1922

2023
## -returns
24+
2125
This method does not return a value.
2226

2327
## -remarks
2428

29+
The `DeleteAsync` method removes a previously provisioned key credential. This operation is irreversible and ensures that the key is no longer accessible.
30+
2531
## -examples
2632

2733
## -see-also

windows.security.credentials/keycredentialmanager_issupportedasync_2134939103.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,19 @@ public Windows.Foundation.IAsyncOperation<bool> IsSupportedAsync()
1111
# Windows.Security.Credentials.KeyCredentialManager.IsSupportedAsync
1212

1313
## -description
14+
1415
Determines if the current device and user is capable of provisioning a key credential.
1516

1617
## -returns
18+
1719
When this method completes, it returns true if the current device and user is capable of provisioning a key credential. Otherwise, it returns false.
1820

1921
## -remarks
2022

21-
An application cannot provision a key credential until the user has successfully done the following:
23+
The `IsSupportedAsync` method checks if the current device and user can provision a key credential. This requires:
2224

23-
+ Connected their user account to their Microsoft account.
24-
+ Provided an unlock gesture (PIN or biometric) to protect the container that stores their key credential.
25+
1. A Microsoft account linked to the user.
26+
1. An unlock gesture (PIN or biometric) set up to protect the key container.
2527

2628

2729
## -examples

windows.security.credentials/keycredentialmanager_openasync_1404306189.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,30 @@ public Windows.Foundation.IAsyncOperation<Windows.Security.Credentials.KeyCreden
1111
# Windows.Security.Credentials.KeyCredentialManager.OpenAsync
1212

1313
## -description
14+
1415
Retrieves a key credential for the current user and application.
1516

1617
## -parameters
18+
1719
### -param name
20+
1821
The name of the key credential to open.
1922

2023
## -returns
24+
2125
When this method completes, it returns the results of the key credential retrieval.
2226

2327
## -remarks
2428

29+
The `OpenAsync` method retrieves an existing key credential. The retrieved key can be used for cryptographic operations such as signing and encryption.
30+
31+
#### Key Usage
32+
33+
The key is an RSA 2048-bit key. It supports operations like:
34+
35+
- Generating signatures in PKCS #1 RSA PSS format with SHA256.
36+
- Encrypting data using appropriate padding schemes such as PKCS #1 OAEP.
37+
2538
## -examples
2639

2740
## -see-also

windows.security.credentials/keycredentialmanager_renewattestationasync_1621496073.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,21 @@ public Windows.Foundation.IAsyncAction RenewAttestationAsync()
1111
# Windows.Security.Credentials.KeyCredentialManager.RenewAttestationAsync
1212

1313
## -description
14+
1415
Renews an attestation for a key credential.
1516

1617
## -returns
18+
1719
This method does not return a value.
1820

1921
## -remarks
2022

23+
The `RenewAttestationAsync` method renews the attestation for an existing key credential. This ensures that the attestation remains valid and up-to-date.
24+
25+
#### Attestation Renewal
26+
27+
The renewed attestation includes updated metadata and a refreshed certificate chain. This can be used to verify the key's authenticity and properties.
28+
2129
## -examples
2230

2331
## -see-also

windows.security.credentials/keycredentialmanager_requestcreateasync_1254045680.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,36 @@ public Windows.Foundation.IAsyncOperation<Windows.Security.Credentials.KeyCreden
1111
# Windows.Security.Credentials.KeyCredentialManager.RequestCreateAsync
1212

1313
## -description
14+
1415
Creates a new key credential for the current user and application.
1516

1617
## -parameters
18+
1719
### -param name
20+
1821
The name of the key credential to create.
1922

2023
### -param option
24+
2125
Options for the creation operation.
2226

2327
## -returns
28+
2429
When this method completes, it returns the results of the key credential creation.
2530

2631
## -remarks
2732

33+
The `RequestCreateAsync` method generates a new RSA 2048-bit key credential. The generated key is stored securely and can be used for cryptographic operations.
34+
35+
#### Key Export and Parsing
36+
37+
The public key can be exported in a binary format. To parse the parameters of the public key:
38+
39+
1. Use the `BCrypt` library to extract the key blob.
40+
1. Parse the key blob to retrieve the modulus and exponent.
41+
2842
## -examples
2943

44+
Refer to the [KeyCredentialManager sample](https://github.com/Microsoft/Windows-universal-samples/tree/main/Samples/KeyCredentialManager) for an example of exporting and parsing the public key.
45+
3046
## -see-also

0 commit comments

Comments
 (0)