Skip to content

Commit

Permalink
feat(did): docs for padding
Browse files Browse the repository at this point in the history
  • Loading branch information
Torsten Egenolf committed Jun 4, 2024
1 parent a1a941f commit bcbec9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion certs/generate_did_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
y = public_key.public_numbers().y

# Convert the x and y coordinates to base64url format
# using base64url without padding as in https://datatracker.ietf.org/doc/html/rfc7515#appendix-C
x = base64.urlsafe_b64encode(x.to_bytes((x.bit_length() + 7) // 8, 'big')).decode().rstrip('=')
y = base64.urlsafe_b64encode(y.to_bytes((y.bit_length() + 7) // 8, 'big')).decode().rstrip('=')

Expand All @@ -43,7 +44,7 @@
"controller": did_controller,
"verificationMethod": [
{
"id": did_id + "#%2FrcyDdJNU%2FA%3D",
"id": did_id,
"type": "JsonWebKey2020",
"controller": did_controller,
"publicKeyJwk": {
Expand Down

0 comments on commit bcbec9f

Please sign in to comment.