Skip to content

Commit 74b9d71

Browse files
authored
Refactor/client attestation (#506)
* refactor: client attestation Signed-off-by: Kevin <kevin.dinh@lissi.id> * refactor: client attestation 2 Signed-off-by: Kevin <kevin.dinh@lissi.id> * refactor: client attestation 3 Signed-off-by: Kevin <kevin.dinh@lissi.id> * fix attestations Signed-off-by: Kevin <kevin.dinh@lissi.id> * fix attestations 2 Signed-off-by: Kevin <kevin.dinh@lissi.id> * refactor: client attestation 4 Signed-off-by: Kevin <kevin.dinh@lissi.id> * refactor: client attestation 5 Signed-off-by: Kevin <kevin.dinh@lissi.id> * fix test Signed-off-by: Kevin <kevin.dinh@lissi.id> * refactor: client attestation 6 Signed-off-by: Kevin <kevin.dinh@lissi.id> --------- Signed-off-by: Kevin <kevin.dinh@lissi.id>
1 parent 603f243 commit 74b9d71

35 files changed

+716
-794
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,18 @@ namespace WalletFramework.Core.Cryptography.Abstractions;
44

55
/// <summary>
66
/// Represents a store for managing keys.
7-
/// This interface is intended to be implemented outside of the framework on the device side,
7+
/// This interface is intended to be implemented outside the framework on the device side,
88
/// allowing flexibility in key generation or retrieval mechanisms.
99
/// </summary>
1010
public interface IKeyStore
1111
{
12+
/// <summary>
13+
/// Asynchronously deletes the key associated with the provided key ID.
14+
/// </summary>
15+
/// <param name="keyId">The identifier of the key that should be deleted</param>
16+
/// <returns>A <see cref="Task" /> representing the asynchronous operation.</returns>
17+
Task DeleteKey(KeyId keyId);
18+
1219
/// <summary>
1320
/// Asynchronously generates a key for the specified algorithm and returns the key identifier.
1421
/// </summary>
@@ -18,7 +25,7 @@ public interface IKeyStore
1825
Task<KeyId> GenerateKey(string alg = "ES256", bool isPermanent = true);
1926

2027
/// <summary>
21-
/// Gets the public key of the pair
28+
/// Gets the public key of the pair
2229
/// </summary>
2330
/// <param name="keyId">The identifier of the key pair.</param>
2431
/// <returns>
@@ -33,11 +40,4 @@ public interface IKeyStore
3340
/// <param name="payload">The payload to sign.</param>
3441
/// <returns>A <see cref="Task{TResult}" /> representing the signed payload as a byte array.</returns>
3542
Task<RawSignature> Sign(KeyId keyId, byte[] payload);
36-
37-
/// <summary>
38-
/// Asynchronously deletes the key associated with the provided key ID.
39-
/// </summary>
40-
/// <param name="keyId">The identifier of the key that should be deleted</param>
41-
/// <returns>A <see cref="Task" /> representing the asynchronous operation.</returns>
42-
Task DeleteKey(KeyId keyId);
4343
}

src/WalletFramework.Oid4Vc/ClientAttestation/ClientAttestationDetails.cs

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/WalletFramework.Oid4Vc/ClientAttestation/ClientAttestationPopDetails.cs

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/WalletFramework.Oid4Vc/ClientAttestation/ClientAttestationService.cs

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/WalletFramework.Oid4Vc/ClientAttestation/CombinedWalletAttestation.cs

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/WalletFramework.Oid4Vc/ClientAttestation/IClientAttestationService.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/WalletFramework.Oid4Vc/ClientAttestation/WalletInstanceAttestationJwt.cs

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/WalletFramework.Oid4Vc/ClientAttestation/WalletInstanceAttestationPopJwt.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using WalletFramework.Core.Cryptography.Models;
2+
3+
namespace WalletFramework.Oid4Vc.ClientAttestations.Abstractions;
4+
5+
public interface IAttestationSigner
6+
{
7+
Task<string> CreateSignedJwt(object header, object payload, KeyId keyId);
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using WalletFramework.Oid4Vc.Oid4Vci.Authorization.Models;
2+
using WalletFramework.Oid4Vc.WalletAttestations;
3+
4+
namespace WalletFramework.Oid4Vc.ClientAttestations.Abstractions;
5+
6+
public interface IClientAttestationService
7+
{
8+
public Task<ClientAttestation> GetClientAttestation(AuthorizationServerMetadata authorizationServerMetadata);
9+
}

0 commit comments

Comments
 (0)