diff --git a/src/WalletFramework.Core/Base64Url/Base64UrlString.cs b/src/WalletFramework.Core/Base64Url/Base64UrlString.cs index 71e74b6..1d288cd 100644 --- a/src/WalletFramework.Core/Base64Url/Base64UrlString.cs +++ b/src/WalletFramework.Core/Base64Url/Base64UrlString.cs @@ -6,6 +6,8 @@ public readonly struct Base64UrlString { private string Value { get; } + public byte[] AsByteArray => Base64UrlEncoder.DecodeBytes(Value); + private Base64UrlString(string value) { Value = value; diff --git a/src/WalletFramework.Core/Cryptography/Models/PublicKey.cs b/src/WalletFramework.Core/Cryptography/Models/PublicKey.cs index 17c5f92..d0a5415 100644 --- a/src/WalletFramework.Core/Cryptography/Models/PublicKey.cs +++ b/src/WalletFramework.Core/Cryptography/Models/PublicKey.cs @@ -11,7 +11,7 @@ public record PublicKey(Base64UrlString X, Base64UrlString Y) public static class PublicKeyFun { - public static object ToJwkObj(this PublicKey publicKey) => new + public static object ToObj(this PublicKey publicKey) => new { kty = publicKey.KeyType, crv = publicKey.Curve, diff --git a/src/WalletFramework.Oid4Vc/Oid4Vci/Authorization/DPop/Implementations/DPopHttpClient.cs b/src/WalletFramework.Oid4Vc/Oid4Vci/Authorization/DPop/Implementations/DPopHttpClient.cs index 5961a37..16dff85 100644 --- a/src/WalletFramework.Oid4Vc/Oid4Vci/Authorization/DPop/Implementations/DPopHttpClient.cs +++ b/src/WalletFramework.Oid4Vc/Oid4Vci/Authorization/DPop/Implementations/DPopHttpClient.cs @@ -129,7 +129,7 @@ private async Task GenerateDPopHeaderAsync(KeyId keyId, string audience, }; var publicKey = await _keyStore.GetPublicKey(keyId); - header["jwk"] = publicKey.ToJwkObj(); + header["jwk"] = publicKey.ToObj(); string? ath = null; if (!string.IsNullOrEmpty(accessToken)) diff --git a/src/WalletFramework.SdJwtVc/Services/SdJwtVcHolderService/SdJwtSigner.cs b/src/WalletFramework.SdJwtVc/Services/SdJwtVcHolderService/SdJwtSigner.cs index 724acf4..37ba33f 100644 --- a/src/WalletFramework.SdJwtVc/Services/SdJwtVcHolderService/SdJwtSigner.cs +++ b/src/WalletFramework.SdJwtVc/Services/SdJwtVcHolderService/SdJwtSigner.cs @@ -24,7 +24,7 @@ public async Task GenerateKbProofOfPossessionAsync(KeyId keyId, string a if (string.Equals(type, "openid4vci-proof+jwt", StringComparison.OrdinalIgnoreCase)) { var publicKey = await _keyStore.GetPublicKey(keyId); - header["jwk"] = publicKey.ToJwkObj(); + header["jwk"] = publicKey.ToObj(); } var payload = new Dictionary