Skip to content

Commit 2a39cc9

Browse files
authored
add ephemeral key for dpop (#160)
Signed-off-by: Sebastian Bickerle <sebastian.bickerle@lissi.id>
1 parent 6ac70e0 commit 2a39cc9

File tree

2 files changed

+3
-2
lines changed
  • src

2 files changed

+3
-2
lines changed

src/WalletFramework.Core/Cryptography/Abstractions/IKeyStore.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ public interface IKeyStore
1313
/// Asynchronously generates a key for the specified algorithm and returns the key identifier.
1414
/// </summary>
1515
/// <param name="alg">The algorithm for key generation (default is "ES256").</param>
16+
/// <param name="isPermanent">If false creates an ephemeral key.</param>
1617
/// <returns>A <see cref="Task{TResult}" /> representing the generated key's identifier as a string.</returns>
17-
Task<KeyId> GenerateKey(string alg = "ES256");
18+
Task<KeyId> GenerateKey(string alg = "ES256", bool isPermanent = true);
1819

1920
/// <summary>
2021
/// Asynchronously loads a key by its identifier and returns it as a JSON Web Key (JWK) containing the public key

src/WalletFramework.Oid4Vc/Oid4Vci/Authorization/Implementations/TokenService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public async Task<OneOf<OAuthToken, DPopToken>> RequestToken(
3030
{
3131
if (metadata.IsDPoPSupported)
3232
{
33-
var keyId = await _keyStore.GenerateKey();
33+
var keyId = await _keyStore.GenerateKey(isPermanent: false);
3434

3535
var config = new DPopConfig(keyId, metadata.TokenEndpoint);
3636

0 commit comments

Comments
 (0)