Skip to content

Commit

Permalink
adjust Base64UrlString (#167)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin <[email protected]>
  • Loading branch information
Dindexx authored Aug 20, 2024
1 parent 8016504 commit 912ad59
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/WalletFramework.Core/Base64Url/Base64UrlString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ public readonly struct Base64UrlString
{
private string Value { get; }

public byte[] AsByteArray => Base64UrlEncoder.DecodeBytes(Value);

private Base64UrlString(string value)
{
Value = value;
Expand Down
2 changes: 1 addition & 1 deletion src/WalletFramework.Core/Cryptography/Models/PublicKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private async Task<string> 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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public async Task<string> 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<string, object>
Expand Down

0 comments on commit 912ad59

Please sign in to comment.