You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to create a "generic" API client for Keria. With dependencies to 3rd party libraries supporting crypto and http message signatures only. I don't know if this is feasible or not but I'm giving it a try.
While reviewing the HTTP Message Signature implementation of keria/signifypy I have found a couple of potential interop issues.
These are the Signature and Signature-Input headers from keria test_authing.py:
From HTTP Message Signatures about the Signature header:
The member's key is the label that uniquely identifies the message signature within the HTTP message. The member's value is a Byte Sequence containing the signature value for the message signature identified by the label.
For better interop the key ("signify") should uniquely identify this message. The Signature header then looks like this:
For the CESR encoded signature value I think there are two options:
Remove the CESR code prefix "0B", then encode the payload as base64 (with padding, not url safe)
Transform the CESR signature value into B-domain, then encode as base64 (not url safe). Introduce KERI CESR specific signature alg name for example "keri-ed25519" (or simply "keri-signature" as the CESR signature value already identifies the algorithm)
With option 1) and correct datatypes of Byte Sequence and Boolean the value looks like this:
I don't know if HTTP Message Signatures allows extending the Signature value with parameters. To avoid interop issues I'd suggest moving the "indexed" parameter to the Signature-Input header. This way the parameter is also included in the signed payload.
The Signature and Signature-Input headers then look like this:
The concept of a "generic" client is nonsensical. There is a very specific sequence you must follow to boot strap an Agent in the KERIA service and very specific rules to follow regarding signing of requests, validating signatures of responses and passcode rotation. If you are doing that, you are a Signify client. You are overcomplicating things to say that there could be something more generic that being a Signify client.
The signature on the header is a KERI signature and those are represented in CESR. Your library will need to generate CESR signatures, digests, prefixes etc etc to be a Signify client so there is no need to worry about interop with anyone that can't generate a CESR signature.
About Keria API and HTTP Message Signatures
I'd like to create a "generic" API client for Keria. With dependencies to 3rd party libraries supporting crypto and http message signatures only. I don't know if this is feasible or not but I'm giving it a try.
While reviewing the HTTP Message Signature implementation of keria/signifypy I have found a couple of potential interop issues.
These are the Signature and Signature-Input headers from keria test_authing.py:
From HTTP Message Signatures about the Signature header:
For better interop the key ("signify") should uniquely identify this message. The Signature header then looks like this:
For the CESR encoded signature value I think there are two options:
With option 1) and correct datatypes of Byte Sequence and Boolean the value looks like this:
I don't know if HTTP Message Signatures allows extending the Signature value with parameters. To avoid interop issues I'd suggest moving the "indexed" parameter to the Signature-Input header. This way the parameter is also included in the signed payload.
The Signature and Signature-Input headers then look like this:
The second option uses alg="keri-ed25519" and looks like this:
References
The text was updated successfully, but these errors were encountered: