How to generate binary signature / hash using private key in Wappler?

I need to connect to an API which requires a digital signature. I need to hash the message using SHA-256 and sign with a private key.

Is there a ‘Wappler way’ to do this or do I need to write some custom code somewhere?

I am using a node server (docker and Digital Ocean).

Thanks all!

You would need to write a custom extension/formatter for this

The SHA-256 hash there’s probably a Wappler formatter already

Thanks. I haven’t tried custom formatters in Wappler before. I assume it’s these instructions:
Wappler Extensibility - Build Custom Wappler Extensions - Docs / Wappler Extensibility - Wappler Community
Writing Custom Modules and Formatters (NodeJS) - Docs / Wappler Extensibility - Wappler Community
Wappler Extensibility - Writing Custom Modules and Formatters for Server Connect - Docs / Wappler Extensibility - Wappler Community

I’ve looked through and it’s not clear to me how I actually call the function from within the Server Connect screen (the normal server actions one)? Will it appear as an option when I add an action, or is there a specific action I use to call it?

Also where can I see if Wappler has a formatter for SHA-256 hash? I couldn’t see one - only the Argon hash. If it doesn’t then I can use the crypto module in Node as part of the formatter but probably easier if it’s built in.

Thanks

Yes it does, and others also, see below:

You can use these Cryptographic Formatters on any input (post or an ouput from a query, or a pre-defined variable etc). They can be found in Server Connect. Simply select the value you wish to hash and right click to show the available Formatters.

You use a Set Value step and manually apply the formatter in the expression. Try first for the SHA-256 hash so you get a sense of things

Ah - I was foolishly looking in completely the wrong place. Thanks!

2 Likes

Got it - sounds easy. Thanks